diandianrong 发表于 2007-06-20 17:10

更改zfs 的挂载点(实验)

默认mountpoint
bash-3.00# zpool create -f pool1 /dev/dsk/c2t0d0s2
bash-3.00# zfs create pool1/zfs1
bash-3.00# zfs list
NAME                   USEDAVAILREFERMOUNTPOINT
pool1                  104K1.95G24.5K/pool1
pool1/zfs1            24.5K1.95G24.5K/pool1/zfs1
bash-3.00# zfs get mountpoint pool1/zfs1
NAME             PROPERTY       VALUE                      SOURCE
pool1/zfs1       mountpoint   /pool1/zfs1                default
bash-3.00# zfs get mounted pool1/zfs1
NAME             PROPERTY       VALUE                      SOURCE
pool1/zfs1       mounted      yes                        -
bash-3.00# zfs mount
pool1                           /pool1
pool1/zfs1                      /pool1/zfs1
更改mountpoint
bash-3.00# zfs set mountpoint=/RJ pool1/zfs1
bash-3.00# zfs mount
pool1                           /pool1
pool1/zfs1                      /RJ
bash-3.00# zfs set mountpoint=/RJ pool1
cannot mount 'pool1': mountpoint or dataset is busy
bash-3.00# zfs umount -a
bash-3.00# zfs mount
bash-3.00# zfs mount pool1/zfs1
bash-3.00# zfs mount
pool1/zfs1                      /RJ
bash-3.00# zfs mount pool1
cannot mount 'pool1': mountpoint or dataset is busy
bash-3.00# zfs mount -O pool1
bash-3.00# zfs mount
pool1/zfs1                      /RJ
pool1                           /RJ
补充知识:
默认的所有的ZFS文件系统的mount是通过SMF'svc://system/filesystem/local服务来启动的。文件系统是mount在/path文件系统名路径上的。
你能够通过设置mount点的属性通过使用zfs set命令来指定mount点。ZFS文件系统自动创建mount点,如果需要自动mount文件系统使用命令zfs mount –a来引入,不需要你来编辑/etc/vfstab文件。

当mount点的属性改变的时候,文件系统是自动从老的mount点上umount的然后重新mount到新的mount点上。Mount点目录是需要创建的。如果ZFS并不能unmount文件系统在文件系统活动期间,这个错误是被报告的并且需要手工强制unmount。

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/26090/showart_325181.html
页: [1]
查看完整版本: 更改zfs 的挂载点(实验)