Hi!

I am new to zfs / opensolaris but getting the hang of it. :)

In my setup i have a large zpool called 'backup' which has zfs'es for
servers that i backup with rsync. I export those zfs'es via NFS to the
remote servers so i have easy access to the most recent backup and the
snapshots which i make just before starting the rsync.

Recently i switched on 'snapdir=visible' on one of the zfs volumes to
easily expose the available snapshots and then i noticed rsync -removes-
snapshots even though i am not able to do so myself, even as root, with
plain /bin/rm.

Example:

| r...@host:~# zfs snapshot backup/remoteh...@2009-10-16
| r...@host:~# ls /backup/remotehost/.zfs/snapshot/
| 2009-10-16
|
| r...@host:~# /usr/bin/rsync --archive --delete u...@remotehost:/ 
/backup/remotehost
|
| [ .. lots of read-only file system errors skipped .. ]
|
| rsync: delete_file: unlink(.zfs/snapshot/2009-10-16/.history) failed: 
Read-only file system (30)
| cannot delete non-empty directory: .zfs/snapshot/2009-10-16
| deleting .zfs/snapshot/2009-10-16/
| cannot delete non-empty directory: .zfs/snapshot
| rsync: delete_file: rmdir(.zfs/snapshot) failed: Operation not applicable (89)
| rsync: delete_file: rmdir(.zfs/shares) failed: Operation not applicable (89)
| cannot delete non-empty directory: .zfs
|
| r...@host:~# ls -la /backup/remotehost/.zfs/snapshot/
| total 0
| dr-xr-xr-x 2 root root 2 2009-10-05 09:32 .
| dr-xr-xr-x 4 root root 4 2009-10-05 09:32 ..
|
| r...@host:~# zfs snapshot backup/remoteh...@2009-10-16
| r...@host:~# ls /backup/remotehost/.zfs/snapshot/
| 2009-10-16

What's the deal here. :)

I was under the impression that rsync uses unlink() like 'rm' does?
How come rsync -can- remove the snapshot directory when exposed with
'snapdir=visible' and i can't do it with /bin/rm?

Anyone else seeing this?

| r...@host:~# rsync --version
| rsync  version 3.0.6  protocol version 30
| Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
| Web site: http://rsync.samba.org/
| Capabilities:
|     64-bit files, 64-bit inums, 32-bit timestamps, 64-bit long ints,
|     socketpairs, hardlinks, symlinks, no IPv6, batchfiles, inplace,
|     append, ACLs, no xattrs, iconv, no symtimes
| 
| r...@host:~# uname -a
| SunOS host 5.11 snv_111b i86pc i386 i86pc Solaris

With regards,
-Sander.
-- 
| Daylight savings time - why are they saving it and where do they keep it?
| 4096R/6D40 - 1A20 B9AA 87D4 84C7  FBD6 F3A9 9442 20CC 6CD2
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to