Tmpfs

De Linuxmemo.

(Différences entre les versions)
(Astuce)
 
(2 versions intermédiaires masquées)
Ligne 1 : Ligne 1 :
[[Catégorie:Script]]
[[Catégorie:Script]]
-
Créer un tmpfs, un repertoire en memoire ram
+
==tmpfs, un repertoire en memoire ram==
Ref: https://www.system-linux.eu/index.php?post/2009/09/10/cr%C3%A9er-un-tmpfs%2C-un-repertoire-dans-votre-ram
Ref: https://www.system-linux.eu/index.php?post/2009/09/10/cr%C3%A9er-un-tmpfs%2C-un-repertoire-dans-votre-ram
Ligne 10 : Ligne 10 :
  Ou dans /etc/fstab :
  Ou dans /etc/fstab :
  tmpfs /mnt/mytmpfs tmpfs defaults,size=5m 0 0
  tmpfs /mnt/mytmpfs tmpfs defaults,size=5m 0 0
 +
 +
==Astuce==
 +
mytmpfs () {
 +
    if (! $( mount| grep -q mytmpfs))
 +
        then
 +
        mount -t tmpfs -o size=5M tmpfs /mnt/mytmpfs
 +
    fi
 +
}
 +
mytmpfs

Version actuelle en date du 23 octobre 2018 à 13:51

[modifier] tmpfs, un repertoire en memoire ram

Ref: https://www.system-linux.eu/index.php?post/2009/09/10/cr%C3%A9er-un-tmpfs%2C-un-repertoire-dans-votre-ram

mkdir /mnt/mytmpfs
chmod 777 /mnt/mytmpfs
mount -t tmpfs -o size=5M tmpfs /mnt/mytmpfs

Ou dans /etc/fstab :
tmpfs /mnt/mytmpfs tmpfs defaults,size=5m 0 0

[modifier] Astuce

mytmpfs () {
    if (! $( mount| grep -q mytmpfs))
       then
       mount -t tmpfs -o size=5M tmpfs /mnt/mytmpfs
    fi
}
mytmpfs
Outils personnels