4520 shaares
2 résultats
taggé
RAM
Ci-dessous se trouve mon /etc/fstab
$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdc1 during installation
UUID=0b59763b-4454-4705-aa57-761039f56cb0 / ext4 errors=remount-ro,discard,noatime,nodiratime 0 1
## Fichier tmp dans la RAM
tmpfs /tmp tmpfs defaults,noatime,nodiratime,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,noatime,nodiratime,mode=1777 0 0
## Pour les logs
tmpfs /var/log tmpfs defaults,noatime,nodiratime,mode=0755 0 0
Edit : j'ai ajouté le exit 1
qui manquait et simplifier le check, merci Animal.
Le petit script qui va bien à mettre dans votre PATH.
#!/usr/bin/env bash
## USAGE EXAMPLE : create_disk 1000 "/path/to/an/empty/folder"
## Ceci va créer un disk virtuel de 1000 Mo accessible depuis le répertoire "/path/to/an/empty/folder"
## Ne me remerciez pas
display_command_usage() {
echo "Command usage : 'create_in_memory_disk <SIZE> <PATH>'"
echo " - SIZE : The size (in Mo) of the disk to create in memory"
echo " - PATH : The folder where to create the virtual disk"
exit 1
}
if [ "$1" == "" ] || [ "$2" == "" ]; then
display_command_usage
fi
memSize="$1"
diskPath="$2"
sudo mount -t tmpfs -o size=${memSize}m tmpfs $diskPath