[zfs-discuss] Problem removing bad disk

John Drescher drescherjm at gmail.com
Mon Sep 21 10:57:19 EDT 2015


I had a disk go down last week (totally offline) so I replaced it with
a spare that I gave the same alias in my /etc/zfs/vdev_id.conf as the
disk that was bad. Here is my vdev_id.conf (commented out lines are
drives that have been replaced in the 2+ years I have used
zfsonlinux):

#alias a0_d0 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X05A1N
alias a0_d0 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X1F9DB
alias a0_d1 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X05A89
alias a0_d2 /dev/disk/by-id/ata-Hitachi_HDS722020ALA330_JK1101B9JNJBBU
alias a0_d3 /dev/disk/by-id/ata-TOSHIBA_MK2002TSKB_82N2K3W6F
alias a0_d4 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X059VG
alias a0_d5 /dev/disk/by-id/ata-TOSHIBA_MK2002TSKB_42C1KBYMF
alias a0_d6 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X1FNF3

alias a1_d0 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1Y1EJ2X
alias a1_d1 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X1GVHB
alias a1_d2 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1Y1DSTP
alias a1_d3 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1Y1EG9N
#alias a1_d4 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X1ENWN
alias a1_d4 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X1ENKA
alias a1_d5 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X1FMK9
#alias a1_d6 /dev/disk/by-id/ata-ST2000NM0033-9ZM175_Z1X1F9C2
alias a1_d6 /dev/disk/by-id/ata-Hitachi_HDS722020ALA330_JK1105B8JS1BZX


anyways after adding the spare

2015-09-18.11:33:30 zpool add zfs_data_0 spare a1_d4-part3

and issuing zpool replace

2015-09-18.11:34:35 zpool replace zfs_data_0 13620686593447394069 a1_d4-part3

the pool resilvered (even though it warned that  a1_d4-part3 was in
use) but it still says DEGRADED and will not let me get rid of the old
drive.

datastore4 ~ # zpool status
  pool: zfs_data_0
 state: DEGRADED
status: One or more devices could not be used because the label is missing or
        invalid.  Sufficient replicas exist for the pool to continue
        functioning in a degraded state.
action: Replace the device using 'zpool replace'.
   see: http://zfsonlinux.org/msg/ZFS-8000-4J
  scan: scrub canceled on Mon Sep 21 09:35:24 2015
config:

        NAME                        STATE     READ WRITE CKSUM
        zfs_data_0                  DEGRADED     0     0     0
          raidz2-0                  ONLINE       0     0     0
            a0_d0-part3             ONLINE       0     0     0
            a0_d1-part3             ONLINE       0     0     0
            a0_d2-part3             ONLINE       0     0     0
            a0_d3-part3             ONLINE       0     0     0
            a0_d4-part3             ONLINE       0     0     0
            a0_d5-part3             ONLINE       0     0     0
            a0_d6-part3             ONLINE       0     0     0
          raidz2-1                  DEGRADED     0     0     0
            a1_d0-part3             ONLINE       0     0     0
            a1_d1-part3             ONLINE       0     0     0
            a1_d2-part3             ONLINE       0     0     0
            a1_d3-part3             ONLINE       0     0     0
            spare-4                 DEGRADED     0     0     0
              13620686593447394069  UNAVAIL      0     0     0  was
/dev/disk/by-vdev/a1_d4-part3/old
              a1_d4-part3           ONLINE       0     0     0
            a1_d5-part3             ONLINE       0     0     0
            a1_d6-part3             ONLINE       0     0     0
        spares
          a1_d4-part3               INUSE     currently in use

errors: No known data errors

I tried removing it but I get:

datastore4 ~ # zpool remove zfs_data_0 13620686593447394069
cannot remove 13620686593447394069: only inactive hot spares, cache,
top-level, or log devices can be removed


datastore4 ~ # cat /sys/module/{zfs,spl}/version
0.6.4-212_gdca8c34
0.6.4-25_g4fa4cab



John


More information about the zfs-discuss mailing list