How to safely remove a disk

Status
Not open for further replies.

wtbdeath

Cadet
Joined
Dec 21, 2014
Messages
8
I have a zpool with single disk, which is a back up for a raid-2Z pool, the reason for a single disk pool is it is off site backup which I need to remove it after manually resync from the raid-2z, single disk is just easier to carry around.

Now the question is, since it is single disk, it seems I can't gracefully remove it. It is a hotswap drive but I want to maybe unmount the zpool first then remove it rather than just pull it out?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I prefer to pull it out. Ok, ok. I kid.

Single-disk, while supported, really isn't part of the recommend implementation for FreeNAS and ZFS. Even the CTO of iXsystems has said something like "ZOMG why ever do single-disk with ZFS". You should be able to unmount the pool and then eject it. If there are errors when doing it that way, especially warnings about swap space, I'd not do it that way (do a shutdown to remove the drive) and put in a ticket to have this added.
 

wtbdeath

Cadet
Joined
Dec 21, 2014
Messages
8
Thanks for the reply. I guess the question actually holds true for a raid-2z zpool, how to safely remove it while server is running. The problem here is I am backing up /replicating to another zpool on same file server, and at the end of backup, I need somehow take the drives with me without bring down that file server. Ok, I can bring down the server and pull the drives out and restart it as my wish but it is not elegent enough.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah. I'd do what I said above. Try it and if you get "zomg swap errors" from the OS then do a shutdown to pull the drive but put in a ticket to have this feature 'added'.

If you want to be 100% sure the swapspace isn't being used on that drive you should be able detach the pool and then run the command 'swapctl -l' and see if the disk is listed. If not, then it's not used. Here's what mine says here at home:

Code:
 ~# swapctl -l
Device:  1024-blocks  Used:
/dev/da4p1.eli  2097152  6044
/dev/da7p1.eli  2097152  6392
/dev/da8p1.eli  2097152  6216
/dev/da9p1.eli  2097152  9020
/dev/da6p1.eli  2097152  11664
/dev/da5p1.eli  2097152  12148
/dev/da0p1.eli  2097152  11712
/dev/da1p1.eli  2097152  12312
/dev/da2p1.eli  2097152  12124
/dev/da3p1.eli  2097152  12296
/dev/da10p1.eli  2097152  12304
/dev/da11p1.eli  2097152  11816
/dev/da12p1.eli  2097152  12360
/dev/da13p1.eli  2097152  6164
/dev/da14p1.eli  2097152  6084
/dev/da15p1.eli  2097152  6108
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
And if you want to stop using one the command is 'swapoff'. Like this...
Code:
# swapctl -l
Device:  1024-blocks  Used:
/dev/da4p1.eli  2097152  6044
/dev/da7p1.eli  2097152  6392
/dev/da8p1.eli  2097152  6216
/dev/da9p1.eli  2097152  9020
/dev/da6p1.eli  2097152  11664
/dev/da5p1.eli  2097152  12148
/dev/da0p1.eli  2097152  11712
/dev/da1p1.eli  2097152  12312
/dev/da2p1.eli  2097152  12124
/dev/da3p1.eli  2097152  12296
/dev/da10p1.eli  2097152  12304
/dev/da11p1.eli  2097152  11816
/dev/da12p1.eli  2097152  12360
/dev/da13p1.eli  2097152  6164
/dev/da14p1.eli  2097152  6084
/dev/da15p1.eli  2097152  6108
# swapoff /dev/da10p1.eli
# swapctl -l
Device:  1024-blocks  Used:
/dev/da4p1.eli  2097152  6044
/dev/da7p1.eli  2097152  6392
/dev/da8p1.eli  2097152  6216
/dev/da9p1.eli  2097152  9020
/dev/da6p1.eli  2097152  11664
/dev/da5p1.eli  2097152  12148
/dev/da0p1.eli  2097152  11712
/dev/da1p1.eli  2097152  12312
/dev/da2p1.eli  2097152  12124
/dev/da3p1.eli  2097152  12296
/dev/da11p1.eli  2097152  11816
/dev/da12p1.eli  2097152  12360
/dev/da13p1.eli  2097152  6164
/dev/da14p1.eli  2097152  6084
/dev/da15p1.eli  2097152  6108


See how easy? ;)
 
Status
Not open for further replies.
Top