FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 04-16-2011, 09:39 AM
Roger Leigh
 
Default Default size limits for /run (/var/run) and /run/lock (/var/lock)

On Sat, Apr 16, 2011 at 09:35:53AM +0200, Goswin von Brederlow wrote:
> Roger Leigh <rleigh@codelibre.net> writes:
>
> > On Fri, Apr 15, 2011 at 04:41:56PM +0200, Goswin von Brederlow wrote:
> >> Roger Leigh <rleigh@codelibre.net> writes:
> >>
> >> > If it wasn't already clear, having /tmp as a tmpfs is a
> >> > /configurable option/, and it is /not/ the default (except when
> >> > root is read-only (ro) in fstab).
> >>
> >> I hope you check the fstab first. If there is a entry for a non tmpfs
> >> /tmp filesystem then that should be used. I'm assuming you do but just
> >> to be sure...
> >
> > No, we don't check. It's up to the admin to configure their
> > system properly. If there is an entry in in fstab, it'll be
> > mounted on top of the tmpfs, so the system will be configured
> > the way they asked, but there will be a hidden tmpfs mount.
> > But they would have explicitly needed to set RAMTMP=yes to get
> > into this situation.
> >
> > For new installs, where the default /etc/default/rcS files does
> > set RAMTMP=yes by default, the fstab file will not yet contain
> > any user-specific mounts. If they do want to manuall mount
> > something on /tmp, then they simply set RAMTMP=no.
> >
> > Note this behaviour is exactly the same as existing practice for
> > /dev/shm, /var/run and /var/lock.
>
> Then I don't get your 'is /not/ the default (except when root is
> read-only (ro) in fstab)'.
>
> 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)

> 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.


Regards,
Roger

--
.'`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
 
Old 04-16-2011, 10:31 AM
Philip Hands
 
Default Default size limits for /run (/var/run) and /run/lock (/var/lock)

On Sat, 16 Apr 2011 09:17:04 +0200, Josselin Mouette <joss@debian.org> wrote:
> Le mercredi 13 avril 2011 à 10:51 +0100, Philip Hands a écrit :
> > Therefore, in the multi-partition setup, I think we should also default
> > to having /tmp on tmpfs.
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=245465

Ah, good point -- so rather than just chatting about this I should
probably get off my arse and start making some sort of contribution to
d-i.

I'll test your patch.

Cheers, Phil.
--
|)| Philip Hands [+44 (0)20 8530 9560] http://www.hands.com/
|-| HANDS.COM Ltd. http://www.uk.debian.org/
|(| 10 Onslow Gardens, South Woodford, London E18 1NE ENGLAND
 
Old 04-16-2011, 11:08 AM
rleigh
 
Default Default size limits for /run (/var/run) and /run/lock (/var/lock)

On Sat, Apr 16, 2011 at 11:31:08AM +0100, Philip Hands wrote:
> On Sat, 16 Apr 2011 09:17:04 +0200, Josselin Mouette <joss@debian.org> wrote:
> > Le mercredi 13 avril 2011 à 10:51 +0100, Philip Hands a écrit :
> > > Therefore, in the multi-partition setup, I think we should also default
> > > to having /tmp on tmpfs.
> >
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=245465
>
> Ah, good point -- so rather than just chatting about this I should
> probably get off my arse and start making some sort of contribution to
> d-i.

By the way, now that initscripts has support for mounting tmpfs
on /tmp, all d-i needs to do is to set RUNTMP=yes when creating
/etc/default/rcS (it already needs to do this for UTC). It
might also want to allow adjustment of the size set in
/etc/default/tmpfs and ensure there's sufficient swap space
configured, but it shouldn't actually require any fstab changes.
(Though the mount logic should let it pick up the mount options
from /etc/fstab, if present.)


Regards,
Roger

--
.'`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20110416110822.GB13995@codelibre.net">http://lists.debian.org/20110416110822.GB13995@codelibre.net
 
Old 04-16-2011, 05:52 PM
Goswin von Brederlow
 
Default 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,gfs 2 -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,gfs 2 -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


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87oc46dqy2.fsf@frosties.localnet">http://lists.debian.org/87oc46dqy2.fsf@frosties.localnet
 

Thread Tools




All times are GMT. The time now is 10:09 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org