расширить файловую систему tmpfs

Я пытаюсь увеличить размер файловой системы tmfs с 1,1 ГБ до 2 ГБ.

Пробовал следующие команды-

[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'

Какое может быть хорошее значение для размера параметра монтирования?

0
задан 23 September 2016 в 04:03
2 ответа

Если запись в вашем примере fstab точная, то вы указали действительный размер как 2g. Но на выходе dmesg видно 2.0G. Я не знаю, что с этим. Вы ошиблись? Есть много других способов указать размер. Попробуйте указать его в байтах, так как он по умолчанию. Это будет 2147483648 или около того.

mount man page:

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% вашей памяти как максимум.

EDIT:

Я заметил, что вы отредактировали вопрос и поменяли строку fstab с 2g на 2.0G. В этом была проблема? Вы не отчитались. Пытались ли работать 2g или байты?

.
1
ответ дан 4 December 2019 в 16:29

Из man-страницы для монтирования (много прокручивается вниз):

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
0
ответ дан 4 December 2019 в 16:29

Теги

Похожие вопросы