Notes to Self

Alex Sokolsky's Notes on Computers and Programming

Replace a disk

Replace a disk in a raidz(2)

zpool offline vault da3
shutdown

replace the disk, then:

zpool replace vault 1464662681387557667 /dev/da4

In case it fails as in:

root@nass:~# zpool replace tank -f /dev/sda
invalid vdev specification
the following errors must be manually repaired:
/dev/sda is part of active pool 'tank'

Use zpool labelclear:

zpool labelclear -f /dev/sda
zpool replace tank -f /dev/sda

Replace a disk in a 2-way mirror

A mirror:

# zpool status tank
  pool: tank
 state: ONLINE
  scan: scrub repaired 0 in 0h0m with 0 errors on Thu Apr 26 17:10:10 2012
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          mirror-0  ONLINE       0     0     0
            da1     ONLINE       0     0     0
            da0     ONLINE       0     0     0

errors: No known data errors

Make it a 3-way mirror:

zpool attach tank da0 da2
zpool detach tank da0
zpool set autoexpand=on tank
zpool online -e tank da0

Insert disk. Then in XigmaNAS GUI:

To remedy:

kern.geom.debugflags: 0 -> 16
Deleting MBR and partition table...
2048+0 records in
2048+0 records out
1048576 bytes transferred in 0.924642 secs (1134035 bytes/sec)
2048+0 records in
2048+0 records out
1048576 bytes transferred in 0.206532 secs (5077063 bytes/sec)
Deleting GEOM metadata...
1+0 records in
1+0 records out
512 bytes transferred in 0.000155 secs (3303821 bytes/sec)
kern.geom.debugflags: 16 -> 0
Done!
cp -pR /mnt/vault/movies .