LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Clearing fakeraid information from a hard drive (https://www.linuxquestions.org/questions/linux-hardware-18/clearing-fakeraid-information-from-a-hard-drive-661308/)

baprozeniuk 08-07-2008 09:45 PM

Clearing fakeraid information from a hard drive
 
Hello,

I have 4 hard drives that were previously in a fakeraid array on an Asus M2N-E in raid5. Because of this setup they now have fakeraid information somehow embedded into them.

I was wondering if it is possible to clear this information from the drives?

Fedora 8 keeps seeing an nvidia_ijifefdg array even after it has been removed from the system with nvidia chipset. The drives are now in a system with an Intel G33 based motherboard.

bigrigdriver 08-08-2008 10:58 AM

You could try using dd to overwrite the entire drive with /dev/null or /dev/zero. For example, let's say the drives are sda, sdb, sdc, and sdd. For each drive:
dd of=/dev/null if=/dev/sda
dd 0f=/dev/null if=/de/sdb
dd of=/dev/null if=/dev/sdc
dd 0f=/dev/null if=/dev/sdd

Or, /dev/null could be replaced with /dev/zero.

The dd command will overwrite the entire drive from MBR sector to the end, so you need to back up any information you want to keep.

baprozeniuk 08-08-2008 11:02 AM

I tried using dd already, except i used /dev/urandom and just ctrl+c'd it after about 30 seconds, i figured the data would be at the beginning of the disk. I supposed it could have been at the end though.

mostlyharmless 08-08-2008 05:05 PM

use dmraid; I believe it's dmraid -E, but check the man to be sure.

Edit: just looked it up; try dmraid -r first to identify the drive,
then dmraid -rE {device identified by dmraid -r} to erase the data

See http://linux.die.net/man/8/dmraid

archtoad6 08-09-2008 10:10 AM

I believe RAID info is at the end of the drive because the MBR is at the front.

While I completely recommend mostlyharmless' advice -- use the right tool; if you want to experiment w/ dd, then you will need to find out how big the RAID/fakeraid info is.


Here is a really brute force approach that I thought up, but didn't try. In fact, I wouldn't try it except as an experiment:

This is using an old 60 GB drive as the hypothetical target. I figure that zeroing the last cylinder will kill the RAID info w/o destroying too much data.
Code:

$ fdisk -l /dev/hda  | head -4

Disk /dev/hda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

$ DISK=/dev/hda
$ BS=8225280
$ SEEK=$((7297-1))
$ dd if=/dev/zero of=$DISK bs=$BS seek=$SEEK count=1

To repeat: I haven't tested this, I don't plan to test this -- use at your own risk.

If you know that you need to zero only the last sector, then a much safer, but more complicated, way would be to use the fdisk -l output to calculate the last sector:
Code:

## using the same fdisk info
$ DISK=/dev/hda
$ BS=512
$ SEEK=$((60022480896/512-1))
$ dd if=/dev/zero of=$DISK bs=$BS seek=$SEEK count=1

Additional Warning:
I did re-read the dd man page; but since I didn't try this, I can't be sure that my seeks aren't off by 1 because either dd or fdisk numbers from 0.

kenoshi 08-09-2008 06:48 PM

Couple of things you can do:

1. if devices are partitions, just delete the fd type partitions using fdisk
2. if devices are whole luns/drives, zero the last 128k of the drive with dd, that's where the raid superblock is

Hope this helps.


All times are GMT -5. The time now is 08:37 PM.