Best software to clone a RAID1 Linux setup

cyabro

Well-Known Member
Reaction score
420
Location
New Zealand
Hi,

I've been asked to help out a school who have an Acer Altos server running what looks like a version of Suse Linux.
It has 2x80GB WD SATA HDDs setup in RAID1 and one of the HDDs is dying and needs to be replaced.
80GB HDDs aren't available anymore so they want to upgrade to 2x250GB HDDs.

What software can I use to take a full image of the existing RAID1 80GB setup, replace the HDDs and setup the RAID1, and then restore the backup image?

I know nothing about Linux so please bare that in mind :o

Not sure on the exact model of the RAID but it is built in to the mainboard and looks like Intel/LSI MegaRAID or similar.

For a Windows machine with RAID I would just use ShadowProtect IT Edition but that doesn't support Linux very well, if at all.

Thanks!
 
Maybe i am missing something but shouldnt it just be a matter of replacing the bad drive with new one, have the disk manager rebuild the disk, and then rinse and repeat with the other drive?

I know some versions of ghost will image a linux raid 1
 
Maybe i am missing something but shouldnt it just be a matter of replacing the bad drive with new one, have the disk manager rebuild the disk, and then rinse and repeat with the other drive?

I know some versions of ghost will image a linux raid 1

Yea I could do that if I had another 80GB HDD but I don't as they aren't available anymore.
As far as I know in a RAID1 setup the HDDs have to be the same size.

Even if it could be done by just replacing one disk at a time, the rebuild time is probably going to be a few hours and I'm not going to sit around waiting for that to happen and the school is about 1/2 hour drive from our shop so don't really want to travel back and forth too many times.

Edit: It looks like it may be possible with Clonezilla, can anyone confirm?
 
With RAID 1 the drives need to be the same size or bigger. If you are planning on upgrading the drive then I would make sure they have a good backup.,break the mirror and replace the drive, you will probably get some error messages complaining about drive sizes not matching. If you are wanting to clone the drive then the dd command is a good way to go since it is a linux box.

edit: i would also check out some of the SUSE forums for info on upgrading the drives for this RAID set.
 
Last edited:
What I've done when upgrading a hard drive in Linux is to create the partitions on the new disk then rsync the data from the old disk to the new ones. I haven't done this on a SUSE system, but it should still work. I'm not sure how it'll work with the RAID setup either.
The one catch might be where the bootloader is installed. You may have to copy the boot sector before creating the partitions.
It's worth a shot, it shouldn't affect the existing setup at all.

Al
 
I have done it before on Ubuntu without a RAID controller using Partimage (or Partclone) and dd.


If it is SUSE linux, this is probably Novell Open Enterprise, so you may need to watch out for the NSS Volume pools. The best way to do that would be through iManager to be honest.

It was something like:

dd if=/mnt/something/school.mbr of=/dev/sda

Obviously, you would need to have the MBR in the school.mbr file.

To make that file:

dd if=/dev/sda of=/mnt/something/school.mbr bs=512 count=1



Also it is best to use SFDISK to backup and restore the partitions:

sfdisk -d /dev/hda > hda.out
sfdisk /dev/hda < hda.out



You may need to update /boot/grub/menu.lst or re-install Grub
You may need to update the UUID in /etc/fstab if it can't mount the root filesystem.


You may need to use Gparted to expand the partition.


************************

The reality is that you need to figure out what they are running and do a dry-run upgrade in your lab to practice before you do it for real.

If you are really lucky, changing out the drives one at a time in the controller might work, but you should correctly fail-over and spindown instead of just yank & pull. Might find out what type of RAID card and if it is supported, first. It is probably not a recommended procedure for a production environment and more of a "hobbiest" method though I have done it before.

Also, doesn't the school have IT support via their own IT Staff?
 
Thanks for the replys guys.
As I said I know nothing about Linux so pretty much everything suggested here is over my head.

The school is a small rural one, with about 27 children in total, so no IT people on staff.
The server was originally sold to them by a company in Auckland, which is about 2 hours by car from the school, and basically told the school they don't want to do the job as it is too far to travel. Hence the reason for coming to us.

I don't think the server is running anything special other than being a file server and ease of backing up their data from one central location.
 
If it is just a file server, I would gather the details for what shares it hosts etc.

Name:
Shares:
File Permissions:
IP, Subnet Mask, Gateway, DNS...:

