Solved Reformatting a HDD that was used as a member of a RAID array

I guys, hope you can help me. I have a HDD which was previously in a RAID array. Now I wanna used it alone as Master (IDE hdd)...

For now I managed to switch it from CABLE SELECT to Master and BIOS is showing it up in list of device.

I'm using lastest FreeBSD usb bootable to try to format this drive.

When using Install feature I get a Operation not allowed or something like that when trying to create the partition.

When booting to "live cd" i get root acces to a shell and I tryed gpart delete which seem useless since there is no partition detected on ada0.

I also tryed "gpart destroy /dev/ada0" which lead to Invalid argument on 'ada0'

I do not have acces to RAID controler / other hdd member of the array.... How do I get rid of the raid array on that drive ??

thanks in advance
it give me "operation not permitted" looks like the drive is read only and I dont understand why
My first thought is make sure it is not mounted.

You tried dd from the memstick installer LiveCD mode and it failed?
Tried forcing things? # gpart destroy -F ada0? You don't need the whole /dev specification since gpart expects a geom.

Maybe also interesting to try: gpart status and gpart list.
I also see talk of switching jumpers on the drive.
That would mean it is a IDE drive. Are you sure you got the jumpers right?
Sorry, but the original post is unclear and hard to understand.

First: What connection technology does the disk drive use? SATA, or PATA (also known as parallel IDE, with a 40-pin cable)? The talk about "master" and "cable-select" seems to indicate PATA. What controller is the disk using? Is that controller configured for RAID, for individual drives, or something in-between (some RAID controllers have a "JBOD" mode that exposes individual non-RAIDed drives). How is that controller configured?

For lack of details, we can not debug "operation not allowed or something". To debug, we need more information. To begin with, please the output of ls -l on /dev/adaXXX, to see that the permissions are even correct. Then a simple test of reading the drive with dd (for example dd if=/dev/adaXXX of=/dev/null bs=512 count=1024), and the error output from that. Then the output from gpart show adaXXX, and the output of "mount", to make sure no file system is on there. But most likely the real problem is in the RAID controller and device driver, and the "disk device" (the /dev/adaXXX special file) is not working well enough for the normal FreeBSD tools like gpart to function.
Last edited by a moderator:
Currently I'm trying to access this IDE drive (PATA) with the mainboard IDE controller which do NOT have RAID capacity.

root@:~ # mount
/dev/ufs/FreeBSD_Install on / (ufs, local, noatime, read-only)
devfs on /dev (devfs, local, multilabel)
/dev/md0 on /var (ufs, local)
/dev/md1 on /tmp (ufs, local)
root@:~ # ls -l /dev/ada0
crw-r----- 1 root operator 0x66 Aug 24 23:01 /dev/ada0

Looks like it is not mounted but read-only so I tryed this

root@:~ # chmod a+w /dev/ada0
root@:~ # ls -l /dev/ada0
crw-rw--w- 1 root operator 0x66 Aug 24 23:01 /dev/ada0

At this point my guess is that dd will work...

root@:~ # dd if=/dev/ada0 of=/dev/null bs=512 count=1024
1024+0 records in
1024+0 records out
524288 bytes transferred in 0.106629 secs (4916953 bytes/sec)

It does.... so I try erasing the drive header

root@:~ # dd if=/dev/zero of=/dev/ada0 bs=1m count=128
dd: /dev/ada0: Operation not permitted

still same problem
well I just wanted to get a read instruction on that drive to test it which looks to work

Now I'm stuck to that "Operation not permitted" in the write process which is required before fdisk can write to it as long as I know
What caused the disk device /dev/ada0 to become readonly? That means the automatic device discovery (done by the kernel) found the disk on the motherboard PATA bus, and created the /dev/ada0 device entry. But then it decided that the disk is not writeable, so it set the permissions accordingly. You overrode the permissions, but that doesn't fix the underlying cause that makes the driver unwritable. From this viewpoint, the dd stuff all makes sense.

Why is the actual disk unwritable? No idea. Look in the dmesg output for when the drive was discovered and the /dev/ada0 created, maybe there is a hint there.

Another question is: What is the content of the drive? Clearly, it has no MBR or GPT geometry (the output from gpart tells us that). But what does it have? Suggestion: do hexdump -C /dev/ada0 | more, and look at the first few dozen or hundred lines, to see what type of header or partition table is on there.

Some old PATA drives had a read-only jumper, but that was decades ago. Maybe check the documentation for your drive.
My guess is that this was one of those horrible motherboard RAID devices. FreeBSD supports those, even when a different motherboard is used.

If you don't destroy the RAID but just try to reuse the drives, the old metadata is still on them, and seen by FreeBSD.

Use graid list to see the device, although that might not work with a broken RAID.

Does that show anything? There is another way to do this, but I want to avoid that if possible, because it is a blunt hammer that is used far too often.

Could you please also provide the output from:
1. diskinfo -v /dev/ada0

