Catnoo
Notes de paramétrage de postes de travail, et autres vicissitudes ...

Accueil > Matériel divers > Raspberry PI > raspberry - gestion du fichier de swap

raspberry - gestion du fichier de swap

mardi 2 mai 2017, par Lucien-Henry

Problème

root@admsys00:/var# ll
total 102448
drwxrwsr-x  2 root staff      4096 janv.  7  2015 local
drwxr-xr-x  2 root root       4096 sept. 23  2016 opt
lrwxrwxrwx  1 root root          4 sept. 23  2016 run -> /run
lrwxrwxrwx  1 root root          9 sept. 23  2016 lock -> /run/lock
drwxr-xr-x  5 root root       4096 nov.  20 19:09 spool
-rw-r--r--  1 root root       6148 mars   3 12:30 .DS_Store
drwxr-xr-x 23 root root       4096 mars   4 17:07 ..
drwxr-xr-x  3 root root       4096 mars   4 18:20 www
drwxr-xr-x 13 root root       4096 mars   4 18:22 cache
drwxr-xr-x 48 root root       4096 mars   4 18:22 lib
drwxrwxrwt  2 root root         40 mai    2 02:17 mail
drwxrwxrwt  3 root root         60 mai    2 02:18 tmp
drwxr-xr-x  2 root root       4096 mai    2 06:25 backups
drwxr-xr-x  8 root root       4096 mai    2 06:25 log
drwxr-xr-x 12 root root       4096 mai    2 09:27 .
-rw-------  1 root root  104857600 mai    2 09:27 swap
<code>root@admsys00:/var# du -h ./swap
100M    ../swap<code>

Le swap n'est quasiment pas employé, et s'avère donc inutile :
<code>top - 09:33:41 up  4:49,  3 users,  load average: 0,07, 0,04, 0,00
Tasks: 121 total,   1 running, 120 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0,9 us,  0,4 sy,  0,0 ni, 98,6 id,  0,1 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem:    445088 total,   417400 used,    27688 free,    31764 buffers
KiB Swap:        0 total,        0 used,        0 free.   287100 cached Mem

Le fichier de swap fait 100 Mo ... ce n’est pas si énorme, mais il est plus intéressant d’éviter des écritures inutiles sur la carte SDHC servant de mémoire de masse au Raspberry.

Solution

Arrêt / Relance du service de swap :

c/init.d/dphys-swapfile stop
/etc/init.d/dphys-swapfile start

Plus sauvage, une suppression définitive du swap :

sudo update-rc.d dphys-swapfile remove
sudo rm /var/swap

Liens divers

/var/swap file abnormally large

Voir en ligne : /var/swap file abnormally large

SPIP | | Plan du site | Suivre la vie du site RSS 2.0
Habillage visuel © digitalnature sous Licence GPL