D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Reformatting previous RAID volumes

 

On 10/10/17 14:06, Julian Hall wrote:
> Hi All,
> 
> After my recent aggravation with HDs failing in my NAS I have ended up
> with two functional HDs - one 1Tb and one 2Tb - which are individual
> RAID 1 volumes. So I thought I would reformat them as EXT4 to use as
> external storage. However, gparted managed to remove the partitions but
> still insisted that both were RAID volumes so wouldn't format them. I
> passed them to a friend to see if he could do anything and after some
> searching online he came up with this:
> 
> sudo mdadm /dev/md127 --fail detached --remove detached
> 
> I thought I would pass it on in case anyone else encounters this issue.
> Probably rare but at least the information is out there.

You could have just nuked the disks and used any partitioning tool to
write out a new disk label to them - I suspect this was just your
Ubuntu/Mint/whatever system being a bit thick about doing what was
necessary. In the gparted GUI you could have chosen "Device > Create
Partition Table" and going with either MSDOS (bad) or GPT (good) would
have blanked out the disk and let you start creating new partitions.

Old trick is just to "sudo dd if=/dev/zero of=/dev/sdX bs=1M count=Y"
where sdX is your disk and Y equals as many sequential MB from the start
of the disk you want to overwrite with zeroes - this destroys the
partition tables at the start of the disk and renders them effectively
unreadable to partitioning programs (except specialist partition
recovery tools such as testdisk etc) and operating systems from then on,
meaning that they will be presented as disks full of random noise and
not functional LVM, RAID or anything else to be preserved. Basically
it's a shortcut to wiping weird disk allocations quickly so you can
reuse them easily without your OS trying to be too smart and
"protecting" you from yourself.

The opposite trick (not really valid anymore for GPT which is a more
advanced and mutable disk format *and* which keeps a backup GPT
signature and partition table at the end of the disk as well) for MSDOS
format disks was always "sudo dd if=/dev/sdX of=~/my.sdX.MBR.backup
bs=512 count=1" which dumps out the critically important partition table
and MBR bits to a single backup file. Saved me many times back in the
bad old days when writing LILO or GRUBv1 boot information to your system
disk was a dangerous proposition, or if your finger/brain oopsied during
a fdisk operation...

So after all your trials what was the end result? It sounds like you've
now got *two* NAS units and a bunch of extra disks to hand. At least
you'll be sorted out for backups now I guess? Do you even trust that
first NAS unit anymore?

Cheers

-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq