mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* losetup behavior
@ 2006-06-28 19:54 Hareesh Nagarajan
       [not found] ` <bda6d13a0606281313y733d6b63i80f672e233f9aeea@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Hareesh Nagarajan @ 2006-06-28 19:54 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-28 20:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-28 19:54 losetup behavior Hareesh Nagarajan
     [not found] ` <bda6d13a0606281313y733d6b63i80f672e233f9aeea@mail.gmail.com>
2006-06-28 20:50   ` Hareesh Nagarajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®