Jump to content

Updating RAID set


Recommended Posts

I have a set of two 750 GB Samsung Spinpoints installed as RAID1. Now one of the drives' SMART reports "bad" during boot even though the raid still seems to work fine.


I don't seem to find an identical 750GB drive - and even though I may be able to find a suitable 750 GB drive or install a 1 TB drive (and lose 250 GB of that space), I may want to update my array to 1 TB if possible.


So my question is: is it possible and if so, how do I do it?

Link to comment
Share on other sites

On this one set I'm not, I'm afraid.


I could just install fresh Mageia1 on a new HD (let's say 1 TB) and then copy all from that 750 GB drive into the new one. But how can I set up (after copying the contents to the new hd) RAID1 (perhaps even with LVM) into an already installed hd?

Link to comment
Share on other sites

It would be easy enough as you'd need to remove the faulty disk, and then add the new one. Add a partition to it marked as Raid Autodetect. Edit /etc/mdadm.conf so that the second disk is missing. Then you will need to add it to the array after the system has started. The array will then rebuild on the new disk. Then you edit /etc/mdadm.conf again to add back the config as it was before with the second disk.


Of course, if you're replacing with a disk of the same size. I know you want larger. Therefore, you'd create Raid1 on the 1TB disk with the second disk missing, then LVM inside this. Copy the data to the disk. Then add another 1TB disk later similar in my procedure for replacing a faulty disk and adding it to your 1TB array.

Link to comment
Share on other sites

OK, thanks. That sounds so terribly easy... :) But, could you explain this a little bit more detailed for me...?


I will first remove the current 750 GB sda (reported bad in SMART) and replace it with a new 1 TB disk. Do I need to mark it as failed, or just remove the old one and insert the new one?


Then I do not get this part:

Add a partition to it marked as Raid Autodetect.
I should add a partition to the new disk (1 TB) marked as Raid Autodetect? For the hole disk or to a portion of it?


How do I mark the second disk as missing in /etc/mdadm.conf?


Sorry, but this is little confusing. Perhaps I should sleep on it :zzz: (and buy some new disks first) before trying to wrap my brain around this. :unsure:


I'll get some new disks and try to get the bad disk replaced first. I'll post back after that.

Link to comment
Share on other sites

Removing the disk and booting the machine, should leave you with the disk missing. Adding a partition with fdisk, or whichever you normally use :) and changing the type to Linux raid autodetect. You won't add the 1TB to the array, since it won't be the same size. You'll create a separate array with the 1TB disk, but with the second disk missing. Then, when you've copied the data from the old array to the new array, you can then remove the 750GB disk and add a second 1TB disk and then add this to the array.


With /etc/mdadm.conf - if you have disks /dev/sdb and /dev/sdc as part of the array, and /dev/sdc is faulty, then you edit /etc/mdadm.conf and remove the info that corresponds with /dev/sdc and replace it with "missing". Look at my article I wrote ages ago:




in particular:


Creating Arrays

Since /dev/sda is in use, we cannot add this to the array yet, so we will build the array with /dev/sda offline, and only /dev/sdb active.  This is how:

   mdadm --create /dev/md0 --level=1 --raid-devices=2 missing /dev/sdb1
   mdadm --create /dev/md1 --level=1 --raid-devices=2 missing /dev/sdb2
   mdadm --create /dev/md2 --level=1 --raid-devices=2 missing /dev/sdb3
   mdadm --create /dev/md3 --level=1 --raid-devices=2 missing /dev/sdb5
   mdadm --create /dev/md4 --level=1 --raid-devices=2 missing /dev/sdb6


here you can see, the part where I have /dev/sda missing but the array configured on /dev/sdb. When I then remove and replace /dev/sda with the new disk (eg 1TB), I would then add it later to the array. It's all in the link, it will tell you how to add the disk later, and then in /etc/mdadm.conf you replace missing with /dev/sda.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...