:: Re: [DNG] still trying to wiping di…
Top Page
Delete this message
Reply to this message
Author: Simon
Date:  
To: Devuan ML
Subject: Re: [DNG] still trying to wiping disconnected Raid components
jeremy ardley via Dng <dng@???> wrote:
>
>
> On 4/5/23 09:38, Hendrik Boom wrote:
>> I have a hard drive, that's been disconnected to its computer or over a year now for harware connection reasone.
>> It contains a RAID parttion that use to part of a RAID1 device on that machine.
>> Now I want to put it back into its machine, so it can once more fuction as part of the RAID it used to be part of.
>>
>> But I absolutel don't want any of the data on it to be treated as valid, because it is massively out of date.
>>
>> But it still has a perfectly valid RAID signature indicating it is part of the RAID it used to be ann active part ot, I am terrified that, after I put the drive back into its machine, the automatic RAID assembly on boot will pick it instaed of the current, up-to-date one as the valid version, and thus lose over a year's data.
>>
>> **What do I have to do to make sure it is *no longer recognised as part of its RAID*
>>
>> so that I can boot with the up-to-date OS (and not the ancient one) and properly use mdadm to add it safely as a new RAID component?
>>
>> All the instructions I've found online an in man pages don't tell me how to remove it from a RAID without it already having been assembled into the RAID. amd that is precisely what I want t prevent from happening prematurely.
>


> Disconnect the other drives in the RAID and connect the unwanted drive. Then boot the system using a USB or DVD live system to run a tool to reformat the single drive.
> This assumes you don't have a hardware RAID controller.
>
> An alternative approach is to use a HDD Caddy and connect using USB.
>
> In all cases a simple dd command will remove traces of the RAID
>
> dd if=/dev/zero of=/dev/<yourdrive> bs=10M


That’s the brute force method - and also the easiest to remember ;-)

What will happen if you boot with both drives connected (or connect the old drive later) is that the system will NOT assemble them into an array. Each member of an array contains a serial number (for want of a better term) which is updated when the array is updated. When one drive is removed, it will stop getting updates, and md raid will warn that there are differing serial numbers.
Where there is still a risk is that if you boot with both drives present, depending on your system setup, the system may not choose the right one to use - so it’s safer to connect it after boot.

There is also an madam command to remove the superblocks (called something like erase_superblock from dim vague memory). This will have the same effect in marking the drive/partition as no longer part of an array, but without the time consuming need to write a load of zeroes (and for an SSD, using up a write cycle).

Once you’ve done that, you can then re-add it to an array and it will be rebuilt from the newer data on the other drive.

Going back a few work hats, I’d have given my eye teeth for the raid controllers I used back then to have half the functionality MDraid does !

Simon