Re: RAID 1 | Changing HDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/09/2025 12:55, Stefanie Leisestreichler (Febas) wrote:
Hi.
I have the system layout shown below.

To avoid data loss, I want to change HDs which have about 46508 hours of up time.

I thought, instead of degrading, formatting, rebuilding and so on, I could
- shutdown the computer

Why degrade? There's no need.

But yes, unless you have hot-swap, you will need to shut down the computer at some point ... and I'd recommend at least one reboot...

First things first - do you have a spare SATA port on your mobo? Or (I wouldn't particularly recommend it) an external USB thingy to drop drives in? The latter will let you hot swap and avoid one reboot.

Okay. Plug your new drive in however. You will know which drives are your raid, so you just partition the third identically to the other two.

I'm surprised if your drives are MBR not GPT - MBR has been obsolete since almost forever nowadays :-) I think there's a GPT command that will copy the partitioning from a different drive. "man gdisk" or "man fdisk" - ignore stuff that says fdisk can't do GPT, it's long been upgraded.

Okay, now you have a 2-disk mirror and a spare. Add the spare as drive 3 (ie you need (a) to add it to the array as a spare and then (b) update the number of drives in the array to three.) You can do both in the same command.

Monitor /proc/mdstat, which will tell you the progress of the resync. Once you've got a fully functional 3-drive array, shut the computer down. Swap the new drive for the old one and reboot.

/proc/mdstat will now tell you you've got a degraded 3-drive array with one missing. fail and remove the missing drive, and you're now left with a fully functional 2-drive array again. And at no point has your data been at risk.

The removed drive is, as has already been said, a fully functional backup (which is why I would recommend only removing it when the system is shut down and you KNOW it's clean).

And I wouldn't recommend putting that drive back in the same computer, without wiping it first! I don't think it will do any damage, but in my experience, raid is likely to get thoroughly confused with a failed drive re-appearing, and it's simpler not to do it. If you want to get anything back off that drive, stick it in a different computer.


Google for "linux raid wiki". Ignore the crap about it being "obsolete" - the admins archived a site which was aimed at end users, and are referring people to the kernel documentation !!! Idiots !!! The two are aimed at completely different target markets!

(How big are your drives? If they're anything like modern, there's a very good chance they are GPT. Is the upper limit for MBR 2GB?)

Cheers,
Wol

- take i.e. /dev/sda and do
- dd bs=98304 conv=sync,noerror if=/dev/sda of=/dev/sdX (X standig for device name of new disk)

Is it save to do it this way, presuming the array is in AA-State?

Thanks,
Steffi

/dev/sda1:
           Magic : a92b4efc
         Version : 1.2
     Feature Map : 0x0
      Array UUID : 68c0c9ad:82ede879:2110f427:9f31c140
            Name : speernix15:0  (local to host speernix15)
   Creation Time : Sun Nov 30 19:15:35 2014
      Raid Level : raid1
    Raid Devices : 2

  Avail Dev Size : 1953260976 (931.39 GiB 1000.07 GB)
      Array Size : 976629568 (931.39 GiB 1000.07 GB)
   Used Dev Size : 1953259136 (931.39 GiB 1000.07 GB)
     Data Offset : 262144 sectors
    Super Offset : 8 sectors
    Unused Space : before=261864 sectors, after=1840 sectors
           State : active
     Device UUID : 5871292c:7fcfbd82:b0a28f1b:df7774f9

     Update Time : Thu Aug 28 01:00:03 2025
   Bad Block Log : 512 entries available at offset 264 sectors
        Checksum : b198f5d1 - correct
          Events : 38185

    Device Role : Active device 0
    Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
/dev/sdb1:
           Magic : a92b4efc
         Version : 1.2
     Feature Map : 0x0
      Array UUID : 68c0c9ad:82ede879:2110f427:9f31c140
            Name : speernix15:0  (local to host speernix15)
   Creation Time : Sun Nov 30 19:15:35 2014
      Raid Level : raid1
    Raid Devices : 2

  Avail Dev Size : 1953260976 (931.39 GiB 1000.07 GB)
      Array Size : 976629568 (931.39 GiB 1000.07 GB)
   Used Dev Size : 1953259136 (931.39 GiB 1000.07 GB)
     Data Offset : 262144 sectors
    Super Offset : 8 sectors
    Unused Space : before=261864 sectors, after=1840 sectors
           State : active
     Device UUID : 4bbfbe7a:457829a5:dd9d2e3c:15818bca

     Update Time : Thu Aug 28 01:00:03 2025
   Bad Block Log : 512 entries available at offset 264 sectors
        Checksum : 144ff0ef - correct
          Events : 38185








[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux