Ubuntu:如何挂载zfs快照?


18

我正在尝试挂载zfs快照。它应该是如此简单...但是我不能那样做。我正在使用Ubuntu Server 11.10 Oneric,内核3.0.0-15服务器。

PPA安装了ZFS,我也在使用zfs-auto-snapshot。对于手动创建的快照,情况相同。

如何挂载zfs快照?

root@us1:/# zfs list -t snapshot
NAME                                                            USED  AVAIL  REFER  MOUNTPOINT
tank/www@zfs-auto-snap_hourly-2012-02-11-1917                   0      -   268K  -

root@us1:/# zfs mount tank/www@zfs-auto-snap_hourly-2012-02-11-1917 /mnt/snapshot/tank/www
too many arguments
usage:
        mount
        mount [-vO] [-o opts] <-a | filesystem>

For the property list, run: zfs set|get

For the delegated permission list, run: zfs allow|unallow

root@us1:/# zfs mount tank/www@zfs-auto-snap_hourly-2012-02-11-1917
cannot open 'tank/www@zfs-auto-snap_hourly-2012-02-11-1917': operation not applicable to datasets of this type

Answers:



22

从今天开始,Linux上的ZFS(ZoL)现在还支持通过数据集根目录中的不可见(非隐藏,不可见)目录对快照进行只读访问。

# ls -a /tank/test
./  ../  boot.tar  text.tar  text.tar.2
# cd /tank/test/.zfs/
# ls -a
./  ../  shares/  snapshot/

snapshot目录中,您将找到所有快照的只读副本。

您可以通过.zfs公开显示zfs set snapdir=visible tank/test

资料来源:https : //pthree.org/2012/12/19/zfs-administration-part-xii-snapshots-and-clones/

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.