I'm putting the final touches on kinit, which is the user-space replacement (based on klibc) for the whole in-kernel root-mount complex. Pretty much the one thing remaining -- other than lots of testing -- is to handle automatically mounted md devices. In order to do that, without adding userspace versions of all the paritition code (which may be a future change, but a pretty big one) it would be good if the partition flag to auto-configure RAID was available in userspace, presumably through sysfs. Any feeling how best to do that? My current thinking is to export a "flags" entry in addition to the current ones, presumably based on "struct parsed_partitions->parts[].flags" (fs/partitions/check.h), which seems to be what causes md_autodetect_dev() to be called. Note that this should be available even if md isn't compiled into the kernel, thus making it possible to load md as a module before running kinit, or to make the equivalent of the kernel mounting sequence from a totally runtime user tool. -hpa
On Monday January 30, hpa@zytor.com wrote:> > Any feeling how best to do that? My current thinking is to export a > "flags" entry in addition to the current ones, presumably based on > "struct parsed_partitions->parts[].flags" (fs/partitions/check.h), which > seems to be what causes md_autodetect_dev() to be called. >I think I would prefer a 'type' attribute in each partition that records the 'type' from the partition table. This might be more generally useful than just for md. Then your userspace code would have to look for '253' and use just those partitions. NeilBrown
On Mon, Jan 30, 2006 at 04:52:08PM -0800, H. Peter Anvin wrote:> I'm putting the final touches on kinit, which is the user-space > replacement (based on klibc) for the whole in-kernel root-mount complex. > Pretty much the one thing remaining -- other than lots of testing -- > is to handle automatically mounted md devices. In order to do that, > without adding userspace versions of all the paritition code (which may > be a future change, but a pretty big one) it would be good if the > partition flag to auto-configure RAID was available in userspace, > presumably through sysfs.What are you looking for exactly? udev has a great helper program, volume_id, that identifies any type of filesystem that Linux knows about (it was based on the ext2 lib code, but smaller, and much more sane, and works better.) Would that help out here? thanks, greg k-h
Reasonably Related Threads
- Convert "bare partition" to RAID1 / mdadm?
- CentOS Images on AWS with partitions on /dev/xvda1 are awkwared to resize
- [PATCH] Improve support for exporting btrfs subvolumes.
- NFS exporting btrfs subvolumes.
- Three Identical systems - short cut to setting up the drives?