mount command fails with 'relatime' kernel option
Denys Vlasenko
vda.linux at googlemail.com
Tue Jun 24 18:15:30 UTC 2008
Soory for extra late reply.
On Tuesday 18 December 2007 17:29, Michele Sanges wrote:
> > Pity, you did non specify "strace -s 512" option and we don't see full strings.
> > Can you redo it?
>
> Yes, are the attached files strace_1 and strace_2 respectively.
>
>
> > Can you also check whether busybox's "mount -o remount /" and util-linux's one
> > differ (I mean, does util-linux one work? If yes, post its strace too please).
>
> Yes, it works; the strace output is the attached file strace_3.
To rehash:
Fails: busybox mount -o remount /
Works: (util-linux) mount -o remount /
Works: busybox mount -o remount /dev/root /
Busybox with only one argument (failing one) looks into
/proc/mounts, collects existing opts, and tries to apply this.
Busybox with two arguments doesnt do it, it assumes
that this mount has all opts explicitedly specified on cmdline.
Util-linux mount with one param is EITHER
* does not scan /proc/mounts (if given remount opt, or maybe
even never),
OR
* is too clever: it discovers that /dev/root is /dev/sda5,
THEN looks into /proc/mounts and doesn't find it there,
and then happily does (re)mount without opts.
In order to fix it in busybox mount
I need to figure out which of the above is the case.
If you can help me with that, great.
Strace bits are below:
execve("/bin/mount", ["mount", "-o", "remount", "/"], [/* 13 vars */]) = 0
brk(0) = 0x9717000
...
open("/proc/mounts", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "
rootfs / rootfs rw 0 0
/dev/root / ext3 ro,relatime,data=ordered 0 0
/dev /dev tmpfs rw,relatime 0 0
/proc /proc proc rw,relatime 0 0
/sys /sys sysfs rw,relatime 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime 0 0
usbfs /proc/bus/usb usbfs rw,relatime 0 0
/dev/sda5 /mnt ext3 rw,relatime,data=ordered 0 0
", 1024) = 333
read(3, "", 1024) = 0
stat64("/dev/root", {st_mode=S_IFBLK|0600, st_rdev=makedev(8, 8), ...}) = 0
mount("/dev/root", "/", 0x80e3624, MS_RDONLY|MS_REMOUNT|MS_SILENT, "relatime,data=ordered") = -1 EINVAL (Invalid argument)
write(2, "mount: mounting /dev/root on / failed: Invalid argument\n", 56) = 56
exit_group(-1) = ?
util-linux:
execve("/bin/mount", ["mount", "-o", "remount", "/"], [/* 57 vars */]) = 0
...
read(3,
"rootfs / rootfs rw 0 0
/dev/root / ext3 rw,relatime,data=ordered 0 0 <============
/dev /dev tmpfs rw,relatime 0 0
/proc /proc proc rw,relatime 0 0
/sys /sys sysfs rw,relatime 0 0
/proc/bus/usb /proc/bus/usb usbfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime 0 0
tmpfs /dev/shm tmpfs rw,relatime 0 0
/dev/sda6 /mnt/appoggio ext3 rw,relatime,data=ordered 0 0
/dev/sda8 /mnt/linuxbox ext3 rw,relatime,data=ordered 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,r
"..., 1024) = 720
...
mount("/dev/sda5", "/", 0xb9638ba8, MS_MGC_VAL|MS_REMOUNT, NULL) = 0
busybox with explicit param:
execve("/bin/mount", ["mount", "-o", "remount", "/dev/root", "/"], [/* 13 vars */]) = 0
...
mount("/dev/root", "/", NULL, MS_REMOUNT|MS_SILENT, NULL) = 0
--
vda
More information about the busybox
mailing list