After detaching a removed drive, cannot wipe drive

Status
Not open for further replies.

FFF

Dabbler
Joined
Mar 10, 2017
Messages
28
I had an active drive get removed from an encrypted RAIDZ3 pool. This resulted in one of the hot spares automatically being placed "IN USE" and resilvered. I then "DETACHED" the "REMOVED" drive and found the resulting drive now shows up in the "View Disks" section of storage. I'm told the proper way to get the drive back into the pool is to wipe it and then re-add it as a hot spare to replace the spare that is now being used by a vdev. However, attempts to wipe the drive are failing both in the UI & in the CLI with "operation not permitted errors"

UI message when trying to wipe disk: dd: /dev/da34: Operation not permitted
^same message displayed when trying to dd if=/dev/zero of=/dev/da34 on CLI
 
D

dlavigne

Guest
Which build version of FreeNAS (from System -> Information)?

Anything related in /var/log/messages?

Also, what's the current output of zpool list?
 

FFF

Dabbler
Joined
Mar 10, 2017
Messages
28
Version: FreeNAS-9.10.2-U1 (86c7ef5)
zpool list:
Code:
NAME		   SIZE  ALLOC   FREE  EXPANDSZ   FRAG	CAP  DEDUP  HEALTH  ALTROOT
RAIDZ3-01	  152T   125G   151T		 -	 0%	 0%  1.00x  ONLINE  /mnt
freenas-boot  29.8G   661M  29.1G		 -	  -	 2%  1.00x  ONLINE  -

Meanwhile, I found a way around this thanks to https://forums.freenas.org/index.php?threads/unable-to-gpt-format-the-disk.49362/page-2 which linked to https://forums.freenas.org/index.php?threads/operation-not-permitted-hdd-trouble.12208/#post-57090

Temporarily updating sysctl kern.geom.debugflags=0x10 allowed me to dd the device via the CLI or wipe it via the UI.

However, after this my attempts to extend the volume by adding this drive back in as a spare with a different error about not being able to partition /dev/multipath/disk11

From the logs:
/var/log/debug.log
Code:
Apr 13 02:17:47 freenas manage.py: [middleware.notifier:204] Executed: swapoff -a -> 0
Apr 13 02:17:47 freenas manage.py: [middleware.notifier:187] Executing: dd if=/dev/zero of=/dev/multipath/disk11 bs=1m count=32


/var/log/daemon.log
Code:
Apr 13 02:17:47 freenas notifier: dd: /dev/multipath/disk11: Operation not permitted


/var/log/debug.log
Code:
Apr 13 02:17:47 freenas manage.py: [middleware.notifier:204] Executed: dd if=/dev/zero of=/dev/multipath/disk11 bs=1m count=32 -> 0
Apr 13 02:17:47 freenas manage.py: [middleware.notifier:230] Popen()ing: diskinfo multipath/disk11
Apr 13 02:17:47 freenas manage.py: [middleware.notifier:187] Executing: dd if=/dev/zero of=/dev/multipath/disk11 bs=1m oseek=7630853


/var/log/daemon.log
Code:
Apr 13 02:17:47 freenas notifier: dd: /dev/multipath/disk11: Operation not permitted


/var/log/debug.log
Code:
Apr 13 02:17:47 freenas manage.py: [middleware.notifier:204] Executed: dd if=/dev/zero of=/dev/multipath/disk11 bs=1m oseek=7630853 -> 0
Apr 13 02:17:47 freenas manage.py: [middleware.notifier:230] Popen()ing: gpart create -s gpt /dev/multipath/disk11
Apr 13 02:17:48 freenas manage.py: [middleware.notifier:230] Popen()ing: /sbin/zfs get -r -H -o name,property,value,source -t filesystem,volume compression,compressratio,readonly,org.freenas:description

Another thing to note is the system calls swapoff -a first & then tries to partition the drive. It doesn't appear to ever issue swapon -a when the partitioning fails so the system ends up having no swap after the operation fails.

I also find a strangely persistent entry in swapinfo that is one of the paths to disk11:
Code:
Device		  1K-blocks	 Used	Avail Capacity
/dev/da10		16777216		0 16777216	 0%

Attempts to get rid of this also fail:
Code:
swapoff: /dev/da10: Invalid argument

I'm wondering if this is the reason it cannot partition disk11 - because it still thinks da10 is in use for swap.
 
Last edited by a moderator:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
can you put the disk in another system and just wipe it. There should also be a wipe button in the gui, have you tried that?
 

FFF

Dabbler
Joined
Mar 10, 2017
Messages
28
The drive has been wiped using the FreeNAS UI - which only worked after the sysctl debug flag was set
 
Status
Not open for further replies.
Top