V
V
vlarkanov2018-08-06 09:34:47
Debian
vlarkanov, 2018-08-06 09:34:47

How to take drives out of mdadm RAID1 one by one and put them back in again without losing power-down data?

There is a SuperMicro server, OS Debian 9.5. It runs Postgresql on a soft RAID1 of two Intel S3700 SSDs:

md1 : active raid1 sdd1[1] sdc1[0]
937560064 blocks super 1.2 [2/2] [UU]
bitmap: 5/7 pages [20KB], 65536KB chunk

You need to install adapters 3.5 "-> 2.5" (now the SSD is just plugged into the slots, not fixed). Accordingly, you need to pull the disks out of the server one at a time, screw them into the basket and install them back.
How to do it "hot", without stopping the server?
UPD: just get one of the disks, then return it back. Wait for array synchronization. Repeat with the second disc. Of course, after making a backup (I also have a slave).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2018-08-06
@vlarkanov

Raise a replica somewhere nearby. Because disk operations are always dangerous.
check with dmesg that there are no anomalies.
mdadm /dev/md1 -f /dev/sda
mdadm /dev/md1 -r /dev/sda
echo 1 > /sys/block/sda/device/delete
check dmesg
disconnect the disk physically. If you confuse it will be very bad.
stick it where you need it, check by dmesg that the system saw it normally
mdadm /dev/md1 -a /dev/sda
and wait for /proc/mdstat synchronization. Then repeat with the second disc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question