I currently have a CentOS 7 that appears to have been incorrectly partitioned, such that I've run out of space in /root. In normal circumstances, I'd migrated the roles running on this box and fix it. I sadly can't do that at this moment in time.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 20G 16G 2.4G 87% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 16G 1.6G 15G 10% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/md3 1.8T 52G 1.7T 3% /home
tmpfs 3.2G 0 3.2G 0% /run/user/1001
tmpfs 3.2G 0 3.2G 0% /run/user/992
tmpfs 3.2G 0 3.2G 0% /run/user/1002
tmpfs 6.0G 24K 6.0G 1% /mnt/nginxramdisk
tmpfs 3.2G 0 3.2G 0% /run/user/995
Obviously, I need to fix /dev/root
.
Ideally, I'd take some space from /dev/md3
, however, I am not sure if I can.
Looking at fstab, they are physical and ext4, so doing things online may be difficult.
<file system> <mount point> <type> <options> <dump> <pass>
/dev/md2 / ext4 errors=remount-ro 0 1
/dev/md3 /home ext4 defaults 1 2
/dev/sda4 swap swap defaults 0 0
/dev/sdb4 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts defaults 0 0
Any ideas on how I can increase the size of /root
?
Is it feasible for me to unmout /home
and resize it with resize2fs
to shrink it, then try to grow /root
having brought it back online, and shrunk it?
As requested,
du -sh /*
233M /app
0 /bin
132M /boot
0 /dev
318M /etc
49G /home
0 /lib
0 /lib64
16K /lost+found
4.0K /media
8.0K /mnt
2.2G /opt
du: cannot access ‘/proc/2212/task/2212/fd/4’: No such file or directory
du: cannot access ‘/proc/2212/task/2212/fdinfo/4’: No such file or directory
du: cannot access ‘/proc/2212/fd/4’: No such file or directory
du: cannot access ‘/proc/2212/fdinfo/4’: No such file or directory
0 /proc
273M /root
1.6G /run
0 /sbin
4.0K /srv
0 /sys
1.1M /tmp
4.1G /usr
7.2G /var
0 Answers