Summary: | Size parameter for tmpfs in fstab is not applied during reboot. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Petr Ruzicka <pruzicka> |
Component: | initscripts | Assignee: | Lukáš Nykrýn <lnykryn> |
Status: | CLOSED ERRATA | QA Contact: | qe-baseos-daemons |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 6.0 | CC: | atodorov, azelinka, bz-reply, esandeen, javier.ramirez, jholcape, jmoyer, joerg.loges, jscotka, kzak, mhomolov, mishu, rsawhill, rwheeler, sbeal, syeghiay |
Target Milestone: | rc | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | initscripts-9.03.32-1.el6 | Doc Type: | Bug Fix |
Doc Text: |
Cause:
/dev/shm is mounted in dracut without attributes from fstab.
Consequence:
/dev/shm does not have attributes from fstab.
Fix:
Remount /dev/shm in rc.sysinit.
Result:
/dev/shm has attributes from fstab.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2013-02-21 10:25:13 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: |
Description
Petr Ruzicka
2011-01-14 13:44:05 UTC
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. If you would like it considered as an exception in the current release, please ask your support representative. Filesystem is just basic package with system directory layout. Let's try kernel for this one bugzilla. I tried the following entries in fstab, but no luck: none /dev/shm tmpfs defaults,size=5G 0 0 tmpfs /dev/shm tmpfs defaults,size=5g 0 0 tmpfs /dev/shm tmpfs defaults,size=500m 0 0 tmpfs /dev/shm tmpfs defaults,size=500M 0 0 Regards PetrR Hello. I also tried size=10% parameter, which is also not working. See you PetrR Hello. I can confirm this bug is also appearing in the latest RHEL6.1 version (installed today from developer's repo). I tried in /etc/fstab: none /dev/shm tmpfs defaults,size=10m 0 0 none /dev/shm tmpfs defaults,size=10M 0 0 none /dev/shm tmpfs defaults,size=10% 0 0 -> but after reboot - nothing changed. Regards. PetrR This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux. If you would like it considered as an exception in the current release, please ask your support representative. If you try to do the mount from the command line, I think you'll find it works: # mount -t tmpfs none /mnt/xx -o size=10M # mount | grep tmpfs none on /mnt/xx type tmpfs (rw,size=10M,rootcontext="unconfined_u:object_r:mnt_t:s0") # df -h /mnt/xx Filesystem Size Used Avail Use% Mounted on none 10M 0 10M 0% /mnt/xx I can also resize this on the fly: # mount -t tmpfs none /mnt/xx -o remount,size=100M # df -h /mnt/xx Filesystem Size Used Avail Use% Mounted on none 100M 0 100M 0% /mnt/xx So, this may be a dracut or /sbin/init issue, but certainly not a kernel one. Mounting from command line is forking fine. But this should be also working from /etc/fstab during the boot... I'm not sure where should I put this ticket (sorry)... I just want to report the bug... A test with a size specified in /etc/fstab: tmpfs /tmp/tmpfs tmpfs defaults,size=10m 0 0 and then # mkdir /tmp/tmpfs # mount /tmp/tmpfs might tell us if it's an fstab parsing problem, maybe related to util-linux? If it works, then it is likely an initramfs sort of thing This request was erroneously denied for the current release of Red Hat Enterprise Linux. The error has been fixed and this request has been re-proposed for the current release. I tried it as you mentioned above: # grep ^tmpfs /etc/fstab tmpfs /tmp/tmpfs tmpfs,size=10m defaults 0 0 # mount /tmp/tmpfs # df -h /tmp/tmpfs Filesystem Size Used Avail Use% Mounted on tmpfs 246M 0 246M 0% /tmp/tmpfs # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.0 (Santiago) Regards PetrR I'm not able to reproduce the bug on RHEL6.1 stable (QA) system # echo "tmpfs /mnt/tmpfs tmpfs defaults,size=10m 0 0" >> /etc/fstab # mkdir -p /mnt/tmpfs # mount /mnt/tnmpfs # df -h | grep /mnt/tmpfs tmpfs 10M 0 10M 0% /mnt/tmpfs # uname -a Linux auto-x86-64-001.ss.eng.bos.redhat.com 2.6.32-94.el6.x86_64 #1 SMP Tue Dec 28 21:55:53 EST 2010 x86_64 x86_64 x86_64 GNU/Linux # rpm -qf /bin/mount util-linux-ng-2.17.2-9.el6.x86_64 Please, use strace to check if mount(8) works as expected: # strace -f -e mount mount /mnt/tmpfs [...] [pid 10914] mount("tmpfs", "/mnt/tmpfs", "tmpfs", MS_MGC_VAL, "size=10m,rootcontext=\"unconfined_u:object_r:mnt_t:s0\"") = 0 ^^^ this is syscall, size=10m is there. (In reply to comment #12) > I tried it as you mentioned above: > > # grep ^tmpfs /etc/fstab > tmpfs /tmp/tmpfs tmpfs,size=10m defaults > 0 0 This is not valid fstab entry of course, must be tmpfs /tmp/tmpfs tmpfs size=10m,defaults in your example is size=10m interpreted as second possible filesystem name (see -t in mount(8)) rather than mount option.... Hello. The "original bug description" was about the following lines in fstab (please see the "/dev/shm"): tmpfs /dev/shm tmpfs defaults,size=10m 0 0 I also tried the line mentioned above (just changed the /tmp/tmpfs -> /dev/shm): tmpfs /dev/shm tmpfs size=10m,defaults 0 0 => But after reboot the size was not applied. The tests with manual "mount" are always working fine - but during reboot it's not under RHEL6.x. This line in /etc/fstab "is working" fine in RHEL 5.6, but not in RHEL6.x: tmpfs /dev/shm tmpfs defaults,size=10m 0 0 This line in /etc/fstab "is working" fine in RHEL 5.6, but not in RHEL6.x: tmpfs /dev/shm tmpfs size=10m,defaults 0 0 Please let me know... PetrR dracut mounts /dev/shm and it is never remounted. So any /etc/fstab entry is not honored. Can you remount /dev/shm with -o remount,size=10m in a shell? I can remount /dev/shm in shell (with the correct size): # df -h /dev/shm Filesystem Size Used Avail Use% Mounted on tmpfs 246M 0 246M 0% /dev/shm # grep shm /etc/fstab tmpfs /dev/shm tmpfs size=10m,defaults 0 0 # mount /dev/shm # df -h /dev/shm Filesystem Size Used Avail Use% Mounted on tmpfs 10M 0 10M 0% /dev/shm # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.0 (Santiago) => So if I understand it well. It's not possible to set size parameter for /dev/shm during boot in /etc/fstab, because it's used by dracult. => Even this works in previous RHELs (4.x, 5.x) this will not work under RHEL6.x and later. =>> Am I right? PetrR err.. you did not remount... you just double mounted /dev/shm. check with # grep shm /proc/mounts And yes, in the current state, you could not control the following mount points with /etc/fstab: /proc /sys /dev /dev/pts /dev/shm / dracut upstream has support for /etc/fstab.sys and mount flags of / are honored. If /dev/shm is critical, then you would have to request a remount in dracut, after /etc/fstab is accessible and call this a bug. What about an entry in rc.local: mount -o remount,size=10M /dev/shm Hello. Thanks for the explanation. I can always to "workaround" in init scripts, but it's not "common". Dracult is the way forward and even if it brings little "incompatibility" with previous RHEL versions like in this example, it's a good thing. ==>> The final solution is using the init scripts to remount /dev/shm, because dracult ignores the mounts /dev/shm and it's not remounted after. Therefore /etc/fstab settings for /dev/shm are ignored. => I think you can close the ticket now, because I got the answer - It's just behave different than in RHEL5.x or 4.x. Some results from test I did: # grep shm /proc/mounts tmpfs /dev/shm tmpfs rw,seclabel,relatime 0 0 # grep shm /etc/fstab tmpfs /dev/shm tmpfs size=10m,defaults 0 0 # mount -o remount,size=10m /dev/shm # df -h /dev/shm Filesystem Size Used Avail Use% Mounted on tmpfs 10M 0 10M 0% /dev/shm ********* # umount /dev/shm # grep shm /proc/mounts # grep shm /etc/fstab tmpfs /dev/shm tmpfs size=10m,defaults 0 0 # mount /dev/shm # df -h /dev/shm Filesystem Size Used Avail Use% Mounted on tmpfs 10M 0 10M 0% /dev/shm Thanks PetrR Hi,
The customer where I'm working right now has found another workaround:
diff /etc/rc.d/rc.sysinit.org /etc/rc.d/rc.sysinit
504c504
< mount -f /dev/shm >/dev/null 2>&1
---
> mount /dev/shm >/dev/null 2>&1
What do you think about it?
Cheers.
(In reply to comment #22) > Hi, > > The customer where I'm working right now has found another workaround: > > diff /etc/rc.d/rc.sysinit.org /etc/rc.d/rc.sysinit > 504c504 > < mount -f /dev/shm >/dev/null 2>&1 > --- > > mount /dev/shm >/dev/null 2>&1 > > What do you think about it? > > Cheers. That would of course be the preferred fix. Reassigning to initscripts for comments. If I am not mistaken difference between 5 and 6 is that in rhel5 we don't mount /dev/shm in dracut. But remount it in initscripts should be fine. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0518.html |