GNU/Linux >> Linux Esercitazione >  >> Linux

Come creare un filesystem tmpfs in CentOS/RHEL

tmpfs non è realmente usato come filesystem, ma sfrutta semplicemente l'astrazione del filesystem. Le applicazioni possono eseguire I/O su un tmpfs. Le funzioni di tmpfs risiedono esclusivamente in memoria.

Creazione di un filesystem speciale tmpfs

1. Monta una nuova istanza di tmpfs:

# mkdir /mnt/tmpfs
# mount -t tmpfs none /mnt/tmpfs

Nota :controlla quanto spazio è stato assegnato al filesystem e quanto sta utilizzando.

# df -h /mnt/tmpfs
Filesystem Size Used Avail Use% Mounted on
none         915M 0    915M 0%    /mnt/tmpfs

2. Quando il filesystem non è più necessario, smonta il filesystem

# umount /mnt/tmpfs

Conclusione

Praticamente, le moderne distribuzioni Linux montano un'istanza di tmpfs in /dev/shm .

# df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 915M 0 915M 0% /dev/shm

Per verificare quali istanze di tmpfs stanno utilizzando il sistema per impostazione predefinita:

# df -h | grep tmpfs
devtmpfs 901M 0 901M 0% /dev
tmpfs 915M 0 915M 0% /dev/shm
tmpfs 915M 9.6M 906M 2% /run
tmpfs 915M 0 915M 0% /sys/fs/cgroup
tmpfs 183M 28K 183M 1% /run/user/42
tmpfs 183M 3.5M 180M 2% /run/user/1000
tmpfs 183M 4.0K 183M 1% /run/user/0


Linux
  1. CentOS / RHEL:come modificare l'UUID del filesystem

  2. Come creare una nuova partizione /boot in CentOS/RHEL

  3. Come modificare le etichette del filesystem in CentOS/RHEL

  4. Come creare un bridge di rete in CentOS/RHEL

  5. CentOS / RHEL:come trovare l'UUID di un dispositivo o filesystem

Come utilizzare tmpfs su RHEL/CentOS 7

Come creare un utente Sudo in RHEL, CentOS, Rocky e AlmaLinux

Come configurare SSH su CentOS e RHEL

Come installare Dgraph su CentOS 8

CentOS / RHEL 6:come disabilitare IPv6

CentOS / RHEL:come creare una nuova partizione di swap basata su LVM