Par défaut, 5% d’espace disque sont réservés pour l’utilisateur root lors du formatage d’une partition en ext3. Cet espace permet, d’une part, de minimiser la fragmentation des fichiers et d’autre part, de permettre aux processus tournant sous l’utilisateur root de continuer à fonctionner (ex : syslogd).

Il est possible de réduire cet espace grâce à la commande tune2fs.

Affichons tout d’abord l’espace libre disponible sur le fichier image Caprica.img de 5Go

<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bitch<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> -o loop Caprica.img <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bitch<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">df</span> -h <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span> Sys. de fich. Tail. Occ. Disp. <span style="color: #000000; font-weight: bold;">%</span>Occ. Monté sur <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>Caprica<span style="color: #000000; font-weight: bold;">/</span>Caprica.img <span style="color: #000000;">4</span>,9G 347M <span style="color: #000000;">4</span>,3G <span style="color: #000000;">8</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>mnt <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bitch<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>

Réduisons l’espace réservé à 1% du disque :

<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bitch<span style="color: #7a0874; font-weight: bold;">&#93;</span> tune2fs -m <span style="color: #000000;">1</span> Caprica.img tune2fs <span style="color: #000000;">1.40</span>-WIP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">14</span>-Nov<span style="color: #000000;">-2006</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Initialisation <span style="color: #c20cb9; font-weight: bold;">du</span> pourcentage de blocs réservés à <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">12800</span> blocs<span style="color: #7a0874; font-weight: bold;">&#41;</span>

Ré-affichons maintenant l’espace libre disponible sur le fichier image Caprica.img

<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bitch<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> -o loop Caprica.img <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>bitch<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">df</span> -h <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span> Sys. de fich. Tail. Occ. Disp. <span style="color: #000000; font-weight: bold;">%</span>Occ. Monté sur <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>Caprica<span style="color: #000000; font-weight: bold;">/</span>Caprica.img <span style="color: #000000;">4</span>,9G 347M <span style="color: #000000;">4</span>,5G <span style="color: #000000;">8</span><span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">/</span>mnt

Voila le volume disponible est passé de 4,3 Go à 4,5 Go. Je vous laisse imaginer sur des volumes plus important

Merci Sylvain de GNU Squad

© 2012 Karlesnine Suffusion theme by Sayontan Sinha