Showing posts with label zfs. Show all posts
Showing posts with label zfs. Show all posts

20090514

zpool replace problem

Scenario.
Disk from pool1 failed. It was replaced with a new one, with appropriate cfgadm -c unconfigure and cfgadm -c configure commands. Process of resilvering has been completed, but there's still the unavailable device within a pool status. Any try to take a device offline causes the scrub process to start again.

thumper [~]# zpool status -v pool1
pool: pool1
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-D3
scrub: resilver in progress, 2,32% done, 28h7m to go
config:

NAME STATE READ WRITE CKSUM
pool1 DEGRADED 0 0 0
raidz2 DEGRADED 0 0 0
c7t0d0p0 ONLINE 0 0 0
c6t0d0p0 ONLINE 0 0 0
c7t4d0p0 ONLINE 0 0 0
c6t4d0p0 ONLINE 0 0 0
c1t0d0p0 ONLINE 0 0 0
c0t0d0p0 ONLINE 0 0 0
c1t4d0p0 ONLINE 0 0 0
c0t4d0p0 ONLINE 0 0 0
c5t1d0p0 ONLINE 0 0 0
c4t1d0p0 ONLINE 0 0 0
c5t5d0p0 ONLINE 0 0 0
c4t5d0p0 ONLINE 0 0 0
c7t1d0p0 ONLINE 0 0 0
c6t1d0p0 ONLINE 0 0 0
spare DEGRADED 0 0 0
c7t5d0p0 UNAVAIL 0 0 0 cannot open
c1t3d0p0 ONLINE 0 0 0
c6t5d0p0 ONLINE 0 0 0
c1t1d0p0 ONLINE 0 0 0
c0t1d0p0 ONLINE 0 0 0
c1t5d0p0 ONLINE 0 0 0
c0t5d0p0 ONLINE 0 0 0
spares
c1t3d0p0 INUSE currently in use
c0t3d0p0 AVAIL

errors: No known data errors


Solution
Do exactly the same what has been done with a disk from the system point of view.
Replace it in place.

thumper [~]# zpool replace pool1 c7t5d0p0 c7t5d0p0


After resilver period of time:

thumper [~]# zpool status -v pool1
pool: pool1
state: ONLINE
scrub: resilver completed with 0 errors on Thu May 14 17:08:20 2009
config:

NAME STATE READ WRITE CKSUM
pool1 ONLINE 0 0 0
raidz2 ONLINE 0 0 0
c7t0d0p0 ONLINE 0 0 0
c6t0d0p0 ONLINE 0 0 0
c7t4d0p0 ONLINE 0 0 0
c6t4d0p0 ONLINE 0 0 0
c1t0d0p0 ONLINE 0 0 0
c0t0d0p0 ONLINE 0 0 0
c1t4d0p0 ONLINE 0 0 0
c0t4d0p0 ONLINE 0 0 0
c5t1d0p0 ONLINE 0 0 0
c4t1d0p0 ONLINE 0 0 0
c5t5d0p0 ONLINE 0 0 0
c4t5d0p0 ONLINE 0 0 0
c7t1d0p0 ONLINE 0 0 0
c6t1d0p0 ONLINE 0 0 0
c7t5d0p0 ONLINE 0 0 0
c6t5d0p0 ONLINE 0 0 0
c1t1d0p0 ONLINE 0 0 0
c0t1d0p0 ONLINE 0 0 0
c1t5d0p0 ONLINE 0 0 0
c0t5d0p0 ONLINE 0 0 0
spares
c1t3d0p0 AVAIL
c0t3d0p0 AVAIL

errors: No known data errors

Voila!

20070803

turn into mirror

In below example i've used single volume zfs pool to convert it into mirror zpool.
To show the possibilities of zfs in more extensive way it's based on file volumes instead of drives.

# mkfile -nv 1g mud
mud 1073741824 bytes
# zpool create pond /export/mud

I've created the pond pool based on a mud file.
Now, using the attach method of zpool command, I'll turn it into mirror with water (second file volume).

# mkfile -nv 1g water
water 1073741824 bytes
# zpool attach pond /export/mud /export/water
# zpool status pond
pool: pond
state: ONLINE
scrub: resilver completed with 0 errors on Wed Apr 11 09:43:22 2007
config:

NAME STATE READ WRITE CKSUM
pond ONLINE 0 0 0
mirror ONLINE 0 0 0
/export/mud ONLINE 0 0 0
/export/water ONLINE 0 0 0

errors: No known data errors

20070802

quick snapshot tour

To take a snapshot of zfs pool pool/aqua you have to run an example command:
# zfs snapshot pool/aqua@cold
where the cold is the name of a newly created shot.

You could find it in (pool/aqua/) .zfs/snapshot directory. By default it's hidden.
You can change this behaviour by setting snapdir variable on pool/aqua to visible:
# zfs set snapdir=visible pool/aqua

To take advantage of snapshots in another way, use it to quickly reproduce the filesystems with clone method.
The clone is functional fs instead of snapshot which cannot be modified (ro mode).
# zfs clone pool/aqua@cold pool/ice

It's a good habit to name the snapshop in a way enabling you to remember the creation time.
In a case of memory leak do the following:
# zfs get creation pool/aqua@cold

To destroy snapshot simply run:
# zfs destroy pool/aqua@cold