Wrong size for /dev/shm partition with df -h

Issues related to applications and software problems
Post Reply
linuksash
Posts: 4
Joined: 2018/02/21 10:19:32

Wrong size for /dev/shm partition with df -h

Post by linuksash » 2018/02/21 10:35:00

Hello,
I've made, while install - separate partition /dev/shm (ext4/LVM) and with size of 24GiB, but after installation df -h show me only 16GB which is half of my installed RAM. Is this a bug or I just need to put size=24g in fstab? I'm using CentOS 7 with latest updates of kernel and everything.

My curent /etc/fstab is

Code: Select all

/dev/mapper/rhel-root   /                       ext4    defaults        1 1
UUID=46875cb8-a194-4a5d-9239-48eac1d6e4a1 /boot                   ext4    defaults        1 2
/dev/mapper/rhel-dev_shm /dev/shm               ext4    defaults        1 2
/dev/mapper/rhel-fra    /fra                    ext4    defaults        1 2
/dev/mapper/rhel-tmp    /tmp                    ext4    defaults        1 2
UUID=8dd99d38-eb70-4ff7-a1b6-dcc69db3ac36 /u01                    ext4    defaults        1 2
/dev/mapper/rhel-swap   swap                    swap    defaults        0 0
...and df -h show this

Code: Select all

Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   40G  3.1G   35G   9% /
devtmpfs                16G     0   16G   0% /dev
tmpfs                   16G     0   32G   0% /dev/shm
tmpfs                   16G  8.6M   16G   1% /run
tmpfs                   16G     0   16G   0% /sys/fs/cgroup
/dev/sda3               85G   16G   65G  20% /u01
/dev/sda1              477M  122M  326M  28% /boot
/dev/mapper/rhel-tmp   3.9G   26M  3.6G   1% /tmp
/dev/mapper/rhel-fra    30G  618M   28G   3% /fra
tmpfs                  3.2G     0  3.2G   0% /run/user/0
...lsblk:

Code: Select all

NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0                2:0    1    4K  0 disk
sda                8:0    0  200G  0 disk
├─sda1             8:1    0  500M  0 part /boot
├─sda2             8:2    0  114G  0 part
│ ├─rhel-root    253:0    0   40G  0 lvm  /
│ ├─rhel-swap    253:1    0   16G  0 lvm  [SWAP]
│ ├─rhel-dev_shm 253:2    0   24G  0 lvm
│ ├─rhel-tmp     253:3    0    4G  0 lvm  /tmp
│ └─rhel-fra     253:4    0   30G  0 lvm  /fra
└─sda3             8:3    0 85.5G  0 part /u01
sr0               11:0    1 1024M  0 rom

What I need to do here (or do I need to do anything here) to have correct partition size?

Kind regards!

Thanks!

User avatar
TrevorH
Forum Moderator
Posts: 23484
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Wrong size for /dev/shm partition with df -h

Post by TrevorH » 2018/02/21 11:29:27

I don't believe you can alter the size of /dev/shm at install time, it's a post-install customisation that you need to do.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

linuksash
Posts: 4
Joined: 2018/02/21 10:19:32

Re: Wrong size for /dev/shm partition with df -h

Post by linuksash » 2018/02/21 11:34:55

Thanks @TrevorH.
So what can you suggest to me to do in this case related to customisation, just to put size=24g in fstab and do a remount or what?

...like this:

Code: Select all

/dev/mapper/rhel-dev_shm /dev/shm               ext4    defaults,size=24g        1 2

User avatar
TrevorH
Forum Moderator
Posts: 23484
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Wrong size for /dev/shm partition with df -h

Post by TrevorH » 2018/02/21 11:56:51

/dev/mapper/rhel-dev_shm /dev/shm ext4 defaults 1 2
This whole line looks wrong, it's not ext4, /dev/shm already has its own filesystem on it, tmpfs. It should look like this

tmpfs 16060 293 15767 2% /dev/shm
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel)

Your fstab line ought to look more like

tmpfs /dev/shm tmpfs defaults,size=24g 0 0
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

linuksash
Posts: 4
Joined: 2018/02/21 10:19:32

Re: Wrong size for /dev/shm partition with df -h

Post by linuksash » 2018/02/21 12:03:16

Yes I know, but that is what I get after CentOS 7 or RedHat 7 install. As I said - on install time, I defined /dev/shm as a separate partition (and that is exactly what RedHat recommend for server where will be Oracle).

Image

Image

stevemowbray
Posts: 388
Joined: 2012/06/26 14:20:47

Re: Wrong size for /dev/shm partition with df -h

Post by stevemowbray » 2018/02/21 12:57:48

Regardless of what the document says, as Trevor says /dev/shm should be tmpfs, not a disk partition.

User avatar
TrevorH
Forum Moderator
Posts: 23484
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Wrong size for /dev/shm partition with df -h

Post by TrevorH » 2018/02/21 16:07:45

You should raise a ticket on bugzilla.redhat.com and point out their documentation bug for that.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

linuksash
Posts: 4
Joined: 2018/02/21 10:19:32

Re: Wrong size for /dev/shm partition with df -h

Post by linuksash » 2018/02/21 18:22:59

Thanks to everyone.

Post Reply