[BusyBox] Filesystem detection in mount & lazy unmount

Rob Landley rob at landley.net
Tue Jul 12 07:04:51 UTC 2005


On Monday 11 July 2005 17:06, Chris Spiegel wrote:
> It's true that /etc/filesystems can sort of take the role of automatic
> filesystem detection.  My goal as a lazy end-user, though, is to do as
> little as humanly possible to get my system working -- currently I have an
> initrd that, among other things, doesn't need to be told the root
> filesystem type, and if I happen to change it I won't have to make sure
> that a text file is up to date, because I'm using util-linux's mount.  Of
> course, getting to my goal of lazy end-user may include lots of work
> hacking code but I don't mind that for some reason.  :)

The way automatic filesystem detection normally works is that it tries all the 
various filesystems the kernel supports in order, and takes the first one 
that doesn't fail.  If this doesn't successfully mount the filesystem, then 
the kernel doesn't support it.

The two potential idiosyncrasies are: 1) mounting filesystems you've compiled 
as modules (which thus aren't listed in /proc/filesystems until the module is 
loaded), 2) the fact that some kernels are broken and list ext2 before ext3 
(if you try to mount an ext3 filesystem as ext2, it works, but is wrong).

Hence /etc/filesystems to let you list filesystems that you have in modules so 
they're always tried, and to list ext3 at the beginning.

> It's great to hear about updates to mount.. I'll be happy to test the
> changes, as my goal of being a lazy end-user also includes dropping
> (almost) everything except busybox.  The better busybox works, the better
> my system is.

My laptop is back from the laptop fixing people now, and seems to be working.  
Hopefully tomorrow I'll get some time to finish up the mount/umount work...

My main thrust (other than a general code cleanup, space reduction, fixing 
some really strange corner cases I hit having to do with read only 
partitions, and so on) is making it so you no longer have to say "-o loop".  
Mount can detect whether the block device you point it at is really a block 
device or a file, and behave accordingly.  (Why it didn't do this years ago 
is an open question.)

Oh, and I had a request to add "user" support to /etc/fstab so a suid mount 
can do the right thing there.  Haven't implemented that yet, but the code 
cleanup makes it easier...

> Chris

Rob



More information about the busybox mailing list