Create Storage Pool and File System
bash-3.00# uname -aSunOS solhost 5.10 Generic_118855-33 i86pc i386 i86pc Solaris
bash-3.00# mkdir -p /yanxf/zfs
bash-3.00# cd /yanxf/zfs
bash-3.00# mkfile -nv 100m 100m.file.1
100m.file.1 104857600 bytes
bash-3.00# ls
100m.file.1
bash-3.00# lofiadm -a /yanxf/zfs/100m.file.1
/dev/lofi/1
bash-3.00# lofiadm
Block Device File
/dev/lofi/1 /yanxf/zfs/100m.file.1
bash-3.00# zpool create firstpool /dev/lofi/1
bash-3.00# zpool list
NAME SIZE USED AVAIL CAPHEALTH ALTROOT
firstpool 95.5M 52.5K 95.4M 0%ONLINE -
bash-3.00# zpool status
池:firstpool
状态:ONLINE
清理:未请求
配置:
NAME STATE READ WRITE CKSUM
firstpool ONLINE 0 0 0
/dev/lofi/1ONLINE 0 0 0
错误:无已知的数据错误
bash-3.00# zfs create firstpool/firstfs
bash-3.00# zfs create firstpool/secondfs
bash-3.00# zfs list
NAME USEDAVAILREFERMOUNTPOINT
firstpool 136K63.4M27.5K/firstpool
firstpool/firstfs 24.5K63.4M24.5K/firstpool/firstfs
firstpool/secondfs 24.5K63.4M24.5K/firstpool/secondfs
bash-3.00# zpool list
NAME SIZE USED AVAIL CAPHEALTH ALTROOT
firstpool 95.5M 140K 95.4M 0%ONLINE -
bash-3.00# df -h
Filesystem SizeUsed Avail Use% Mounted on
/dev/dsk/c0d0s0 67G4.7G 61G 8% /
swap 2.2G732K2.2G 1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
67G4.7G 61G 8% /lib/libc.so.1
swap 2.2G 88K2.2G 1% /tmp
swap 2.2G 36K2.2G 1% /var/run
firstpool 64M 28K 64M 1% /firstpool
firstpool/firstfs 64M 25K 64M 1% /firstpool/firstfs
firstpool/secondfs 64M 25K 64M 1% /firstpool/secondfs
bash-3.00#cd /firstpool/firstfs/
bash-3.00#mkfile -v 200m bigfile
bigfile 209715200 bytes
bigfile: initialized 66068480 of 209715200 bytes: No space left on device
bash-3.00# df -h
Filesystem SizeUsed Avail Use% Mounted on
/dev/dsk/c0d0s0 67G4.7G 61G 8% /
swap 2.2G732K2.2G 1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
67G4.7G 61G 8% /lib/libc.so.1
swap 2.2G 88K2.2G 1% /tmp
swap 2.2G 36K2.2G 1% /var/run
firstpool 28K 28K 0 100% /firstpool
firstpool/firstfs 64M 64M 0 100% /firstpool/firstfs
firstpool/secondfs 25K 25K 0 100% /firstpool/secondfs
bash-3.00# cd /yanxf/zfs
bash-3.00# mkfile -nv 1g 1g.file
1g.file 1073741824 bytes
bash-3.00# ls
100m.file.11g.file
bash-3.00# lofiadm -a /yanxf/zfs/1g.file
/dev/lofi/2
bash-3.00# zpool add firstpool /dev/lofi/2
bash-3.00# zpool list
NAME SIZE USED AVAIL CAPHEALTH ALTROOT
firstpool 1.09G 63.7M 1.02G 5%ONLINE -
bash-3.00# df -h
Filesystem SizeUsed Avail Use% Mounted on
/dev/dsk/c0d0s0 67G4.7G 61G 8% /
swap 2.2G732K2.2G 1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
67G4.7G 61G 8% /lib/libc.so.1
swap 2.2G 88K2.2G 1% /tmp
swap 2.2G 36K2.2G 1% /var/run
firstpool 1016M 28K 1016M 1% /firstpool
firstpool/firstfs 1.1G 64M 1016M 6% /firstpool/firstfs
firstpool/secondfs 1016M 25K 1016M 1% /firstpool/secondfs
bash-3.00# cd /firstpool/firstfs
bash-3.00# ls -l
total 64789
-rw------- 1 root root 209715200 2007-04-21 09:50 bigfile
bash-3.00# pwd
/firstpool/firstfs
bash-3.00# ls
bigfile
bash-3.00# mkfile -v 200m 200m.file.2
200m.file.2 209715200 bytes
bash-3.00# ls -l
total 246460
-rw------T 1 root root 209715200 2007-04-21 09:55 200m.file.2
-rw------- 1 root root 209715200 2007-04-21 09:50 bigfile
bash-3.00# cd /
bash-3.00# zpool destroy firstpool
bash-3.00# lofiadm -d /dev/lofi/1
bash-3.00# lofiadm -d /dev/lofi/2
bash-3.00# df -h
Filesystem SizeUsed Avail Use% Mounted on
/dev/dsk/c0d0s0 67G5.7G 60G 9% /
swap 2.3G732K2.3G 1% /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
67G5.7G 60G 9% /lib/libc.so.1
swap 2.3G 88K2.3G 1% /tmp
swap 2.3G 36K2.3G 1% /var/run
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/524/showart_296618.html
页:
[1]