[ILUG] loopback partition tables ?

John P. Looney john at antefacto.com
Wed Nov 21 10:53:44 GMT 2001


On Wed, Nov 21, 2001 at 10:45:17AM +0000, Dave Neary mentioned:
> I can't help you with the partition table magic (surely that's a quick
> enough hack?) but if you can calculate the offset into the file then you
> can create /dev/loopN devices with losetup, which has an offset
> argument. It's not clear from the manpage whether it's possible to hang
> multiple loopback devices off one disk image, though. Thank Tony here
> for that answer :)

 OK, so I've a disk image called "disk.img" (fountain of inspiration, I
am).

 I'm looking for the first partition in that image. So;

     losetup -o 512 /dev/loop3 /tmp/disk.img
     mount -t ext2 /dev/loop3 /mnt/disk/

 Now this works. But there isn't anything there, even though I know there
should be. And, I get an error;

Nov 21 10:49:14 bartender kernel: EXT2-fs error (device loop(7,3)):
ext2_check_page: bad entry in directory #2: rec_len is smaller than
minimal - offset=0, inode=41471, rec_len=11, name_len=0

 So, I'm doing something wrong. Originally, I thought I'd do an offset of
1024 bytes, to get past the bootblock & the partition table. But that
moaned about no superblock, which didn't happen at a 512 byte offset.

 Any other ideas as to what I'm doing wrong ?

Kate

-- 
_______________________________________
John Looney             Chief Scientist
a n t e f a c t o     t: +353 1 8586004
www.antefacto.com     f: +353 1 8586014





More information about the ILUG mailing list