-bash-3.00# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w2100000c5056ddb0,0
1. c1t1d0
/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000004cf58c65e,0
Specify disk (enter its number):
2.建立 ZFS 儲存池及檔案系統
使用一個硬碟:c1t1d0
儲存池及檔案系統的名稱:mancini
#zpool create -f mancini c1t1d0
3.查詢主機上有哪些儲存池
-bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
mancini 72K 66.9G 21K /mancini
3-1.在儲存池中增加檔案系統,並查看新增之檔案系統
-bash-3.00# zfs create mancini/test1
-bash-3.00# zfs create mancini/test2
-bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
mancini 132K 66.9G 23K /mancini
mancini/test1 21K 66.9G 21K /mancini/test1
mancini/test2 21K 66.9G 21K /mancini/test2
-bash-3.00#
4.啟用壓縮,要在建立時設定,因為它只針對後來放進來的檔案壓縮
#zfs set compression=on mancini
5.檢視新建立的檔案系統
#ls /mancini
#df -h /mancini
6.檢查資料壓縮狀況
-bash-3.00# zfs get compressratio mancini
NAME PROPERTY VALUE SOURCE
mancini compressratio 1.00x -
7.建立快照
#zfs snapshot mancini@20100120
所建立的快照檔案存放在
-bash-3.00# ls -l /mancini/.zfs/snapshot/20100120
drwxr-xr-x 2 root root 2 1AI 20AE 14:47 test1
drwxr-xr-x 2 root root 2 1AI 20AE 14:47 test2
8.檢視現有的快照
#zfs list -t snapshot
9.刪除快照
#zfs destroy mancini@20100120
10.將所有檔案系統建立快照
-bash-3.00# zfs snapshot -r mancini@20100120
-bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
mancini 135K 66.9G 24K /mancini
mancini@20100120 0 - 24K -
mancini/test1 21K 66.9G 21K /mancini/test1
mancini/test1@20100120 0 - 21K -
mancini/test2 21K 66.9G 21K /mancini/test2
mancini/test2@20100120 0 - 21K -
11.移除zfs檔案系統
-bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
mancini 135K 66.9G 24K /mancini
mancini@20100120 0 - 24K -
mancini/test1 21K 66.9G 21K /mancini/test1
mancini/test1@20100120 0 - 21K -
mancini/test2 21K 66.9G 21K /mancini/test2
mancini/test2@20100120 0 - 21K -
移除快照
-bash-3.00# zfs destroy -r mancini@20100120
-bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
mancini 135K 66.9G 24K /mancini
mancini/test1 21K 66.9G 21K /mancini/test1
mancini/test2 21K 66.9G 21K /mancini/test2
移除檔案系統
-bash-3.00# zfs destroy -r mancini
-bash-3.00# zfs list
NAME USED AVAIL REFER MOUNTPOINT
mancini 80K 66.9G 23K /mancini
移除儲存池
-bash-3.00# zpool destroy -f mancini
參考資料
Eric Kustarz's Weblog
http://blogs.sun.com/erickustarz/entry/zfs_on_a_laptop
ZFS 到底是什麼東東?
http://www.ntu.beautifulworldco.com/weblog/?p=381
Solaris ZFS Administration Guide
http://docs.sun.com/app/docs/doc/819-5461
沒有留言:
張貼留言