Answer the question
In order to leave comments, you need to log in
How to recreate RAID1 without data loss?
Hello connoisseurs! Can you please tell me if it is possible to restore RAID1 without losing data? The situation is this, half a year ago there was a reboot, and apparently then the raid collapsed. Noticed just now. The sdA drive remained active, but this is what lsblk and /proc/mdstat now show:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 500M 0 part /boot
├─sda3 8:3 0 7.8G 0 part [SWAP]
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 923.2G 0 part /
sdb 8:16 0 931.5G 0 disk
├─sdb1 8:17 0 976M 0 part
│ └─md0 9:0 0 975.4M 0 raid1
├─sdb2 8:18 0 7.5G 0 part
│ └─md1 9:1 0 7.5G 0 raid1
└─sdb3 8:19 0 923.1G 0 part
└─md2 9:2 0 922.8G 0 raid1
cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1]
998848 blocks super 1.2 [2/1] [_U]
md2 : active raid1 sdb3[1]
967629824 blocks super 1.2 [2/1] [_U]
bitmap: 0/8 pages [0KB], 65536KB chunk
md1 : active raid1 sdb2[1]
7831552 blocks super 1.2 [2/1] [_U]
unused devices: <none>
Answer the question
In order to leave comments, you need to log in
No need to remove, just need to carefully replace the drive in the array.
a bunch of articles
, so I wrote about 6 years ago
, I don’t think that everything has changed there.
https://klondike-studio.ru/blog/raid-recovery/
If I understood correctly from all the comments and discussion of the problem, then you now have working data on /dev/sda which is mounted and in use, and there is also a raid1 from a single disk /dev/sdb which just exists.
As I understand it, for good, you need to delete the current md0-2 and recreate the raid, but is it possible to do this without losing data? To synchronize sdA -> sdB? Thanks a lot.
sfdisk -d /dev/sdb | sfdisk /dev/sda
) /usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question