ZFS disc quota exceeded – workaround

Sometimes I hit a problem when I have downloaded a load of software images and I managed to totally fill my ZFS home directory. Unfortunately I don’t have root on this system so can’t extend my quota so I have to find a workaround.

If you completely fill your quota on zfs you cannot delete any files

Filesystem kbytes used avail capacity Mounted on
192.168.1.18:/export/edi-homes/kitty
209715213 209715213 0 100% /osc/home/kitty
kitty@eedi-sol-desktop2 # ls
kitty@eedi-sol-desktop2 # rm recreate_temp.sql
rm: recreate_temp.sql: override protection 555 (yes/no)? yes
rm: recreate_temp.sql not removed: Disc quota exceeded

One way to get some space back is to resize/truncate a file using dd. Locate a large file on your disk that you no longer need or can easily replace.

kitty@eedi-sol-desktop2 # ls *iso
OAKFactoryImage_2.6.0.0.0_130423.1.iso sol-11_1-text-sparc.iso

Use dd for 1 count to overwrite it with a small amount of data.

kitty@eedi-sol-desktop2 # dd if=/dev/random of=OAKFactoryImage_2.6.0.0.0_130423.1.iso count=1
1+0 records in
1+0 records out
kitty@eedi-sol-desktop2 # df -k .
Filesystem kbytes used avail capacity Mounted on
192.168.1.18:/export/edi-homes/kitty
209715200 208521578 1193622 100% /osc/home/kitty

Now you have some wiggle room to tidy up some more files, all without having to bother your grumpy sysadmin.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s