Disk mounting

From Noah.org
Revision as of 14:29, 15 February 2009 by Root (talk | contribs) (→‎fdisk)
Jump to navigationJump to search


fdisk

This will list all the disks that Linux sees. This will not show loop devices. See `losetup` example for more information:

fdisk -l

mount individual partitions in a whole disk image

If you have a while disk image and you want to mount partitions inside that image then use `losetup` to create a loopback device for the image.

For example, if you copied an entire disk using `dd` like this:

dd if=/dev/sda of=disk.img bs=32768

You can later create a loopback device for it and see its partitions with `fdisk` and mount those partitions individually with `mount`.

losetup /dev/loop0 disk.img
fdisk -l /dev/loop0

It is also possible to mount partitions inside a disk image file directly with `mount` using the 'offset' option, but I have not had luck with this.

mount -o loop,ro,offset=1025 disk.img /media/adhoc