ZFS Cant rm: No space left on device
If you completely fill up a zfs pool, it wont let you delete files on it. What you CAN do, is pick a scapegoat file to wipe out or remove a snapshot. Then you will be able to use the rm command. what I did:
# df -h Filesystem Size Used Avail Capacity Mounted on themirror 39G 39G 0B 100% /home/jacob/themirror# rm 3gfile rm: 3gfile: No space left on device# dd if=/dev/null of=3gfile 0+0 records in 0+0 records out 0 bytes transferred in 0.000046 secs (0 bytes/sec)# rm 3gfile
Thanks man your solution was really helpful for me!
I was suffering before I read it, by the way I just have one question, after have done the dd if=/dev/null of=”file” and deleted the file, is there any post activity?
Thanks a bunch!!!
Alex Mendez.
Great tip. Just saved my bacon after I accidentally copied 4GB of files instead of moving them…
Note to self, try not to have so much rubbish on your file server!
Thank you so much!
It’s very helpful solution.
Didn’t work.
dd also nags about “no space left on device”
I’m having the same problem. However, I can’t even mount the file system. Therefore I can’t use dd or rm , or indeed anything to clear any space. Unfortunately as well, I have no snapshots to delete. Any suggestions on how I would clear space in such a case?
Aslak,
What is the error you get when trying to mount the partition? How do you know that the filesystem is full if it isn’t mounted?
Can’t remember the error verbatim, “Can’t set mountpoint” or something along those veins.
ZFS list and ZPOOL list showed Avail as 0.
I got to my data by mirroring to a larger disk, then detaching the original.
However, if the original had been a stripe, there’d be no way to mirror it.
I suppose I could have added a new drive (or file or whatever) to the pool to make it larger, but then this would become a permanent fixture of the pool, since there’s no way to remove it again. One thing I didn’t try, was to attach a vdev as a log device. I’m guessing you can’t do anything with the filesystem without writing to the log, so if it’s full, you’re stuck. A separate log might fix that. And since a log device can be removed again, afaik, this could be a solution.