:: Re: [DNG] defective RAID
Pàgina inicial
Delete this message
Reply to this message
Autor: Adam Borowski
Data:  
A: dng
Assumpte: Re: [DNG] defective RAID
On Mon, Mar 27, 2017 at 08:20:39PM -0400, Hendrik Boom wrote:
> On Mon, Mar 27, 2017 at 08:06:15PM +0200, karl@??? wrote:
> > Boot with the disk with the newest version of /boot, connect/power up
> > your disk with the older version of /boot, then add the old partition
> > to your md-raid mirror. The "old" partition will be automatically
> > updated. Didn't that work ?
>
> Is it really safe to hotplug a SATA disk?


Yes, SATA is specifically designed for that.

> Will Devuan recognise it prperly when I do that?


Not only that, but you can also disregard most of the advice in this thread
and _not_ zero out signatures on the old disk nor "mdadm -r" the slot. MD
RAID is smart enough for that; if it doesn't start the resync automatically
you'll have to "mdadm --re-add" but it does have information about how stale
the old data is, massively reducing the time needed for resync.

When done the naive way (only possibility for a new disk or with slot
dropped), every single sector will need to be read and written, which on a
modern-sized piece of spinning rust takes ages. The RAID has a write-intent
bitmap that marks parts of the disk that have been written to some but not
yet all member devices. In your case, the bitmap keeps accumulating[1], but
on any typical filesystem load it won't reach all-ones even after many
months of degraded use.

The write-intent bitmap is not mandatory, and it might be for some reason
unfit for use. In such case the RAID will silently fall back to a
whole-device resync.


Such things are far more fun on btrfs RAID -- it not only knows to avoid
resyncing empty space[2], can detect and repair silent read errors, but also
can cope with _both_ disks having been mounted in the meantime and having
different data written to them. But then, at this point I would recommend
_not_ using btrfs RAID unless you know what you're doing. Stick to a single
device (which might be MD or HW RAID itself...).


Meow!

[1]. Which is also a reason you want to turn a [U_] RAID to [U] if the other
disk is not going to ever come back, and the replacement has yet to arrive.

[2]. That's impossible on MD as it presents only a dumb block device to the
filesystem above it, and thus has no knowledge about what is and what is not
used.
--
⢀⣴⠾⠻⢶⣦⠀ Meow!
⣾⠁⢠⠒⠀⣿⡁
⢿⡄⠘⠷⠚⠋⠀ Collisions shmolisions, let's see them find a collision or second
⠈⠳⣄⠀⠀⠀⠀ preimage for double rot13!