Getting remount to work right.
rob at landley.net
Tue Dec 20 02:34:30 UTC 2005
Ok, you know how you can feed any arbitrary string into the "blockdev"
argument for non-block device backed mounts (like tmpfs) and it'll happily
remember that for you and pass it back via /proc/mounts?
Try doing this (assuming you have tmpfs mounted on /dev):
mount -t tmpfs /dev sub
mount -o remount,size=100 /dev
Mount _WILL_GET_CONFUSED_. There's really no way around it I can see. It
can't figure out if you mean /dev the directory or /dev the block device,
because you _can_ remount the block device, ala:
mount /dev/ram0 sub
mount -o remount,ro /dev/ram0
I noticed this because the following garbage is in ubuntu's /etc/mtab file:
/dev /.dev unknown rw,bind 0 0
none /dev tmpfs rw,size=5M,mode=0755 0 0
The second is the tmpfs on /dev. The first is some trash ubuntu hallucinated
(the corresponding /proc/mounts line might be:
/dev2/root2 /.dev ext3 rw,noatime 0 0
which seems to be trash left over from before the initrd did a chroot, or some
such. There's certainly no /dev2 now. I'd write that off as "yet another
thing subtly wrong with ubuntu", except that my example will also confuse
In fact, my example will confuse it moreso because I _think_ the right thing
to do here is keep going until the last hit (in case of overmounts, the last
one is what you want).
The only way I can see to make this reliable is to make mount check which
filesystems are backed and which aren't, and only look at the block device
when the field is actually used. (I can get that info out
of /proc/filesystems, which I'm already looking at. The question is how to
do it without increasing the size noticeably...
Darn it, the plane into Philadelphia has started its descent and I wanted to
get this done before landing, but mount continues to be a hideous nest of
strange corner cases.
P.S. Ok, so what does `mount -t tmpfs " " sub` do?
\040 /home/landley/busybox/busybox/sub tmpfs rw 0 0
It's nice to the kernel guys are with it...
Steve Ballmer: Innovation! Inigo Montoya: You keep using that word.
I do not think it means what you think it means.
More information about the busybox