You are not logged in.
I've set up two hard drives in RAID 1. I want to know how to recover data from them if anything goes wrong with one of the drives.
I've tried to start the raid with
sudo mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sdc missing
But that doesn't seem to work.
How can you check data on one of the RAID devices? I guess this must be possible since RAID 1 is just a mirror of the data.
Thanks.
Last edited by TheChosenOne (2017-01-08 15:56:02)
Offline
When one of the drives fails, you remove it from the array, stick a new drive in and resync and away you go. That is the whole point of running RAID.
The procedure I use:
# identify broken drive
hdparm -i /dev/sdx
# removing and replacing a faulty device
mdadm --manage /dev/md0 --fail /dev/sdx1
mdadm --manage /dev/md0 --remove /dev/sdx1
# power off
# insert new drive
# copy partition table across
sfdisk -d /dev/sdy | sfdisk --Linux /dev/sdx
# check array members
cat /proc/mdstat
# add the new partitions to the array
mdadm --manage /dev/md0 --add /dev/sdx1
etc…
# watch the resync
watch -n 1 cat /proc/mdstat
# once complete, reinstall grub/syslinux to new device
syslinux-install_update -i -a -m
# on Debian
grub-install --recheck /dev/sdx
update-grub
Offline
--create
And that's your problem right here. Run mdadm -h and read about the first two options.
I think this would do it:
mdadm -A -R /dev/md0 /dev/sdc
Offline
TheChosenOne wrote:--create
And that's your problem right here. Run mdadm -h and read about the first two options.
I think this would do it:
mdadm -A -R /dev/md0 /dev/sdc
It works! Thanks!
PS: --create fucked up my previous raid setup, but that's ok since the drives were still empty.
@jasonwryan
Thanks for the reply. I'll use this when a drive fails.
Offline