I'm using a Cloud server:
Architecture: x86_64
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
In the beginning, I only had one 40G disk, which mounted on /
, as my application and the
running docker image files very soon. There's not too much space left.
I added another 500G data disk: /dev/sdb
with primary partition
and
formatted it with: mkfs.ext4 /dev/sdb
, finally mounted it to /data
,Then I transfered over 20G files(include moved docker to /data/docker
by following link), I was expecting to get over 50% space to be released.
This is the df -m
now:
root@iot-message-2001:/# df -m
Filesystem 1M-blocks Used Available Use% Mounted on
udev 7961 0 7961 0% /dev
tmpfs 1601 2 1600 1% /run
/dev/sda1 40253 36235 2262 95% /
tmpfs 8005 1 8005 1% /dev/shm
tmpfs 5 0 5 0% /run/lock
tmpfs 8005 0 8005 0% /sys/fs/cgroup
/dev/sdb 502941 30092 447233 7% /data
overlay 502941 30092 447233 7% /data/docker/overlay2/24dc450509b6e137b48776f3afb1f9a3cc30c485254e2104cbf9bf2b175ac0fd/merged
overlay 502941 30092 447233 7% /data/docker/overlay2/8a366c978be56388958b12286cb0c38f4321834a963de95acdc8e852ff29fc7b/merged
shm 64 0 64 0% /data/docker/containers/ab84a181f9fbfddc9b1bb83f57431661a9cef548e1f31d86a8548e017a45d50f/mounts/shm
overlay 502941 30092 447233 7% /data/docker/overlay2/cb3fa68ae2b92d02ddaea1729a7821c9bc89531dc6f24da6b0c624f26f266b69/merged
shm 64 0 64 0% /data/docker/containers/4133a58d1b5d62188d8a3c3c67eebcc02c4463dabe05f065ea4497eb145f9da9/mounts/shm
tmpfs 1601 0 1601 0% /run/user/1001
It said the /
has still used 36G, and only have 2G space left, why the space didn't get released after over 20G files were moved from original /
to /data
?
I was trying to list all directory sizes under /
but exclude the path /data
to see what exactly used the space by du -hsc * --exclude=data | sort -hr
running from /
:
root@iot-message-2001:/# du -hsc * --exclude=data | sort -hr
du: cannot access 'proc/517481/task/517481/fd/4': No such file or directory
du: cannot access 'proc/517481/task/517481/fdinfo/4': No such file or directory
du: cannot access 'proc/517481/fd/3': No such file or directory
du: cannot access 'proc/517481/fdinfo/3': No such file or directory
du: cannot access 'proc/4137254/task/4137254/fd/492': No such file or directory
du: cannot access 'proc/4137254/task/4137470/fdinfo/507': No such file or directory
du: cannot access 'proc/4137254/task/4137481/fdinfo/519': No such file or directory
du: cannot access 'proc/4137254/task/4137511/fd/218': No such file or directory
12G total
6.1G var
3.3G usr
2.0G swap.img
205M root
202M boot
84M home
76M titan
5.7M etc
560K run
68K tmp
16K opt
16K lost+found
4.0K srv
4.0K mnt
4.0K media
4.0K cdrom
...
...
can see only 12G were used under /
, and it's suppose to have 28G space left on /
, but from my testing of by copying a big file(several G) to /
, the system still say space not enough on /
, and why is that?