mount -a remounts tmpfs entries: bug or feature?

Roy Marples roy at marples.name
Mon Nov 24 12:35:30 UTC 2008


On Mon, 24 Nov 2008 15:10:30 +0300, "Vladimir Dronnikov"
<dronnikov at gmail.com> wrote:
>>
>> > ...rathole when mount becomes _stateful_ utility. Do we need more
>> quirks...?
>>
>> It's not a quirk, it's needed :)
>> BSD man pages state that -a will ignore entries that already appear to
be
>> mounted.
>> core. Although the linux man pages don't state this, the behavior of GNU
>> mount from
>> util-linux is the same.
>  
> Again we need to clarify what BB conforms to, right?

No we don't :)
BB needs to conform to the behaviour of the Linux mount command.
If any clarification is needed, it's between the Linux mount and it's man
page.
And it's the man page that needs the adjustment if any.

> So the subsequent mount -a in the
>> boot scripts needs to avoid re-mounting /proc as it's already mounted.
> 
> 
> Why mount -a?
> # mountpoint -q /proc || mount /proc
> will do, much clearer, no?. Where is UNIX way? 

mount /proc
<do foo that requires stuff in /proc>
mount -a

So you're suggesting that mount -a is replaced by shell code to iterate
through fstab,
check if it's mounted and if not mounted, mount it? How do you propose to
do this?
>From the Linux fstab man page:

       The proper way to read records from fstab is to use the routines
getmntent(3).

I can attest that it's the *only* bullet proof way of doing it. And
getmntent isn't
available in many userland programs other than the mount/umount/fsck
interfaces.
You may think that you can find a way using awk, sed or grep, but I can
point you to
many Gentoo bugs which will demonstrate otherwise.

Thanks

Roy



More information about the busybox mailing list