我试图将tmfs文件系统的大小从1.1 GB扩展到2GB。
试了下面的命令 –
[root@~]# df -h /dev/shm/ Filesystem Size Used Avail Use% Mounted on tmpfs 1.1G 732K 1.1G 1% /dev/shm
编辑fstab
/ etc / fstab文件
tmpfs /dev/shm tmpfs size=2.0G 0 0
试图用mount命令重新挂载文件系统
有一个错误说:
mount : /dev/shm not mounted or bad option try using dmesg | tail
试了下面的命令
root @ dmesg | tail :- SELinux: initilized (dev tmpfs, type tmpfs), use transition SIDs tmpfs: BAD value '2.0G' for mount option 'size'
什么可能是一个很好的价值安装选项的大小?
如果你的示例fstab条目是准确的,你已经指定一个有效的大小为2g 。 但是dmesg输出显示2.0G 。 我不知道这是怎么回事 你犯了错误吗? 还有很多其他的方法来指定大小。 请尝试以字节为单位指定它,因为这是默认值。 那2147483648是2147483648左右,我相信。
mount手册页:
Mount options for tmpfs size=nbytes Override default maximum size of the filesystem. The size is given in bytes, and rounded up to entire pages. The default is half of the memory. The size parameter also accepts a suffix % to limit this tmpfs instance to that percentage of your physical RAM: the default, when neither size nor nr_blocks is specified, is size=50% nr_blocks= The same as size, but in blocks of PAGE_CACHE_SIZE nr_inodes= The maximum number of inodes for this instance. The default is half of the number of your physical RAM pages, or (on a machine with highmem) the number of lowmem RAM pages, whichever is the lower. The tmpfs mount options for sizing (size, nr_blocks, and nr_inodes) accept a suffix k, m or g for Ki, Mi, Gi (binary kilo (kibi), binary mega (mebi) and binary giga (gibi)) and can be changed on remount.
只是为了确定,你有足够的记忆权利? 以防万一这个错误是不正确的…默认情况是使用50%的内存作为最大值。
编辑:
我发现你编辑你的问题,并将fgab行从2g更改为2.0G 。 是这个问题吗? 你还没有回报。 尝试2g或字节的工作?
从mount的手册页(向下滚动):
Mount options for tmpfs size=nbytes Override default maximum size of the filesystem. The size is given in bytes, and rounded up to entire pages. The default is half of the memory. The size parameter also accepts a suffix % to limit this tmpfs instance to that percentage of your physical RAM: the default, when neither size nor nr_blocks is specified, is size=50% nr_blocks= The same as size, but in blocks of PAGE_CACHE_SIZE