O que fazer se / dev / md1 estiver cheio?

0

Eu tenho um servidor dedicado, executando o Ubuntu Server 14.04 LTS.

Eu tenho um problema com espaço no disco:

df -h
Filesystem             Size  Used Avail Use% Mounted on
udev                   7.8G  8.0K  7.8G   1% /dev
tmpfs                  1.6G  568K  1.6G   1% /run
/dev/md1               4.0G  4.0G     0 100% /
none                   4.0K     0  4.0K   0% /sys/fs/cgroup
none                   5.0M     0  5.0M   0% /run/lock
none                   7.8G     0  7.8G   0% /run/shm
none                   100M     0  100M   0% /run/user
/dev/mapper/vg00-usr   104G  1.8G   98G   2% /usr
overflow               500M     0  500M   0% /tmp
/dev/mapper/vg00-var   709G  125G  556G  19% /var
/dev/mapper/vg00-home   69G   24G   43G  36% /home
  • O que posso fazer por espaço livre e / ou adicionar espaço em /dev/md1 ou é normal?

  • Instalei apache2 , mysql (altero buffer_size , adiciono tamanho a /tmp para consultas), memcached , pagespee .

  • Eu adicionei um arquivo de swap de 20 GB:

    Filename                                Type            Size    Used    Priority
    /dev/sda2                               partition       2097148  0       -1
    /dev/sdb2                               partition       2097148  0       -2
    /home/archivo-swap                      file            20971516 0       -3
    
  • Pode haver um problema com o uso do swap, porque eu mudo o meu my.conf do mysql, eu coloco innodb_buffer_pool_size = 8G ?

Ouput de fdisk -l

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x4d10fd7b

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     8390655     4194304   fd  Linux raid autodetect
/dev/sdb2         8390656    12584959     2097152   82  Linux swap / Solaris
/dev/sdb3        12584960  1953525167   970470104   fd  Linux raid autodetect

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0b43aed6

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     8390655     4194304   fd  Linux raid autodetect
/dev/sda2         8390656    12584959     2097152   82  Linux swap / Solaris
/dev/sda3        12584960  1953525167   970470104   fd  Linux raid autodetect

Disk /dev/md1: 4294 MB, 4294901760 bytes
2 heads, 4 sectors/track, 1048560 cylinders, total 8388480 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md3: 993.8 GB, 993761296384 bytes
2 heads, 4 sectors/track, 242617504 cylinders, total 1940940032 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md3 doesn't contain a valid partition table

Disk /dev/mapper/vg00-usr: 112.7 GB, 112742891520 bytes
255 heads, 63 sectors/track, 13706 cylinders, total 220200960 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg00-usr doesn't contain a valid partition table

Disk /dev/mapper/vg00-var: 773.1 GB, 773094113280 bytes
255 heads, 63 sectors/track, 93990 cylinders, total 1509949440 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg00-var doesn't contain a valid partition table

Disk /dev/mapper/vg00-home: 75.2 GB, 75161927680 bytes
255 heads, 63 sectors/track, 9137 cylinders, total 146800640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg00-home doesn't contain a valid partition table

Comando sudo du -hsx /*

sudo du -hsx /*
9.8M    /bin
141M    /boot
8.0K    /dev
7.7M    /etc
24G     /home
0       /initrd.img
0       /initrd.img.old
939M    /lib
4.0K    /lib64
48K     /lost+found
8.0K    /media
4.0K    /mnt
14M     /node_modules
4.0K    /opt
du: cannot access '/proc/28275/task/28275/fd/4': No such file or directory
du: cannot access '/proc/28275/task/28275/fdinfo/4': No such file or directory
du: cannot access '/proc/28275/fd/4': No such file or directory
du: cannot access '/proc/28275/fdinfo/4': No such file or directory
0       /proc
2.9G    /root
564K    /run
11M     /sbin
4.0K    /srv
0       /sys
0       /tmp
1.7G    /usr
125G    /var
0       /vmlinuz
0       /vmlinuz.old

Informações sobre / root comando du -h --max-depth=1 caminho ´ / root´

4.0K    ./tmp
12K     ./.config
8.0K    ./.ssh
16K     ./.aptitude
2.8G    ./.forever
4.0K    ./.cache
31M     ./.npm
2.9G    .

O que posso fazer com ./.forever e ´ ./. npm´?

    
por DarckBlezzer 11.07.2016 / 19:33

1 resposta

2

Encontrei uma solução com a ajuda de " steeldriver "

Problema : Meu problema é que eu corro forever start myscript.js com usuário root, forever salva todos os logs na pasta do usuário que executa o script, por isso não tenho espaço em /dev/md1

Solução : mova todos os arquivos que estavam em /root/.forever para meu novo usuário, /home/user/.forever e execute forever start myscript.js com meu novo usuário.

Eu tenho mais espaço em /dev/md1

df -h
Filesystem             Size  Used Avail Use% Mounted on
udev                   7.8G  8.0K  7.8G   1% /dev
tmpfs                  1.6G  560K  1.6G   1% /run
/dev/md1               4.0G  1.2G  2.8G  30% /
none                   4.0K     0  4.0K   0% /sys/fs/cgroup
none                   5.0M     0  5.0M   0% /run/lock
none                   7.8G     0  7.8G   0% /run/shm
none                   100M     0  100M   0% /run/user
/dev/mapper/vg00-usr   104G  1.8G   98G   2% /usr
overflow               500M     0  500M   0% /tmp
/dev/mapper/vg00-var   709G  125G  556G  19% /var
/dev/mapper/vg00-home   69G   27G   40G  41% /home

Pasta de root

ls -ahl
total 104K
drwx------   8 root root 4.0K Jul 12 01:23 .
drwxr-xr-x  23 root root 4.0K Jul  9 00:57 ..
-rw-r--r--   1 root root    0 Jul 12 00:33 all
drwx------   2 root root 4.0K Jun 27 13:02 .aptitude
-rw-------   1 root root  39K Jul 12 01:25 .bash_history
-rw-r--r--   1 root root 3.1K Feb 20  2014 .bashrc
drwx------   2 root root 4.0K Mar  4  2014 .cache
drwx------   3 root root 4.0K Jun 30 02:49 .config
-rw-r--r--   1 root root   29 Jun 27 13:07 created
-rw-r--r--   1 root root    0 Jul 11 21:16 findjs
-rw-------   1 root root   35 Apr 22  2015 .lesshst
-rw-------   1 root root 3.9K Jul  8 23:39 .mysql_history
-rw-------   1 root root  570 Jul 12 01:23 .nano_history
drwxr-xr-x 164 root root  12K Jul  1 21:26 .npm
-rw-r--r--   1 root root  140 Feb 20  2014 .profile
drwx------   2 root root 4.0K Jun 30 04:39 .ssh
drwxr-xr-x   2 root root 4.0K Jul  1 21:26 tmp

atualização 29/08/2017:

  • verifique o kernel antigo, remova-o para obter espaço ...
  • verifique o arquivo de registros para ver ou limpá-los.
por DarckBlezzer 11.07.2016 / 21:34