Jump to content
  • Announcements

    • spinynorman

      Mandriva Official Documentation

      Official documentation for extant versions of Mandriva can be found at doc.mandriva.com.   Documentation for the latest release may take some time to appear there. You can install all the manuals from the main repository if you have Mandriva installed - files are prefixed mandriva-doc.
    • paul

      Forum software upgrade   10/29/17

      So you may have noticed the forum software has upgraded !!!
      A few things that have changed. We no longer have community blogs (was never really used) We no longer have a portal page.
      We can discuss this, and decide whether it is needed (It costs money) See this thread: Here
Sign in to follow this  
dude67

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?

Share this post


Link to post
Share on other sites

don't suppose you're using lvm on top of that raid set are you?

 

lvmextend would do the trick

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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:

 

http://www.linuxsolutions.org/index.php?option=com_content&task=view&id=25&Itemid=26

 

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.

Share this post


Link to post
Share on other sites

Thanks Ian for your help! :thumbs:

 

I think that I will still postpone this HD replacement as I'm thinking of perhaps updating the entire PC.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×