Back everything up

1. Replace the drives
2. Install something like Ubuntu Server
3. Configure it with all the same info as above.

Restore everything


***************************

It might be easier to re-build the system to perform the same function than migrate it, but if you know nothing about Linux you are not necessarily in over your head; since, it is pretty easy to figure out.

What you don't want to do though is learn on your customer's time, data, & money. Instead, learn in your own lab... teach yourself.


The biggest problem you have now in my opinion is that you accepted the job meaning you are pretty much committed. You might have "Right to Refuse Work" in your waiver, which would be good, but it looks really bad to pull that card on a customer and walk out on a job after accepting. If you do this make sure you charge $0 total and refund ANY/ALL money you have already taken if any... I hope it does not come to this, but it might be better than also digging yourself a deep hole you can't get out of...


*******************

If I were you I would spend some of your private time (off the clock... unpaid) and come up with a checklist of everything you are going to do then run through it all on an actual, similar system with some mock data. This will help you find most any "gotchas."

Don't let Linux scare you away though. Sounds to me the reason they are choosing you is that you are close compared to the 2 hour drive, so they expect you to fix this right and do it fast. You are therefore presumed to be an expert and if you do it you need to pull it off with minimal interruption to their curriculum. i.e. Provide accurate estimates of any downtime. You don't want to end up in a situation where a 2 hour project ends up taking you 12 hours either because you cannot charge more than what is reasonable, and you will look really incompetent if this happens though they will probably be empathetic provided you worked hard and got it working in the end.


Maybe you could avoid ALL of this and just add 2 more data drives?

It would be cake to plug in 2 additional drives, create an extra array, initialize a file-system with mkfs, mount it (and configure it to mount each time the system boots)...

You could then use something like cp -a to copy all the files keeping their permissions intact and re-configure Samba (provided this is what they are using) to find data from at the new location.


Regardless this is not necessarily hard to do. Also, they will find that 2 x 500 GB SATA hard drives are not much more money than 2 x 250 GB hard drives... maybe a $40 to $60 difference total!
 
Last edited:
If I had known it was a Linux server I probably wouldn't have taken the job but I don't think the staff even knew it was Linux as they just access shared files from their Windows XP computers.
The server doesn't have a screen, keyboard or mouse attached to it, I had to take my own, so they have probably never even seen the login screen on it.
I obviously didn't know it was Linux until I got onsite and connected the screen.

I will setup a computer here in the workshop and have some practice first.
 
Good plan because either way you will learn a lot in our own lab.

Regardless, your only other option is to say "we don't service Linux" and did not know when we accepted the job... then walk out.

I am personally a big fan of figuring out how the RAID works on that type of server then just adding a couple of disks and putting a data share on it... No imaging, migrating data, re-installing... :D
 
Surely as long as you do a sector copy of the drive to a new drive and then recreate the mirror with another new drive, it should work, no matter what linux stuff is going on?
 
Well I've had the machine in the workshop over the weekend. School holidays started on Friday so I was able to take it away.

It took a while to figure it out but I got there in the end.
I ended up using Acronis WD edition since the drives are all WD.
Booted that from a USB stick and took a backup image and saved to a USB hdd.
Then I removed the 2x 80gb drives, installed the two new 250gb drives and created a raid1 setup in the intel/lsi configuration.
Booted off the acronis USB stick and restored the backup image. Doing it this way allowed me to extend the data partition to use the extra available space.
I thought that would be it as the machine started to boot ok but then Linux complained about not being able to find dev/md1 and then just stopped at a $ prompt. Some commands would work but not many.
So I downloaded systemrescuecd and put that on a USB stick and booted from that.
After checking the original disk setup it appeared as though the was a couple of software raid1 partitions setup. Not sure why as there is already the intel/lsi raid1 setup.....
So what I had to do was delete the md1 and md0 devices and recreate new ones with the same configuration. It then rebuilt the raid1 devices and the machine was able to boot again!

Glad that's over!
 
I didn't read the whole thread so if this has already been mentioned then forgive me.

Personally I would just use the Linux software raid. It works quite well. Once the array is built then transfer everything from the 80Gb drive to the new array. I would not use hardware/software raid cards to do the raid configuration unless they have software specifically built for Linux. Just hook the drives up to the controller and configure the raid from within Linux.
 
Back
Top