Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I have recently bought a dedicated server, I could not afford a managed server and I'm will to learn but this problem has come to quick for me so excuse my ignorance.
Within a few weeks of getting the server it's got a fault drive in a 2 drive raid. After whatt seems like days of reading I've managed to a) remove from the array the wrong drive and b) re add it :-) I've now got part way to removing the fauilty drive but this won't work, here is the print out; can anyone give me any help on whats wrong here, I need to remove drive sda as that's the faulty drive.
None of your devices has more than one disk... you can't fail the last disk of a raid1. You have to install a new disk, partition it appropriately, and then add the appropriate partition to the raid1. Once you have two disks in a raid1 you can then fail one of the two out. If in the past you DID have more than two disks installed, the system has already removed the faulty one (though I thought that was a manual operation and not automatic; but I can see the possibility that it happened during a boot - I didn't test for that).
/dev/sda2 is in use by md1 - and there are no other disks in use.
md0, md2, and md3 are all on the SAME disk (/dev/sdb), so you have no redundancy anywhere. Lose that disk and you lose all three filesystems, and with no recovery possible.
From their I attempted to remove sdb by mistake.
I then added it back and it did rebuild.
Last thing was I tried to do was removed sda and added grub to sdb.
I don't really know where I am now, are you saying I can now get the host to physically replace the damaged drive sda ?
Bare in mind for other reasons I've not slept for 36 hours now :-)
Even in that output you have two "raid" arrays with only one partition in each, md2 and md3. Who set up this system originally? Is it possible sda had already ejected itself from those two arrays before you got that output? Do you have the mdadm status from when everything was working correctly?
If you want to remove sda, you'll need to add sdb2 back into md1, let it rebuild and sync, and then you can remove sda2 from md1. At that point, sda will not be in use by any arrays and can be removed from the system. If you were to remove sda now, you would lose md1 which contains your /boot partition.
Last edited by suicidaleggroll; 08-08-2016 at 09:58 AM.
. it's possible that I messed it up in my efforts.
I'll do as you suggest, this help is very much appreciated. Once I have this sorted I think I will setup some old hardware I have and really nail the understand of raid. Then perhaps set this server up correctly.
No need for dedicated hardware for testing, just use virtual machines. Give your VM two disks, and then inside the VM you can paritition and raid them however you like. If you screw something up, just restore from a backup or snapshot.
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
[root@svr1 ~]# mdadm --manage /dev/md1 --remove /dev/sda2
mdadm: hot remove failed for /dev/sda2: Device or resource busy
[root@svr1 ~]#
Yes, but make sure the partitioning is correct first (as in verify the resulting partitions). The reason for verifying is that SOMETIMES (due to physical disk geometry) sizes will not match. Also there can be other things that affect it - such as a 4Kb block vs 512b block. A new disk with 4k blocks will not perform very well when it is treated as a 512b block. It should work - but will be much slower than a real 512b block device. What happens is that the disk has to read the 4K block, update the appropriate 512 byte section, then write the entire 4K block back.
For a raid 1 (mirroring) they have to be at least the same size as the active partition.
NORMALLY, for something like this I would have expected a single raid 1 device, which is then partitioned for use.
It makes it simpler when a disk fails - only one raid device has to be dealt with as all partitions would be processed simultaneously.
The way it is, each raid device has to be handled separately, which increases the possibility of error.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.