[Nix-dev] /etc/mtab - information loss in stage-2?

Marc Weber marco-oweber at gmx.de
Thu Jul 10 02:02:36 CEST 2008


Hi,

/etc/mtab is kind of file reflecting mount status (similar to
/proc/mounts).
When using mount -n the file is not updated.
Don't know what happens on lazy umount (Haven't checked)

/etc/mtab can even be symlinked /proc/mounts which is faster if you have
many mounts (-> man mount) but because /proc/mounts doesn't list some
options (such as user) a user will no longer be able to umount a device
previously been mounted with the user option..

stage-2 contains
cat /proc/mounts > /etc/mtab
(thus overriding the sensible extra options having been saved to
/etc/mtab by mount ran in stage-1)
So what about using this line in stage-1 prior to any mounting?

It's unlikely that you'll mount a partition with user option specified
by configuration.nix but not impossible..

Do I have missed a point?

Marc Weber



More information about the nix-dev mailing list