After deleting files on a veracrypt-encrypted drive with no disk space left, no disk space is freed up.
I'm trying to sync a hard drive to another one as described here.
That target drive is full and I can't free disk space on it. I tried removing files in all sorts of ways such as running rm /.../file and it's not just the Dolphin file explorer that shows no disk space is free but also for example df -h which shows 0 in the column Avail and 100% in Use%.
How to actually delete the files and free up the disk space or make it show the actually available disk space if it's just displaying that wrong? I'm using Debian with KDE.
Details on how the problem occurred and more things I tried:
The problem was that it finished with errors because it reached "No space left on device" (which shouldn't have occurred either) and Grsync does not backup root-owned files.
I then ran the rsync command of Grsync in the console as also described above. The command is sudo rsync -r -t -p -o -g --delete -l -s /media/veracrypt1 /media/veracrypt2
It had many "skipping non-regular file" errors but that is a separate problem (it should backup 100.0%) and eventually also got a No space left on device error despite that there are many GBs of disk space free on disk1. sudo lsof | grep {diskname} shows disk2 is not used by anything. Of course there is no running rsync process. I rebooted and dismounted and remounted the drive in the meantime several times.
The problem I have that when I delete something on disk2 to free disk space to allow for another sync, it doesn't show that more disk space is available in the Dolphin file browser or when entering lsblk -f or df (the latter still shows 0 in the column Available).
I tried deleting it by right clicking the file in Dolphin and choosing delete. I also tried "Move to Trash" but there is only the backed up Trash folder (I can't exclude it with Grsync) but no Trash folder at the root directory of the drive.
A similar problem occurred on my /home/ partition (different drive) but it was solved after a reboot. The problem described here did not go away after a reboot, dismounting and remounting the drive, and after upgrading to Debian12.
When deleting things, the free space is still/immediately 0 bytes, nevertheless I checked for a large quickly growing file with gdmap but couldn't find anything. After the upgrade it seems like sudo lsof | grep "/media/" (no output even if I have some file open) doesn't show if files on the disk are opened anymore but no file on it should be open.
I already tried things from this question. For example IUse% shows the percentage is quite low. sudo dumpe2fs /media/veracrypt2/ | grep -i reserved just says dumpe2fs: Is a directory while trying to open /media/veracrypt2/ and sudo lsof +L1 | grep media shows no output and neither does sudo lsof | grep deleted | grep media. Nothing should write to or read from that drive.
Unnecessary details to skip:
I thought logging out and back in to restart the session would solve this but it didn't and it still shows 0 bytes of disk space free. rm filename does not free up disk space either. As requested the output of lsof | grep deleted is below; many of those messages showed many times and I left out some columns and replaced Ids:
pulseaudi ... /memfd:pulseaudio (deleted)
ksmserver ... /home/username/.cache/ksycoca5_{lang}_{id} (deleted)
plasmashe ... /home/username/.cache/ksycoca5_{lang}_{id} (deleted)
plasmashe ... /home/username/.cache/appstream/appcache-{id}.mdb (deleted)
vorta ... /usr/share/mime/mime.cache (deleted)
{texteditor} ... /home/username/.cache/ksycoca5_{lang}_{id} (deleted)
konsole ... /home/username/.cache/konsole/#{number} (deleted)
after restarting the session there is an additional .lock file open by a printer program, the two pulseaudi, and the konsole ones but nothing else. I still can't free up disk space if lsblk -f and Dolphin display the correct available space.
I tried lsof +L1 another time and it doesn't show more disk space even when this is all it shows (with one open konsole):
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
konsole 549098 username 20u REG 254,2 0 0 8257752 /home/username/.cache/konsole/#8257752 (deleted)
konsole 549098 username 21u REG 254,2 0 0 8257764 /home/username/.cache/konsole/#8257764 (deleted)
konsole 549098 username 22u REG 254,2 0 0 8259787 /home/username/.cache/konsole/#8259787 (deleted)
konsole 549098 username 23u REG 0,1 3677184 0 2372415 /memfd:wayland-cursor (deleted)
veracrypt 2340184 username 9u REG 0,1 3677184 0 69165 /memfd:wayland-cursor (deleted)
xdg-deskt 2340702 username 8u REG 0,1 3677184 0 69892 /memfd:wayland-cursor (deleted)
I also tried sudo lsof | grep deleted | grep mountname and it does not give any output. mountname is part of the dir since I mounted it there (sudo lsof | grep mountname1 works for files open that are on the other drive and even sudo lsof | grep mountname does not show anything).
This could be a veracrypt bug, issue is here.
rsyncthe data (disk2) or the name of an actual disk?rm filenameto delete the file?lsofshows files (file descriptors to be more correct) and sockets, not partitions.lsof | grep deletedto the question.