Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2012 12:17:43 +0100
From:      =?ISO-8859-1?Q?Attila_Bog=E1r?= <attila.bogar@linguamatics.com>
To:        Matthew Seaman <matthew@FreeBSD.org>
Cc:        freebsd-fs@FreeBSD.org
Subject:   Re: ZFS: .zfs/snapshot directory vanished
Message-ID:  <500E8457.8020805@linguamatics.com>
In-Reply-To: <500E2E0C.2040606@FreeBSD.org>
References:  <4FF6D7EE.3000806@linguamatics.com> <4FF6DB9A.7040905@FreeBSD.org> <500DCCD0.8020701@linguamatics.com> <500E2E0C.2040606@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

Thanks, cache ruled out. I'm trying to isolate the problem.

I set up a second box. I wiped 12 disks with dd, created a raidz2 pool, 
created the datasets and copied all data with rsync (not zfs send to 
avoid corruption in the zfs stream).

All went fine until I turned on I turned on the Amanda backup system.
Amanda backs up using creating a snapshot, gtaring the content and then 
destroying the snapshot.

This was issued:
# zfs allow -ldu amanda mount,snapshot,destroy tank/export

The default port from misc/amanda-server doesn't work bydefault with 
this feature:
define script-tool amzfs_snapshot {
    comment "backup of zfs snapshot"
    plugin  "amzfs-snapshot"
    execute-on pre-dle-amcheck, post-dle-amcheck, pre-dle-estimate, 
post-dle-estimate, pre-dle-backup, post-dle-backup
    execute-where client
}

Therefore, I wrote a patch (which I should send to the port maintainer) 
- it was working fine for a year on 8.2-RELEASE:

--- /usr/local/lib/perl5/site_perl/5.14.2/Amanda/Application/Zfs.pm.orig 
2012-07-05 11:15:22.000000000 +0100
+++ /usr/local/lib/perl5/site_perl/5.14.2/Amanda/Application/Zfs.pm 
2012-07-06 11:28:07.000000000 +0100
@@ -82,9 +82,9 @@
      waitpid $pid, 0;
      close $rdr;
      close $err;
+    chomp $zmountpoint;

-    if ($? == 0) {
-        chomp $zmountpoint;
+    if (($? == 0) && (substr($zmountpoint, 0, 1) ne '/')) {

          # zfs dataset supplied
          $self->{filesystem} = $device;
@@ -377,11 +377,14 @@
      my $snapshotname = "";

      if ($self->{action} eq 'check') {
-       $snapshotname = "amanda-" . 
Amanda::Util::sanitise_filename($self->{disk}) . "-check";
+       # $snapshotname = "amanda-" . 
Amanda::Util::sanitise_filename($self->{disk}) . "-check";
+       $snapshotname = "amanda-check";
      } elsif (!defined $level) {
-       $snapshotname = "amanda-" . 
Amanda::Util::sanitise_filename($self->{disk}) . "-current";
+       # $snapshotname = "amanda-" . 
Amanda::Util::sanitise_filename($self->{disk}) . "-current";
+       $snapshotname = "amanda-current";
      } else {
-       $snapshotname = "amanda-" . 
Amanda::Util::sanitise_filename($self->{disk}) . "-" . $level;
+       # $snapshotname = "amanda-" . 
Amanda::Util::sanitise_filename($self->{disk}) . "-" . $level;
+       $snapshotname = "amanda-" . $level;
      }

      return $snapshotname;

I kicked off the backup and the snapshots have gone. I also had a kernel 
panic that it couldn't unmount a snapshot.

This is the second box. I have the same problems with 9.1-PRERELEASE.

Any help would be greatly appreciated,

Thanks,
   Attila




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?500E8457.8020805>