Re: Default size limits for /run (/var/run) and /run/lock (/var/lock)
Roger Leigh <rleigh@codelibre.net> writes:
> On Sat, Apr 16, 2011 at 09:35:53AM +0200, Goswin von Brederlow wrote:
>> To me that reads like you will mount a tmpfs on /tmp if root is
>> read-only even if RAMTMP is not set. Which is wrong if the system has a
>> /tmp filesystem in /etc/fstab.
>
> This is a good point. I've added the ability to detect if a
> filesystem will be mounted, and skip the tmpfs mount on /tmp if
> an entry for /tmp exists in fstab (will_mount in
> /lib/init/mount-functions.sh)
Thanks.
>> Also mount -a (in mountall.sh) fails, and therefore the whole boot, if a
>> mountpoint already has something else mounted. If you unconditionally
>> mount a tmpfs on /tmp if root is read-only then you just made systems
>> unbootable that have /tmp in fstab.
>
> This is not correct. Have you actually tried it? I have, and other
> than the cosmetic issue of having a real filesystem mounted over the
> top of the tmpfs, the system is entirely functional, and boots error
> free. And with the above change, even this cosmetic issue is gone.
Hmm. This is strange. I extrapolated from my experience with proc
(#603858):
/proc/mounts: (proc mounted by initramfs-tools in the ramdisk)
none on /proc type proc (rw,relatime)
fstab:
proc /proc proc defaults 0 0
# mount -v -a -t nonfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs,gfs2 -O no_netdev
mount: proc already mounted or /proc busy
mount: according to mtab, none is already mounted on /proc
# echo $?
32
BUT:
/proc/mounts:
none on /tmp2 type tmpfs (rw,relatime)
fstab:
tmpfs /tmp2 tmpfs defaults 0 0
# mount -v -a -t nonfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs,gfs2 -O no_netdev
tmpfs on /tmp2 type tmpfs (rw)
# echo $?
0
It seems like proc is a special case that doesn't allow mounting
something over it. With tmpfs it just mounts over the old entry. Sorry
for raising the alarm.
MfG
Goswin
Reply to: