losetup behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In my example below I have an image of an entire disk /dev/sda created
using the dd command. The name of the file is foo.img. There are
(internally) 3 partitions. ext2 (root), swap, ext2 (data). I will
extract the third partition, first with dd and show that it works and
then with losetup and show that it doesn't work.

With dd:
root: / # dd if=foo.img of=part3 bs=512 skip=12402180 count=21141540
(Partition 3 begins at: 12402180 * 512 = 6349916160 bytes from start)

root: / # mount -o loop=/dev/loop0 part3 mypart3/
root: microv3/ # cd mypart3/; ls
blah/ blah-blah/

*works*

With losetup:
root: # losetup -o6349916160 /dev/loop0 foo.img
root: # mount /dev/loop0 mypart3/
mount: you must specify the filesystem type
root: / # mount -t ext2 /dev/loop0 mypart3
mount: wrong fs type, bad option, bad superblock on /dev/loop5,
or too many mounted file systems

*doesn't work*

At this point I must mention that losetup had no issues in mounting
the first partition.

root: # losetup -o32256 /dev/loop0 foo.img
(Partition 1 begins at: 63 * 512 = 32256 bytes from start)
root: # mount /dev/loop0 myroot/
root: # cd myroot/; ls
bin/   dev/

*works*

Anyone know, if this is the correct behaviour of losetup? Perhaps, I
am doing something incorrectly.

Thanks,

--
./hareesh
PS: uname -r ---> 2.6.16.11
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux