如果 /dev/md1 已满该怎么办?

如果 /dev/md1 已满该怎么办?

我有一台专用服务器,运行 Ubuntu Server 14.04 LTS。

我的磁盘空间有问题:

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
  • 我该怎么做才能释放空间和/或添加空间,/dev/md1或者这是正常的吗?

  • 我已经安装了apache2mysql(我更改了buffer_size,添加了大小以/tmp方便查询)memcached,,pagespee

  • 我添加了一个 20GB 的交换文件:

    Filename                                Type            Size    Used    Priority
    /dev/sda2                               partition       2097148  0       -1
    /dev/sdb2                               partition       2097148  0       -2
    /home/archivo-swap                      file            20971516 0       -3
    
  • my.conf因为我更改了我的 mysql,所以我放了swap 的使用有问题吗innodb_buffer_pool_size = 8G

输出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

命令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

有关 /root 命令du -h --max-depth=1 路径“/root”的信息

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

./.forever我可以用“./.npm”做什么?

答案1

我在“的帮助下找到了解决方案”钢铁司机

问题:我的问题是我forever start myscript.js以 root 用户身份运行,forever将所有日志保存在运行脚本的用户文件夹中,这就是为什么我没有空间/dev/md1

解决方案:将所有文件移动/root/.forever到我的新用户中,/home/user/.foreverforever start myscript.js以我的新用户身份运行。

我有更多的空间/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

文件夹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

2017年8月29日更新:

  • 检查旧内核,删除它们以获取空间...
  • 检查日志文件来查看或清除它们。

相关内容