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.
It appears the drive that failed was /dev/sdb to above output and I've since replaced the drive in the server and the amber failure LED has since gone away with the new drive. Now my question is how can I repair / rebuild this array from my point in time? I've identified the drive was labeled /dev/sdb and have replaced the physical drive. Do you I need to manually partition the drive and then add it into the array? Or do I need to just omit partitioning and use the mdadm utility?
Code:
fs3:~# mdadm --detail /dev/md2
/dev/md2:
Version : 1.2
Creation Time : Tue Mar 22 13:53:16 2011
Raid Level : raid5
Array Size : 7806318592 (7444.69 GiB 7993.67 GB)
Used Dev Size : 1951579648 (1861.17 GiB 1998.42 GB)
Raid Devices : 5
Total Devices : 5
Persistence : Superblock is persistent
Update Time : Tue Nov 27 14:49:44 2012
State : clean, degraded
Active Devices : 4
Working Devices : 4
Failed Devices : 1
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Name : fs3:2 (local to host fs3)
UUID : 29a919a4:4a740a7b:64b56f03:691635b9
Events : 1443572
Number Major Minor RaidDevice State
0 8 3 0 active sync /dev/sda3
1 0 0 1 removed
2 8 35 2 active sync /dev/sdc3
3 8 51 3 active sync /dev/sdd3
4 8 67 4 active sync /dev/sde3
1 8 19 - faulty spare /dev/sdb3
Last edited by carlosinfl; 11-27-2012 at 01:50 PM.
Well.... I _guess_ you shouldn't do much on the raid. Even with a missing disk, whatever was in the raid up until now is still there so you should be able to work on it as usual.
Now, there must be some way to tell mdadm to add this new disk to replace the missing slot and that should be it.
I'm unable to get rid of the /dev/sdb1 from /dev/md0 because I believe this is swap and I'm unable to remove since the partition is mounted and most likely being used.
Code:
fs3:~# mdadm /dev/md0 --remove /dev/sdb1
mdadm: hot remove failed for /dev/sdb1: Device or resource busy
I'm unable to get rid of the /dev/sdb1 from /dev/md0 because I believe this is swap and I'm unable to remove since the partition is mounted and most likely being used.
So, you are using /dev/md0 as a swap area? That sounds complicated! :-)
Look at /proc/swaps to check what is being used as swap. If /dev/md0 is a swap area you could use swapoff to stop using it as a swap area. If that would leave you with insufficient swap (or none at all), first add some swap space temporarily. Use mkswap on a suitable spare partition, or (more convenient) use dd to create a large file, and use mkswap on that. Either way, once the temporary swap space is prepared, use swapon to add it to your system. Once it is on, then you can free up /dev/md0 with swapoff, and --remove /dev/sdb1 from the array.
After you replace the drive and --add back the partitions, you can reverse the process. Use swapon on to put /dev/md0 back into use as swap, then use swapoff to free the temporary swap file or partition.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.