Is it safe to remove an SSD cache drive from a zpool?

Joined
Dec 26, 2013
Messages
18
I am new to FreeNAS, FreeBSD, and ZFS, but know just enough to be dangerous.

My FreeNAS server has four platter drives (RAID 10: mirror+stripe). I did something foolish, and added an SSD cache drive to the zpool using the FreeNAS web interface. I've since learnt that an SSD cache won't give me any benefit, and would now like to remove the SSD cache drive. There isn't a way to do that from the GUI, so I've been reading up on the zpool command. There doesn't seem to be any FreeNAS documentation on how to remove cache devices, but I did find the FreeBSD man page for zpool.

I ran zpool offline <ZPOOL> <DEVICE> to offline the cache drive from the zpool. What's the next step to remove the cache device entirely? If I run zpool remove <ZPOOL> <DEVICE>, will that remove the SSD cache, leave my four data discs alone, and be the end of this terrible and ill-advised experiment? Or might it destroy the zpool data?

The FreeBSD man page for zpool states:

zpool remove pool device ...

Removes the specified device from the pool. This command currently
only supports removing hot spares, cache, and log devices. A mirrored
log device can be removed by specifying the top-level mirror for the
log. Non-log devices that are part of a mirrored configuration can be
removed using the "zpool detach" command. Non-redundant and raidz
devices cannot be removed from a pool.

I'm fairly certain that zpool remove is the command I need, but just wanted to make doubly sure before running it, as it will take me days to restore the data from back-up if the zpool is destroyed. Will my zpool be safe? Here's the output of the zpool status command, so you can see my set-up.

Thanks in advance for any thoughts on the best way to proceed!

Screen Shot 2014-08-01 at 16.17.39.png
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
The zpool will only be destroyed if you do zpool destroy. Otherwise ZFS won't let you do anything that would kill the pool. You can remove redundancy though.

I believe the proper command is zpool remove.
 
Joined
Dec 26, 2013
Messages
18
Thank-you, cyberjock. It's always good to get a second opinion on matters that involve multiple terabytes.

I ran zpool remove <ZPOOL> <DEVICE>, the SSD cache drive no longer appeared in the config list, and the FreeNAS status changed from degraded to healthy. Much appreciated. I hope this post helps anyone else who is similarly trepid when it comes to dealing with zpools.
 

Serverbaboon

Dabbler
Joined
Aug 12, 2013
Messages
45
Just the thread I was looking for, the controller that ran my zil (for ESXI NFS) and Cache ( brief dalliance before using as a Log on my other pool) has died leaving my pool in a degraded state.

I have just made sure of my backups before I try the remove command tonight.
 

JonGibbins

Cadet
Joined
Nov 22, 2016
Messages
1
Just another +1 for appreciation of this thread and it's top answer. Sorted me out nicely.

Thank you!
 

Rick Arman

Dabbler
Joined
Jan 5, 2017
Messages
32
question: did you get a message in your critical alerts about something running in degraded state?
 

joshphp

Cadet
Joined
Jan 10, 2017
Messages
2
Rick, I did not receive receive any message after running the above commands and rebooting.
 

Thumper33

Dabbler
Joined
Jan 16, 2017
Messages
27
I have the same problem as the OP and it's not working for me.... not sure what I'm missing....

Code:
nevitt33@NAS:~$ sudo zpool status
  pool: Tank
state: ONLINE
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 repaired 0 in 0h0m with 0 errors on Tue Jan 31 23:28:55 2017
config:

		NAME									STATE	 READ WRITE CKSUM
		Tank									ONLINE	   0	 0	 0
		  mirror-0							  ONLINE	   0	 0	 0
			sdb2								ONLINE	   0	 0	 0
			sdc2								ONLINE	   0	 0	 0
		cache
		  71e7694f-e061-11e6-bd1f-3497f600ddaf  UNAVAIL	  0	 0	 0

errors: No known data errors



so I run sudo zpool remove 71e7694f-e061-11e6-bd1f-3497f600ddaf and get...

Code:
nevitt33@NAS:~$ sudo zpool remove 71e7694f-e061-11e6-bd1f-3497f600ddaf
missing device
usage:
		remove <pool> <device> ...



