Score:1

How to remove a device from a ZFS pool?

ng flag

I wanted to add ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H into the raidz1-0. Running zpool add tank ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H unfortunately it becomes:

$ zpool status
  pool: tank
 state: ONLINE
config:

        NAME                                   STATE     READ WRITE CKSUM
        tank                                   ONLINE       0     0     0
          raidz1-0                             ONLINE       0     0     0
            ata-TOSHIBA_DT01ACA300_X7NYZ37AS   ONLINE       0     0     0
            ata-TOSHIBA_DT01ACA300_48HNETHAS   ONLINE       0     0     0
            ata-TOSHIBA_DT01ACA300_49E8GHPAS   ONLINE       0     0     0
          ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H  ONLINE       0     0     0

errors: No known data errors
$ sudo zpool remove tank ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H
cannot remove ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H: out of space

Actually the whole ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H should be free, I think?

$ sudo zpool list
NAME   SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
tank  11.8T  7.84T  3.96T        -         -     0%    66%  1.00x    ONLINE  -

May I know how to remove it, and how to add it into the RAID-Z properly?

Thanks.

ロジャー avatar
ng flag
@TeroKilkanen It seems it is outdated. If not extending RAID-Z, may I know how to remove it from the pool?
djdomi avatar
za flag
i think you nees to use offlien and detach and after this, remove, maybe https://docs.oracle.com/cd/E19253-01/819-5461/gbbvf/index.html will help you
ロジャー avatar
ng flag
@djdomi `$ sudo zpool offline tank ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H` shows `cannot offline ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H: no valid replicas`
djdomi avatar
za flag
you need to detach it first
ロジャー avatar
ng flag
@djdomi `$ sudo zpool detach tank ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H` gives `cannot detach ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H: only applicable to mirror and replacing vdevs`
djdomi avatar
za flag
could it be that the drive you try to remove is marked as spare?
ロジャー avatar
ng flag
@djdomi seems not. According to this page https://docs.oracle.com/cd/E19253-01/819-5461/gcvcw/index.html spare should be under a `spare-0` level.
ロジャー avatar
ng flag
I am cleaning up the `tank` pool to try removing the `device`. Now it gives `cannot remove ata-TOSHIBA_DT02ABA400_90D1S0Q2S75H: invalid config; all top-level vdevs must have the same sector size and not be raidz.`. It seems extending RAIDZ will not be available until late 2022. https://louwrentius.com/zfs-raidz-expansion-is-awesome-but-has-a-small-caveat.html Maybe I will rebuild everything into a MIRROR instead at this moment.
djdomi avatar
za flag
i would suggest that you take a backup and start from scratch, mostly a raid10 configuration would be fine in most cases
ロジャー avatar
ng flag
@djdomi yeah I am backing up everything to cloud and starting from scratch. I will use ZFS-stripe since I have back-up online. Mirror leaves me 50% it is too costly. Thanks for your suggestions anyway.
djdomi avatar
za flag
remind, that you need to use wipefs to get rid of ZFS :)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.