2015-08-28 29 views
10
  1. erstellt Snapshot
  2. riesige Datei gelöscht
  3. Delta noch 0 (Snapshot nicht mehr Raum verwendet wird) in zfs Liste in den letzten drei Schnappschüsse

sollte das Delta oder belegter Speicherplatz nicht die Größe der gelöschte Datei. Ich weiß, zfs COW ist, aber ich bin verwirrt, warum ich nicht Rollback kann das Verzeichnis/usr/home/xxxx KindWie verwenden zfs-Snapshots Platz in der Praxis?

# ls /home/xxxxx/testing12345.txt 
/home/xxxxx/testing12345.txt 
# ls -alh /home/xxxxx/testing12345.txt                                 
-rw-r--r-- 1 root xxxxx 254M Aug 28 00:06 /home/xxxxx/testing12345.txt 
# zfs list -rt snapshot tank1/usr/home/xxxxx 
NAME          USED AVAIL REFER MOUNTPOINT 
tank1/usr/home/[email protected] 291M  - 804M - 
tank1/usr/home/[email protected]     71K  - 1.39G - 
tank1/usr/home/[email protected]      0  - 1.39G - 
tank1/usr/home/[email protected]     0  - 1.39G - 
tank1/usr/home/[email protected]    1K  - 1.39G - 
tank1/usr/home/[email protected]     0  - 1.39G - 
tank1/usr/home/[email protected]    0  - 1.39G - 
tank1/usr/home/[email protected]    0  - 1.39G - 
# 
# 
# 
# 
# zfs snapshot -r [email protected]                                   
# zfs list -rt snapshot tank1/usr/home/xxxxx                               
NAME          USED AVAIL REFER MOUNTPOINT 
tank1/usr/home/[email protected] 291M  - 804M - 
tank1/usr/home/[email protected]     71K  - 1.39G - 
tank1/usr/home/[email protected]      0  - 1.39G - 
tank1/usr/home/[email protected]     0  - 1.39G - 
tank1/usr/home/[email protected]    1K  - 1.39G - 
tank1/usr/home/[email protected]     0  - 1.39G - 
tank1/usr/home/[email protected]    0  - 1.39G - 
tank1/usr/home/[email protected]    0  - 1.39G - 
tank1/usr/home/[email protected]     0  - 1.39G - 
# rm /home/xxxxx/testing12345.txt                                  
# zfs list -rt snapshot tank1/usr/home/xxxxx                               
NAME          USED AVAIL REFER MOUNTPOINT 
tank1/usr/home/[email protected] 291M  - 804M - 
tank1/usr/home/[email protected]     71K  - 1.39G - 
tank1/usr/home/[email protected]      0  - 1.39G - 
tank1/usr/home/[email protected]     0  - 1.39G - 
tank1/usr/home/[email protected]    1K  - 1.39G - 
tank1/usr/home/[email protected]     0  - 1.39G - 
tank1/usr/home/[email protected]    0  - 1.39G - 
tank1/usr/home/[email protected]    0  - 1.39G - 
tank1/usr/home/[email protected]     0  - 1.39G - 
# 

Ich habe versucht, gerollt verschiedene Schnappschüsse mit wieder das Verzeichnis/usr/usr/Home und/usr/home/xxxx-Verzeichnisse. Ich habe die freebsd Foren gelesen, das Handbuch, und ich habe auch versucht, nur tank1 @ [Schnappschussname] zurückzurollen - alles ohne Erfolg. Etwas seltsam, wenn ich Dateien in/usr/home/xxxxx Dateien im versteckten .zfs/snapshots/[Snapshot-Name]/usr/home/xxxxx Verzeichnis ändern auch ändern.

+0

, wenn Sie Ich werde das abstimmen, bitte hinterlasse einen Kommentar mit einer Erklärung, damit ich die Frage korrigieren kann. Eine Abstimmung ohne Kommentar ist nicht besonders hilfreich. – sjt003

+0

Ich sollte erwähnen, dass es mir gelingt, 'zfs send' und' zfs receive' an einen Backup-Pool zu senden. – sjt003

+0

Suchen Sie nach einem Verweis auf ein Dokument, das es erklärt, oder würden Sie mit einer Übung zufrieden sein, die das Verhalten im BSD-Code bestätigt? – dhein

Antwort

2

Verwenden Sie diesen Befehl Platz für alle Snapshots eines vdev verwendet, um zu sehen - relevante Eigenschaft Sie wollen, ist usedsnap:

zfs list -o name,used,avail,refer,creation,usedds,usedsnap,origin,compression,compressratio,refcompressratio,mounted,atime,lused 

ich ein paar mehr Eigenschaften hinzugefügt haben, seit ich Kompression auf meine zfs-Pools verwenden.

zfs Schnappschüsse Verzeichnisse sind übrigens schreibgeschützt.

Sie sagten, Sie können nicht zurückrollen? Wenn das der Fall ist -r oder -R angeben und möglicherweise -f, wenn Sie Klone haben, Beispiel:

zfs rollback -r poolname/[email protected] 
zfs rollback -R poolname/[email protected] 

Lesen Sie das Handbuch vor der Ausgabe von zfs rollback:

 -r 
      Destroy any snapshots and bookmarks more recent than the one specified. 
     -R 
      Recursively destroy any more recent snapshots and bookmarks, as well as any clones of those snapshots. 
     -f 
      Used with the -R option to force an unmount of any clone file systems that are to be destroyed.