I'm trying to extend the tmfs file system size from 1.1 GB to 2GB.
Tried the following commands-
[root@~]# df -h /dev/shm/
Filesystem Size Used Avail Use% Mounted on
tmpfs 1.1G 732K 1.1G 1% /dev/shm
Edited the fstab
/etc/fstab
tmpfs /dev/shm tmpfs size=2.0G 0 0
tried to remount the file system using mount command
Got an error saying :-
mount : /dev/shm not mounted or bad option try using
dmesg | tail
Tried the following command
root @ dmesg | tail :-
SELinux: initilized (dev tmpfs, type tmpfs), use transition SIDs
tmpfs: BAD value '2.0G' for mount option 'size'
What might be a good value for the mount option size?
Best Answer
If your example fstab entry is accurate, you have specified a valid size as
2g
. But thedmesg
output shows2.0G
. I don't know what's up with that. Did you make a mistake? There are lots of other ways to specify the size. Try specifying it in bytes, since it's the default. That would be2147483648
or so I believe.mount
man page:And just to make sure, you have enough memory right? Just in case the error is incorrect... the default is to use 50% of your memory as a maximum.
EDIT:
I noticed you edited your question and changed the fstab line from
2g
to2.0G
. Was that the problem? You haven't reported back. Did trying2g
or bytes work?