kirrun n00b
Joined: 19 Dec 2006 Posts: 5 Location: St.Petersburg, Russia
|
Posted: Wed Jun 08, 2011 9:13 pm Post subject: fstabinfo, mount -n and read-only root |
|
|
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. |
|