can't wipe drive - "Operation not permitted"

bwanajag

Dabbler
Joined
Feb 23, 2020
Messages
10
I moved 4 drives from a Synology NAS that died into a newly built freenas box but am unable to wipe the drives to create a pool. I get the following error when I run the wipe command
Code:
[EFAULT] Command dd if=/dev/zero of=/dev/ada2p2 bs=1m count=32 failed (code 1): dd: /dev/ada2p2: Operation not permitted

I've searched and found many discussions about with a dozen varieties of dd commands but there doesn't seem to be a definitive solution. Is there any freenas instruction on how to wipe a drive from the shell when using disks that have previously been used? Thanks
 

hervon

Patron
Joined
Apr 23, 2012
Messages
353
Do you really have to wipe the drives before creating a pool ?
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
If everything else fails, create a boot CD/USB and use GParted live.
 

bwanajag

Dabbler
Joined
Feb 23, 2020
Messages
10
The first thing I tried was to create a pool, that's when I received the first errors. Then I tried to wipe each drive, which gave the same errors, which prompted the searching. Thanks for the GParted option, didn't think about that. I ended up following the option discussed here and it worked. The process that worked for me was to run the following commands...

Code:
sysctl kern.geom.debugflags=0x10

dd if=/dev/zero of=/dev/ada2 bs=1m count=1

dd if=/dev/zero of=/dev/ada2 bs=1m oseek=`diskinfo ada2 | awk '{print int($3 / (1024*1024)) - 4;}'`


...I need to run the dd commands for each of the 4 disks, then I shut the box down, restarted, and was able to wipe the drives and create the pool.
 

dspeed

Cadet
Joined
Jun 8, 2022
Messages
7
The first thing I tried was to create a pool, that's when I received the first errors. Then I tried to wipe each drive, which gave the same errors, which prompted the searching. Thanks for the GParted option, didn't think about that. I ended up following the option discussed here and it worked. The process that worked for me was to run the following commands...

Code:
sysctl kern.geom.debugflags=0x10

dd if=/dev/zero of=/dev/ada2 bs=1m count=1

dd if=/dev/zero of=/dev/ada2 bs=1m oseek=`diskinfo ada2 | awk '{print int($3 / (1024*1024)) - 4;}'`


...I need to run the dd commands for each of the 4 disks, then I shut the box down, restarted, and was able to wipe the drives and create the pool.
This worked for me today!

Thanks!
 

peakrock

Cadet
Joined
Nov 1, 2022
Messages
1
I'm a newbie to TrueNAS and I was having problems reusing 3 x 1TB drives from a Windows Server. Even though I'd erased and formatted them on Windows I could only "wipe" one of them when trying to create a Storage Pool on TrueNAS. I tried wiping the disks individually but it failed again so I used GParted to create a new partition table on each of the disks and could then create a storage pool no problem, so thanks to this thread and a similar one I found elsewhere recommending GParted.
 
Top