Summary:
- Had a directory at
~/src/databasecontaining~250 GBof files. - Executed
mv ~/src/database ~/ - Instead of expected result (
databasenow at~/), I ended up with adatabasedirectory in both the source and destination, but with only a small fraction of the original files (i.e. the database was apparently corrupted/lost duringmvsomehow).
The lost files are not an issue---I have multiple backups. The issue is that even after doing rm -rf ~/database; rm -rf ~/src/database my harddrive is now short ~500 GB (coincidentally, the size of 2 copies of the database).
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/nvme1n1p2 1.9T 1.1T 701G 61% /
However, a complete breakdown of the drive in baobab shows that I'm only using ~600 GB with all files accounted for on the root volume. This is consistent with what I knew beforehand and also the failed mv operation. The math is roughly correct: 1.1 TB - 500 GB = 600 GB, which is exactly what baobab says I'm using.
In the past I have had similar issues, and the solution was to remove the parent directory, which somehow reclaimed the space. That isn't working here.
- I already tried removing the parent of the source, didn't work.
- Parent of the destination is my home dir, so not easy to
rmthat.
Question:
How can I reclaim this space? Is there a way to force the OS to reclaim stranded nodes from the disk?
$ findmnt -T ~/src
TARGET SOURCE FSTYPE OPTIONS
/ /dev/nvme1n1p2 ext4 rw,relatime,discard
$ findmnt -T ~/
TARGET SOURCE FSTYPE OPTIONS
/ /dev/nvme1n1p2 ext4 rw,relatime,discard