Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
with a raspberrypi (hostname: homer) I had set up a raid1 with two usb drives of 5Tb using mdadm. All worked perfect until the system failed.
After connecting the two drives on my laptop lsblk -f gives the following output (part):
Until now I have not written anything to the drives. When I inspect the md127 (/dev/sdc1), it seems that all the files are present. But I don't see anything on /dev/sdd1.
My simple (?) question is: can I recover the two drives as raid1 again without dataloss?
I hope someone can help me. It's about 1 Tb data.
Thanks in advance, kind regards Ed
an additional question:
does the command: "mdadm --create /dev/md0 --level=1 /dev/sdx1 /dev/sdy1" with the right arguments, destroy the data on the intact usb drive?
As stated the RAID is running but just with 1 disk in degraded mode. All the data should be ok with RAID 1 because the disks are an exact copy of each other.
Do you know if the second disk is still ok? Maybe run SMART diagnostics to check its status. You do not need to recreate the RAID but having a backup is a good idea.
Status shows the second drive as removed. The second disk should be partitioned exactly like the first. To replace the second disk run the command.
sudo mdadm --manage /dev/md127 --add /dev/sdx1 (make sure you use the correct device ID)
To check the RAID status run the commands
sudo mdadm -D /dev/md127
The backup is one of the RAID drives!
So my question is: can I build the RAID1 without data loss of that drive. For instance with the similar command like:
does the command: "mdadm --create /dev/md0 --level=1 /dev/sdx1 /dev/sdy1" with the right arguments, destroy the data on the intact usb drive? Let's say that /dev/sdx1 is the drive with all the data. What happens with that?
Yes, see my post above.
Search the internet on how to replace a drive in a mdadm RAID 1
Yes, running create on an existing array drive will essentially destroy the data. It actually erases the metadata making data recovery very difficult.
RAID is not a backup. It purpose is to protect against a hard drive failure which appeared to work in this case but we do not know if the drive just became corrupted or has failed.
Let's hope the drives have external power. Personally I wouldn't re-use the failed drive, but get a new one and test the failed one at your leisure.
Get some diagnostic data - the smart data asked for already and your logs for the initial failure; I'd guess the drive now simply gets ignored at assemble, so likely no useful messages then.
Without a proper backup your data are at risk whilst you are fooling with the disk(s). Simple as that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.