2. camcontrol devlist

3. atacontrol list

I'm not sure if camcontrol is applicable for IDE drives, but if it's not you can play around with the equivalent commands of atacontrol.

Please try camcontrol start, stop, eject, rescan, reinit the device /dev/ada0. You can find the syntax in the manpage of camcontrol camcontrol(8)
Please watch the hardware log (dmesg) and try to identify if other devices are being initiated or removed during turning on/off the disk using camcontrol.

Also I would check the BIOS and make sure all the disk configuration is set to native IDE and there's no RAID setup enabled.

iddqd, idkfa!
Ok let see ... jumper are ok since it is alone I have no jumper on it and according to the jumper setup schema it is ok.

BIOS SATA controller is Disabled
BIOS IDE controller as no raid capacity

Now I gave hexdump a try and it look to have a FreeBSD previously installed on it which make sence but I came thru "Invalid partition table" / "Error loading operating system" / "Missing operating system" in the first hexdump page. After that I found some /usr/ and freeBSD like path.

Still no hint about why it is readonly.

So here is graid list

root@:~ # graid list
Geom name: Promise
Metadata: Promise
1. Name: raid/r0
Mediasize: 250059292672 (233G)
Sectorsize: 512
Stripesize: 65536
Stripeoffset: 0
Mode: r0w0e0
Subdisks: ada0 (ACTIVE)
Dirty: no
Strip: 65536
Components: 1
Transformation: CONCAT
Label: PROMISE Array 1
descr: Promise RAID0 volume
1. Name: ada0
Mediasize : 250059292672 (233G)
Sectorsize: 512
Mode: r1w1e1
ReadErrors: 0
Subdisks: r0(PROMISE Array 1):0@1664390124592431104

Looks like the old raid controller (Promise Fastrak TX4000) is still discovered as the provider but it is not installed in this PC... well now How do I get write access to this drive... ??

root@:~ # diskinfo -v /dev/ada0
512 # sectorsize
250059350016 # mediasize in bytes (233G)
488397168 # mediasize in sectors
0 # stripesize
0 # stripeoffset
484521 # Cylinders according to firmware.
16 # Head according to firmware.
63 # Sectors according to firmware.
WD-WMAEP3018173 # Disk ident.
Not_Zoned # Zone Mode

root@:~ # camcontrol devlist
<WDC WD2500JB-00FUA0 15.05R15> at scbus0 target 0 lun 0 (ada0,pass0)
<Kingston DataTraveler 2.0 PMAP> at scbus2 target 0 lun 0 (da0,pass1)
root@:~ # atacontrol list
atacontrol: Command not found

I'll try to manage a way to get dmesg up here later and thanks for help
dmesg line about ada0

ada0 at ata0 bus 0 scbus0 target 0 lun 0
ada0: <WDC WD2500JB-00FUA0 15.05R15> ATA-6 device
ada0: Serial Number WD-WMAEP3018173
ada0: 100.000MB/s tranfers (UDMA5, PIO 8192bytes)
ada0: 238475MB (488397168 512 byte sectors)
GEOM_RAID: Promise: Array Promise created.
GEOM_RAID: Promise: Disk ada0 state changed from NONE to ACTIVE.
GEOM_RAID: Promise: Subdisk PROMISE Array 1:0-ada0 state changed from NONE to ACTIVE.
GEOM_RAID: Promise: Volume started.
GEOM_RAID: Promise: Volume PROMISE Array 1 state changed from STARTING to OPTIMAL.
Root mount wainting for: GRAID usbus4 usbus3 usbus2 usbus1 usbus0
GEOM_RAID: Promise: Provider raid/r0 for volume PROMISE Array 1 created.

Thats What I found in there...
root@:~ # graid delete raid/r0
GEOM_RAID: Promise: Volume PROMISE Array 1 state changed from OPTIMAL TO STOPPED.
GEOM_RAID: Promise: Provider raid/r0 for volume PROMISE Array 1 destroyed.
GEOM_RAID: Promise: Array Promise destroyed.
GEOM_PART: integrity check failed (ada0, MBR)
GEOM_PART: integrity check failed (diskid/DISK-WD-WMAEP3018173, MBR)

Looks like it destroyed successfully the raid array...... now let see ada0 read/write access

root@:~ # ls -l /dev/ada0
crw-r----- 1 root operator 0x66 Aug 27 17:52 /dev/ada0

Trying a dd again...

root@:~ # dd if=/dev/zero of=/dev/ada0 bs=1m count=1024
1024+0 records in
1024+0 records out
1073741824 bytes transfererred in 18.477481 secs (58110833 bytes/sec)

Woot !! it worked

root@:~ # gpart destroy -F /dev/ada0
ada0 destroyed

Yay !

root@:~ # gpart status
Name Status Components
ada0s1 OK ada0

ok I'll try rebooting and using Install Mode...

Yay it work I cna format the drive ;)

Thx all