Score:1

root space still low after I mounted a 500G disk to /data and moved files in

ke flag

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?

guiverc avatar
cn flag
I'll suggest applying security fixes & upgrades asap, as your indicated details show you've not applied any since before August-2022. (Refer https://fridge.ubuntu.com/2022/09/01/ubuntu-20-04-5-lts-released/ which shows the ISO release date, but installed systems upgraded weeks before that date)
oldfred avatar
cn flag
Did you empty trash? And do you have partitions on sdb or did you just format it? Better to have partitions and use gpt partitioning. https://wiki.archlinux.org/title/Partitioning#Choosing_between_GPT_and_MBR
Shawn avatar
ke flag
@oldfred updated to include the `partition` anf `format` details.
muru avatar
us flag
If you moved or deleted files that are still in use by some process, that space isn't freed up until the process lets go or is killed. You can run `sudo lsof | grep deleted` to see if you have such files and how much space they take.
oldfred avatar
cn flag
While not related to space issue, you show sdb not sdb1 as /data?
Score:0
ke flag

after reboot the system, the space came back.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.