Escolar Documentos
Profissional Documentos
Cultura Documentos
$ man zpool
$ man zfs
$ su
Password:
# cd /
# mkfile 100m disk1 disk2 disk3 disk5
# mkfile 50m disk4
# ls -l disk*
-rw------T
1 root
root
104857600 Sep 11 12:15
disk1
-rw------T
1 root
root
104857600 Sep 11 12:15
disk2
-rw------T
1 root
root
104857600 Sep 11 12:15
disk3
-rw------T
1 root
root
52428800 Sep 11 12:15
disk4
-rw------T
1 root
root
104857600 Sep 11 12:15
disk5
# zpool create myzfs /disk1 /disk2
# zpool list
NAME
SIZE
USED
AVAIL
CAP HEALTH
ALTROOT
myzfs
191M
94K
191M
0% ONLINE
# zpool status -v
pool: myzfs
state: ONLINE
scrub: none requested
config:
NAME
myzfs
/disk1
/disk2
STATE
ONLINE
ONLINE
ONLINE
# zpool
# zpool
NAME
ALTROOT
myzfs
# zpool
pool:
state:
scrub:
95.4M
0%
ONLINE
config:
NAME
myzfs
mirror
/disk1
/disk2
/disk3
errors:
# zpool
# zpool
pool:
state:
scrub:
config:
STATE
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
STATE
ONLINE
ONLINE
ONLINE
ONLINE
STATE
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
mirrored pool.
STATE
ONLINE
ONLINE
ONLINE
ONLINE
AVAIL
errors:
# zpool
# zpool
pool:
state:
scrub:
config:
STATE
ONLINE
ONLINE
ONLINE
ONLINE
STATE
DEGRADED
DEGRADED
OFFLINE
ONLINE
STATE
ONLINE
ONLINE
ONLINE
ONLINE
pool.
config:
NAME
myzfs
mirror
/disk3
/disk2
STATE
ONLINE
ONLINE
ONLINE
ONLINE
CAP
HEALTH
95.4M
0%
ONLINE
# zpool upgrade
This system is currently running ZFS pool version 8.
All pools are formatted using this version.
# zpool upgrade -v
This system is currently running ZFS pool version 8.
The following versions are supported:
VER DESCRIPTION
---------------------------------------------------------1
Initial ZFS version
2
Ditto blocks (replicated metadata)
3
Hot spares and double parity RAID-Z
4
zpool history
5
Compression using the gzip algorithm
6
pool properties
7
Separate intent log devices
8
Delegated administration
For more information on a particular version, including
supported
releases, see:
http://www.opensolaris.org/os/community/zfs/version/N
Where 'N' is the version number.
# zpool iostat 5
capacity
operations
pool
used avail
read write
---------- ----- ----- ----- ----myzfs
112K 95.4M
0
4
myzfs
112K 95.4M
0
0
myzfs
112K 95.4M
0
0
bandwidth
read write
----- ----26 11.4K
0
0
0
0
STATE
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
MOUNTPOINT
/myzfs
/myzfs/colin
/myzfs/colin2
Rollback to a snapshot.
Destroy a filesystem
REFER
MOUNTPOINT
myzfs
myzfs/colin
myzfs/colin@test
myzfs/colin3
20.1M
18K
0
0
139M
159M
139M
22K
18K
18K
18K
/myzfs
/myzfs/colin
/myzfs/colin3
Attempt to destroy a
filesystem that had a child.
# zfs destroy myzfs/colin
cannot destroy 'myzfs/colin': filesystem has children
use '-r' to destroy the following datasets:
myzfs/colin@test
myzfs
/myzfs
# zfs mount myzfs/bob
# df -h
myzfs
/myzfs
myzfs/bob
/myzfs/bob
159M
20K
159M
1%
159M
20K
159M
1%
159M
18K
159M
1%
representation of the
snapshot and redirect it to
zfs receive. In this example
I've redirected to the
localhost for illustration
purposes. This can be used
to backup to a remote host,
or even to a local file.
# zpool history
History for 'myzfs':
2007-09-11.15:35:50 zpool create myzfs mirror /disk1
/disk2 /disk3
2007-09-11.15:36:00 zpool detach myzfs /disk3
2007-09-11.15:36:10 zpool attach myzfs /disk1 /disk3
2007-09-11.15:36:53 zpool detach myzfs /disk3
2007-09-11.15:36:59 zpool add myzfs spare /disk3
2007-09-11.15:37:09 zpool remove myzfs /disk3
2007-09-11.15:37:18 zpool offline myzfs /disk1
2007-09-11.15:37:27 zpool online myzfs /disk1
2007-09-11.15:37:37 zpool replace myzfs /disk1 /disk3
2007-09-11.15:37:47 zpool scrub myzfs
2007-09-11.15:37:57 zpool export myzfs
2007-09-11.15:38:05 zpool import -d / myzfs
2007-09-11.15:38:52 zfs create myzfs/colin
2007-09-11.15:39:27 zpool add myzfs mirror /disk1 /disk5
2007-09-11.15:39:38 zfs create myzfs/colin2
2007-09-11.15:39:50 zfs set reservation=20m myzfs/colin
2007-09-11.15:40:18 zfs set quota=20m myzfs/colin2
2007-09-11.15:40:35 zfs set compression=on myzfs/colin2
2007-09-11.15:40:48 zfs snapshot myzfs/colin@test
2007-09-11.15:40:59 zfs rollback myzfs/colin@test
2007-09-11.15:41:11 zfs clone myzfs/colin@test
myzfs/colin3
2007-09-11.15:41:25 zfs destroy myzfs/colin2
2007-09-11.15:42:12 zfs promote myzfs/colin3
2007-09-11.15:42:26 zfs rename myzfs/colin3 myzfs/bob
2007-09-11.15:42:57 zfs destroy myzfs/colin
2007-09-11.15:43:23 zfs rename myzfs/bob@test
myzfs/bob@newtest
2007-09-11.15:44:30 zfs receive myzfs/backup
# zpool destroy -f myzfs
# zpool status -v
no pools available