I also tried sudo zpool remove Tank 71e7694f-e061-11e6-bd1f-3497f600ddaf

Code:
cannot remove 71e7694f-e061-11e6-bd1f-3497f600ddaf: no such device in pool


and sudo zpool remove cache 71e7694f-e061-11e6-bd1f-3497f600ddaf

Code:
cannot open 'cache': no such pool

 

Thumper33

Dabbler
Joined
Jan 16, 2017
Messages
27
Still haven't found a solution.

Sent from my SM-T377T using Tapatalk
 

beezel

Dabbler
Joined
Nov 7, 2016
Messages
33
Hey Thumper,

It looks like you have more problems than zpool remove will deal with. Your cache disk is not showing up properly, as can be see as UNAVAIL and the error message "one or more devices could not be used."

zpool remove is only going to work with devices that are recognized and functioning. I haven't been in that situation before, so I'm not sure on the exact resolution. If you have a cache disk and it's in the box but not attached, you may want to try zpool replace to get the pool to see an actual cache device, and then zpool remove. Otherwise I'd start googling how to remove non-existent devices.

I have the same problem as the OP and it's not working for me.... not sure what I'm missing....

Code:
nevitt33@NAS:~$ sudo zpool status
  pool: Tank
state: ONLINE
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 repaired 0 in 0h0m with 0 errors on Tue Jan 31 23:28:55 2017
config:

		NAME									STATE	 READ WRITE CKSUM
		Tank									ONLINE	   0	 0	 0
		  mirror-0							  ONLINE	   0	 0	 0
			sdb2								ONLINE	   0	 0	 0
			sdc2								ONLINE	   0	 0	 0
		cache
		  71e7694f-e061-11e6-bd1f-3497f600ddaf  UNAVAIL	  0	 0	 0

errors: No known data errors

 

rs225

Guru
Joined
Jun 28, 2014
Messages
878
I think the command you were looking for is sudo zpool remove Tank 71e7694f-e061-11e6-bd1f-3497f600ddaf
 
Joined
Jan 1, 2017
Messages
1
Still haven't found a solution.

Sent from my SM-T377T using Tapatalk

You know you can actually do it right from Storage page in GUI. when you click on the device that's listed as missing in the Vdev tree it gives you a button to press called "Remove" If there are no other issues with your vdev then it should revert to green status prettty much right away. I have used this method before and it worked well fror me.
Here's before upload_2017-10-21_11-44-36.png
and then after:
upload_2017-10-21_11-46-54.png
 

dracu' gol

Cadet
Joined
Jun 7, 2013
Messages
1
zpool detach <pool> <device>
e.g. zpool detach Tank /dev/gptid/71e7694f-e061-11e6-bd1f-3497f600ddaf
 

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
I have a similar issue. I had a cache disc which I forgot to detach before reinstalling truenas and importing the pool.
zpool status Tank
pool: Tank
state: ONLINE
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: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-2Q
scan: scrub repaired 0B in 03:10:18 with 0 errors on Sat Feb 18 18:10:19 2023
config:

NAME STATE READ WRITE CKSUM
Tank ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
gptid/36ddbad9-5dad-11ed-aaf7-002590f5b83e ONLINE 0 0 0
gptid/36e7d0f8-5dad-11ed-aaf7-002590f5b83e ONLINE 0 0 0
gptid/36f1f4cb-5dad-11ed-aaf7-002590f5b83e ONLINE 0 0 0
gptid/36c586d1-5dad-11ed-aaf7-002590f5b83e ONLINE 0 0 0
gptid/36fc20e7-5dad-11ed-aaf7-002590f5b83e ONLINE 0 0 0
gptid/36d297a1-5dad-11ed-aaf7-002590f5b83e ONLINE 0 0 0
cache
sdi UNAVAIL 0 0 0 cannot open

I used the disk for a mirror boot pool. I can detach from the boot pool but not sure how can i add it back then property detach it from the pool.

Any clue?
Thank
 

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
my bad. I fixed it.
deleted from the pool UI options.
 
Top