[SOLVED] How to remove Cache Device from ZFS Pool

nigi

Well-Known Member
Jan 1, 2017
30
1
48
39
Hi,
I've got a pool with an cache device. It's an NVME and it's almost end of life
SMART sais: "Percentage Used: 190% "
I don't need this cache, so I'd like to remove the device.

Code:
root@vhost:~# zpool status
  pool: rpool
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
    still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
    the pool may no longer be accessible by software that does not support
    the features. See zpool-features(5) for details.
  scan: scrub repaired 0B in 0 days 10:34:51 with 0 errors on Sun Feb  9 10:58:53 2020
config:

    NAME                                                STATE     READ WRITE CKSUM
    rpool                                               ONLINE       0     0     0
      mirror-0                                          ONLINE       0     0     0
        ata-WDC_WD30EFRX-68EUZN0_WD-WCC4N5PNXXT1-part2  ONLINE       0     0     0
        ata-ST3000VN000-1HJ166_W6A1K7GA-part2           ONLINE       0     0     0
      mirror-1                                          ONLINE       0     0     0
        ata-WDC_WD30EFRX-68EUZN0_WD-WMC4N0J5ZUNA        ONLINE       0     0     0
        ata-WDC_WD30EFRX-68EUZN0_WD-WMC4N0H58NRS        ONLINE       0     0     0
    logs
      e8706967-01                                       ONLINE       0     0     0
    cache
      nvme0n1p2                                         ONLINE       0     0     0

errors: No known data errors

But when I'm trying to remove it using

$ zpool remove rpool nvme0n1p2

the server hangs and only a hard reset will help.
How can I remove this device? Can anybody help me?

Thank you!
nigi
 
try the same command but only when your system and applications are halted.
It hanging likely due to the I/O, so more stateful removal would be only if the OS is the only thing running.

What OS are you running this on?

Is the entire zpool using NVME?
If it is end of life I suggest that you create a new root zpool and boot of it do this when you can get downtime.

Look in the /etc/default/zfs and see if any cache options are set. If they are set them to NONE
Then try to remove it that way. You'll have to reboot anyway.

Then hopefully you can remove that cache that don't want.

Phillip
 
try the same command but only when your system and applications are halted.
It hanging likely due to the I/O, so more stateful removal would be only if the OS is the only thing running.

What OS are you running this on?

Is the entire zpool using NVME?
If it is end of life I suggest that you create a new root zpool and boot of it do this when you can get downtime.

Look in the /etc/default/zfs and see if any cache options are set. If they are set them to NONE
Then try to remove it that way. You'll have to reboot anyway.

Then hopefully you can remove that cache that don't want.

Phillip

Well… no… even if the zpool is in heavy use, you should always be able to remove a cache device without issue. As that cache is "only" L2ARC, there can be nothing on it, which isn't already on stable storage on the vdevs.

Also, that rpool is obviously not made up of other parts of that NVMe device, as can be seen from the output of zpool status.
What you can always do is - if that NVMe device is not used elsewhere, export the ZPOOL and remove the NVMe device altogether, you can always import a ZPOOL even if its cache devices are missing.
 
Hi, just to give you a feedback:
I've tried it a few times, but the system always hangs. I think I've missunderstood the settings in /etc/defaults/zfs. Setting the cache to ='' (empty) seems to be not the same as "NONE" ;) Reading the explanation in den conf-file is helfpul ;-)
After changing it, I could remove the nvme without any problems.
Thank you very much for you help!!!
nigi
 
Hi, just to give you a feedback:
I've tried it a few times, but the system always hangs. I think I've missunderstood the settings in /etc/defaults/zfs. Setting the cache to ='' (empty) seems to be not the same as "NONE" ;) Reading the explanation in den conf-file is helfpul ;-)
After changing it, I could remove the nvme without any problems.
Thank you very much for you help!!!
nigi
@nigi Can you please elaborate on how to do it? I've tried setting ZPOOL_CACHE='' and ZPOOL_CACHE="NONE", but none of this allowed me to remove cache drive. Thanks.
 
You should be able to just remove cache devices. If that makes the server hang it would probably be a hardware problem. Or maybe it was a bug that's long gone now.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!