ZFS - cannot remove No space left on device

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

nry

Active Member
Feb 22, 2013
312
61
28
Bit of misjudgement made in my process of moving to ZFS. My RAID6 array was smaller than my intended new ZFS pool and due to a difference in block sizes I ended up filling 100% of the space on my ZFS pool.

Code:
root@nas: df -h
z2-7200                17T   17T     0 100% /media/z2-7200
Oops! Bit of searching shows I'm not the first to make this mistake, and that you should be able to empty the contents of a file doing:

Code:
echo > /media/z2-7200/ISOs/Ubuntu.iso
bash: /media/z2-7200/ISOs/Ubuntu.iso: No space left on device
Also tried

Code:
dd if=/dev/null of=/media/z2-7200/ISOs/Ubuntu.iso
dd: /media/z2-7200/ISOs/Ubuntu.iso: No space left on device
Now this seems to have solved it for everyone else, what am I doing wrong?

Any suggestions on how this can be fixed? :)
 

nry

Active Member
Feb 22, 2013
312
61
28
Fixed it, had to run this command on about 30 odd files (all 200-500mb) before it actually cleared some space!
 

idownes

New Member
Dec 11, 2015
1
0
1
I've never had to use it but the solution I've read is to truncate a file to zero length, e.g.,
Code:
truncate -s 0 filename
 

gea

Well-Known Member
Dec 31, 2010
3,161
1,195
113
DE
My preferred solution is to add a small reservation to the pool itself. On problems, you can remove that.
With napp-it I add a default 10% reservation when you create a pool. This avoids also a massive performance degration
on a pool nearly full situation.
 
  • Like
Reactions: nry