This can be done trivially in user-space without breaking any existing
code and without having to enable partitioning of a single loop device.
All that we need to do is take a tool like partx (from util-linux)
to decode the partition table and find the partition offset+size, and then
feed that to losetup (or call the loop setup ioctl directly) for each
partition. You get a bunch of loop devices set up, one for each partition.
The only thing one might want to have is some option to losetup to list
all of the loop devices currently set up ("losetup -a" or something) so
you can see which loop device corresponds to what disk partition. Of
course the partx tool would also print that out at setup time, but
people have short memories for this sort of stuff.
> Although I do have this suspicion that that partitioning support should be
> in user space (along with all the rest of the partitioning support, but
> that's another matter and has some rather more serious backwards
> compatibility issues, of course.
The partx tool (and GNU parted as well) _already_ can grok partitions
from user-space and tell the kernel about them (I had set up some
GPT/ia64 partitions on my ia32 box and mounted them just fine). All
that needs to be done is run this in early setup before we need to
mount the root filesystem.
-- Andreas Dilger http://www-mddsp.enel.ucalgary.ca/People/adilger/ http://sourceforge.net/projects/ext2resize/
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to firstname.lastname@example.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/