Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fstabinfo, mount -n and read-only root
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
kirrun
n00b
n00b


Joined: 19 Dec 2006
Posts: 5
Location: St.Petersburg, Russia

PostPosted: Wed Jun 08, 2011 9:13 pm    Post subject: fstabinfo, mount -n and read-only root Reply with quote

Hello,

A very interesting issue here.

When my new gentoo box boots, after mounting /dev/shm, I get warning about lock on /etc/mtab~bla-bla. Of course it can't create this lock file because devfs starts before root (so root fs is still ro).


Code:

#/etc/init.d/devfs:

    for x in \
        "devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \
        "tmpfs /dev/shm 1777 ,nodev shm" \
    ; do
        <...>
        if [ -d $2 ]; then
            ebegin "Mounting $2"
            if ! fstabinfo --mount $2; then
                mount -n -t $1 -o noexec,nosuid$4 $5 $2
            fi
            eend $?
        fi
    done


I see here that devfs init script calls mount with -n so it doesn't try to modify /etc/mtab. But since /dev/shm is in my fstab, fstabinfo is called instead. I checked its source and as I see it calls mount without -n. Is it a bug?
So it seems strange to me that I don't get this warning on other gentoo systems.

For example, I did the following on my laptop:

    1. set rc_interactive="YES"
    2. interrupt boot sequence just before devfs starts (root is still mounted ro)
    3. drop into rescue shell
    4. call mount without -n

And it just mounts filesystem without saying anything! It doesn't try to modify mtab even without -n, does it?

Update:
Quote:

(none) ~ # touch /etc/mtab~
touch: cannot touch `/etc/mtab~`: Read-only file system
(none) ~ # mount -t tmpfs tmpfs /tmp
(none) ~ #

Huh? Why didn't it try to update mtab?

Update:
OK I got it. This message is shown only when /etc/mtab doesn't exist. After it has been created on successfull boot the warning disappears forever.

This behaviour still seems slightly odd to me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum