Recycle disks

Status
Not open for further replies.

elangley

Contributor
Joined
Jun 4, 2012
Messages
109
In my lab I had created a zfs pool and then tore down the machine without removing the disks from the pool.

Now the disks are 'locked' and I cannot find out how to clear them out so they can be reused. I have tried wiping in FreeNAS, formatting on Windows, diskpart clean, etc. but none of it is working.

Any help would be appreciated.

~eric
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
You tried Gparted or even Minitool Partition Wizard? I prefer GParted. If memory serves me correctly there is data at both the beginning and end of the hard drive that must be written over with zeros. Tjat could be done with dd but I don't recall the areas specifically. The answer it in these forums from way back a few years ago. That may also help. Or a complete wipe of the drives which does take longer of course.
 

Erwin

Dabbler
Joined
Sep 21, 2011
Messages
30
Hi eric,
I had the same issue some days ago. I tried to replace a failed drive in a zpool by a used disk coming from a former RAID. The FreeNAS GUI failed with an error message like this "MiddelwareError...unable to GPT format...blabla...operation not permitted"
The final reason was that certain data still resided on the spare disk.
You can overwrite this e.g. by a dd command, but you first have to allow this by setting a system variable (valid until the next reboot):

[root@Replica-NAS] ~# dd if=/dev/zero of=/dev/ada2 bs=1m count=1
dd: /dev/ada2: Operation not permitted
[root@Replica-NAS] ~# sysctl kern.geom.debugflags=0x10
kern.geom.debugflags: 0 -> 16
[root@Replica-NAS] ~# dd if=/dev/zero of=/dev/ada2 bs=1m count=1
1+0 records in
1+0 records out
1048576 bytes transferred in 0.007389 secs (141909090 bytes/sec)
[root@Replica-NAS] ~# dd if=/dev/zero of=/dev/ada2 bs=1m oseek=`diskinfo ada2 | awk '{print int($3 / (1024*1024)) - 4;}'`
dd: /dev/ada2: short write on character device
dd: /dev/ada2: end of device
5+0 records in
4+1 records out
4284416 bytes transferred in 0.451435 secs (9490658 bytes/sec)
[root@Replica-NAS] ~#

In my case, the replacement disk was attached as /dev/ada2
After this, the GUI workflow for replacement worked without problems.

br
e
 
Status
Not open for further replies.
Top