歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> Unix基礎知識 >> Solaris10下如何使用ZFS

Solaris10下如何使用ZFS

日期:2017/2/25 10:13:13   编辑:Unix基礎知識
  ZFS,作為Solaris 10的下一代文件存儲解決方案,ZFS即Zettabyte File System,也叫動態文件系統Dynamic File System, 是第一個128位文件系統,無限容量、自優化、永遠數據一致、管理簡單:
- 支持POSIX文件系統,應用無需移植
- 無限容量,比32/64位文件系統大16 billion billion倍
- 對於應用來說,ZFS像一個標准的POSIX文件系統,無需移植。
- 對於系統管理員來說,ZFS提供存儲池的模型,徹底消除了卷管理的概念,及其帶來的硬盤分區的問題,可以使所有文件系統利用存儲池的所有設備的訪問帶寬,100%在線維護。
- 所有操作采用copy-on-write方式,硬盤狀態永遠有效, 無需fsck。
- 所有數據塊被64位校驗, 防止數據癱瘓, 並且數據可做Raid,其中一個數據損壞可由另一數據修復。
- 提供無限份的快照,提供磁盤限額
1. 檢查預裝OS,如無 ZFS包,則需安裝軟件包:
# pkginfo |grep SUNWzfs
# pkgadd -d .
The following packages are available:
1 SUNWzfs Zettabyte File System (ZFS)
(sparc) 11.10.0,REV=2004.12.26.02.38
Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:1
...
Installation of <SUNWzfs> was successful.
2. 建立storage pool:
# zpool create -f testpool mirror /dev/dsk/c0t1d0s0 /dev/dsk/c0t1d0s1
# zpool df testpool
Pool size used avail capacity
-------------------- ------ ------ ------ --------
testpool 500M 56.0K 500M 1%
# zpool vdevs -v testpool
mirror1
c0t1d0s0
c0t1d0s1
3. 建立文件系統:
# zfs create testpool/user1
# zfs create testpool/user2
# mkdir -p /disk/user1 /disk/user2
# zfs mount testpool/user1 /disk/user1
# zfs mount testpool/user2 /disk/user2
# df -h -F zfs
文件系統 大小 用了 可用 容量 掛接在
testpool/user1 484M 27K 484M 1% /disk/user1
testpool/user2 484M 27K 484M 1% /disk/user2
4. 測試ZFS的讀寫變化:
# cp /etc/n* /disk/user1; cp /etc/m* /disk/user2
# df -h -F zfs
文件系統 大小 用了 可用 容量 掛接在
testpool/user1 484M 60K 484M 1% /disk/user1
testpool/user2 484M 123K 484M 1% /disk/user2
5. 增加新的存儲到storage pool,擴展ZFS:
# zpool add -f testpool mirror c0t1d0s3 c0t1d0s4
# zpool df testpool
Pool size used avail capacity
-------------------- ------ ------ ------ --------
testpool 1000M 303K 1000M 1%
s6a# zpool vdevs -v testpool
mmirror1
c0t1d0s0
c0t1d0s1
mirror2
c0t1d0s3
c0t1d0s4
# df -h -F zfs
文件系統 大小 用了 可用 容量 掛接在
testpool/user1 982M 60K 982M 1% /disk/user1
testpool/user2 982M 123K 982M 1% /disk/user2
6. 破壞storage pool硬盤的數據,觀察ZFS中數據不受影響:
# dd if=/dev/urandom of=/dev/rdsk/c0t1d0s1 count=10000
10000+0 記錄進入
10000+0 記錄調出
# df -h -F zfs
文件系統 大小 用了 可用 容量 掛接在
testpool/user1 982M 60K 982M 1% /disk/user1
testpool/user2 982M 123K 982M 1% /disk/user2
# diff /etc/nsswitch.conf /disk/user1/nsswitch.conf
總結:
文件系統管理,ZFS提供一個新的易於使用的自動管理的模型,降低復雜性,減少錯誤和實施的時間。
數據安全和完整性, ZFS數據在任何時間都是一致的。
對於資源利用,ZFS存儲池可為多個文件系統共享。
增加靈活性, ZFS擴展或縮小是動態的,無需系統管理員介入 。
降低費用,可免除額外的卷管理的許可費用。
Copyright © Linux教程網 All Rights Reserved