JP Vossen via plug on 28 Oct 2022 14:48:24 -0700


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

Re: [PLUG] RAID1 impending failure questions


On 10/28/22 08:45, Walt Mankowski via plug wrote:
Hi everyone,

I woke up this morning to an alert that one of the drives in a RAID
array is likely to fail soon. I set this array up nearly 6 years ago
so it seems about the time that things might start failing. This is my
first RAID array so I've got a few questions I hope someone can help
me with.

First of all, it's a RAID1 array with two 4 TB drives. It's just used
for data, and isn't the boot drive. It's still working, but who knows
for how long. I'll stop by Micro Center this weekend and pick up 2 new
4 TB drives, on the assumption that the other drive might be ready to
fail soon too.
...

I scripted this long ago: https://github.com/vossenjp/utils/blob/main/replace_mirrored_disk

All the usual disclaimers!!!  And other disclaimer: I wrote this in 2010 so there may be better ways to do things now that I'm not doing.

That said, variations on that script have...wait for it..."Worked For Me" for at least 4 machines for about a decade, where the drives *are* the boot and OS drive.  I have `mdadm` RAID-1 in all cases when the physical form factor supports 2 drives, and I've encountered this "one drive went bad" a bunch of times.  I've even done this with my (non IT) cousin as remote warm hands on Mom's server in NJ.

I love that once you replace the hardware and reboot, the mirror rebuild happens live as the system is running.  The only downtime is basically the reboot to replace the hardware.  And depending on your hardware, even that might be optional these days.  For 6yo stuff I doubt it though.  :-)

Huh, yeah, SVN first commit:
```
r1680 | root | 2010-04-14 23:59:53 -0400 (Wed, 14 Apr 2010) | 3 lines

# replace_mirrored_disk--Replace a failed disk in a Linux software mirror
* Tweaked slightly since tested!
```

And it hasn't had a substantive change since around 2013.

Worst case, you can use the code as a command cheat sheet.

Good luck!
JP
--  -------------------------------------------------------------------
JP Vossen, CISSP | http://www.jpsdomain.org/ | http://bashcookbook.com/
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug