Hacking partition tables (was: multiple loop-mounts of the same fs-file)

Nahshon (nahshon@actcom.co.il)
Mon, 30 Mar 1998 22:30:42 +0300 (EET DST)


>
> PS: I hear ppl asking "why the hell does he want to mount twice the *same*
> file ?" :-)
>
You can have an offset value specified to a loop device. This was
very useful for me when I had to recover a disk with a lost partition
table. Just mount /dev/sdb 5 times - fia different loop devices and
with different offsets. This cannot efficiently replace disk partitions
becuase seeks are not optimized between loop devices (it really trashes
the disk!) but it served me well for recovery.

Current version of loop.c allows up to 2^31-1 bytes offsets. I had to
make a small change to loop.c and some utilities to allow loff_t
parameter. I think this change should be applied to Linux-2.3.

Related to this subject, Linux supports multiple partition-table
formats - all must be resident inside the kernel (if they are configured).
How about adding a 'set-partition' disk ioctl. This will allow
all partition tables (except for the native ones) to be set by a user-
mode program. (native = anything required to find the root partition,
possibly none if initrd is used).

Itai

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu