ZFS vs. df -h completely different size of filesystem [solved]

Miroslav Lachman 000.fbsd at quip.cz
Sun Oct 11 16:43:50 UTC 2009


Solved after few hours of sleep - main problem was ... me. (working for 
more than 18 hours is not a good idea)

Miroslav Lachman wrote:

[...]

> The strange thing is this:
> 
> root at cage ~/# df -h /vol0/jail/kurt2
> Filesystem              Size    Used   Avail Capacity  Mounted on
> tank/vol0/jail/kurt2     24G     19G    4.9G    80%    /vol0/jail/kurt2
> 
> 
> root at cage ~/# zfs list | grep tank/vol0/jail/kurt2
> tank/vol0/jail/kurt2                             355G  4.89G  19.2G 
> /vol0/jail/kurt2
> tank/vol0/jail/kurt2 at manual-2009-08-18_11-04    7.29G      -   299G  -
> tank/vol0/jail/kurt2 at manual-2009-09-04_10-24    2.24G      -   308G  -
> tank/vol0/jail/kurt2 at manual-2009-09-28_11-41    21.4G      -   317G  -
> 
> 
> root at cage ~/# zfs get -r quota tank/vol0/jail/kurt2
> NAME                     PROPERTY  VALUE    SOURCE
> tank/vol0/jail/kurt2     quota     360G     local

Directory on source server was moved and rsync started from cron 
accidentaly deleted all data.
But space remains occupied by data of snapshots! Thats why df showed 
just 24G size and not 360G. Df knows nothing about snapshots.

The fix was relatively easy.
1] make a backup of a new files (logs, configs, etc.)
2] destroy clone: zfs destroy tank/vol0/jail/kurt2_clone
3] rollback last snapshot
zfs rollback -f tank/vol0/jail/kurt2 at manual-2009-09-28_11-41
4] restore backup from step 1)
5] fix rsync settings
6] run rsync as usual ;)

Miroslav Lachman


More information about the freebsd-fs mailing list