[zfs-discuss] Entire content of zfs filesystem disappears after "zfs rename" -- my mistake?!

Darik Horn dajhorn at vanadac.com
Mon Apr 30 13:07:45 EDT 2012


On Mon, Apr 30, 2012 at 11:55, Sergio Ruocco <ruocco at disco.unimib.it> wrote:
>
> I tried clumsily to rename "z2pool/backup-storage" as "z2pool/backup-data",
> thus
>
> [sergio at monster 18:09 ~]$ sudo zfs rename z2pool/backup-storage
> z2pool/backup-data
> [sudo] password for sergio:
> umount: /z2pool/backup-storage: device is busy.
>        (In some cases useful info about processes that use
>         the device is found by lsof(8) or fuser(1))
> cannot unmount '/z2pool/backup-storage': umount failed
>
> [sergio at monster 18:09 ~]$ sudo zfs rename z2pool/backup-storage
> z2pool/backup-data
> filesystem '/z2pool/backup-data' cannot be mounted, unable to open the
> dataset
> cannot mount 'z2pool/backup-data': Invalid argument

This means that the dataset was renamed, but the mount points were
left dangling because they were in use.


> [sergio at monster 18:13 ~]$ sudo zfs rename /z2pool/backup-storage
> /z2pool/backup-data
> cannot open '/z2pool/backup-storage': invalid dataset name

The leading forward-slash character on the dataset name is a syntax error.


> [sergio at monster 18:13 /z2pool]$ ll backup-data/
> total 6
> drwxr-xr-x.  2 root   root    2 Apr 30 18:13 .
> drwx------. 10 sergio sergio 11 Apr 30 18:13 ..
>
>
> Before renaming this directory contained a file and a subdirectory, with
> 1.4TB of data!!
> ... I have a backup. .. but, where are now?
>
>        Sergio

If you run `zfs list -r z2pool/backup-data` then you get a sensible
"REFER" size.  (ie: The dataset is not empty.)

Reboot and the data should reappear at the desired mount point.

-- 
Darik Horn <dajhorn at vanadac.com>



More information about the zfs-discuss mailing list