Cloning a current configuration onto a RAID array

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
So I'm going to be creating a RAID-0 array comprised of 3 disks, which will be 1.5TB in size. My current drive is a single 1.5TB disk, configured as follows:

hddconfig.jpg


The 1.2TB partition is a data partition accessed by both Windows 7 and Ubuntu.
The EXT4 partition is obviously Ubuntu, as is the swap space
The 79GB partition is Windows7

Currently, GRUB is managing my dual boot, and everything is working 100%.

My plan was to simply clone the current drive onto the raid array using something like GParted. I know Windows7 would probably work after the operation, but I'm not sure how it would affect Ubuntu, so I'm looking for some advice.

Obviously the point of cloning would be to avoid the reinstall and reconfiguration of everything. I wouldn't mind reinstalling W7 as it's basically my gaming OS and would be quick and simple. But Ubuntu is my main environment and development machine, and is set up with all my tools, web server and virtual host configs, etc.

So the question is two-fold - would Ubuntu actually WORK after an operation like this (ie. would it support the RAID array out of the box), and if not, how would I then install Ubuntu onto a RAID array and easily transfer my current configuration across to the new install?

Thanks in advance
 

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
Scratch that - decided to do a full reinstall, so a more pertinent question: what do I need to back up from my current Ubuntu setup to be able to replicate it on the other side of the install? Off the top of my head, I would:

- back up the current package list
- back up any relevant dirs in /etc
- back up installed programs in /opt

What else should I be looking at?
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,475
You definitely want to back up /home

Now depending on this raid0, if its a proper raid card np, but if its software raid, or that fakeraid that is on most motherboards, you might have trouble booting of it, but that can be fixed with a small /boot non-raid0 partition.
 

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
Hmm, it'll be a fakeraid. I didn't realise Ubuntu STILL had problems with RAID - you'd think they'd have made it as painless as Windows 7 by now.
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,475
It doesnt actualy have problems with raid, its fakeraid that has a problem.
 

koffiejunkie

Executive Member
Joined
Aug 23, 2004
Messages
9,588
Do not use fakeraid. Trust me. You will cry for your beloved data. Even under Windows, it can be all over the place. If you want to create a RAID-0, make sure you use a real RAID card that can handle some error correction and that sort of stuff. Also a good idea to go with the RAID edition drives rather than the regular desktop ones. Why? Because the RAID edition drive (Seagate and WD both have them) don't report all the harmless errors that regular desktop drives do, i.e. they're less likely to get failed.

And even after all of that, I would highly recommend you don't use RAID-0 unless you have a good backup strategy and the time to rebuild your box without warning.

Lastly, for a drive larger than 2TB, good old MBR isn't going to cut it anymore. You'll have to use a GPT - have fun!
 

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
Funnily enough (or not I, because I guess it's common knowledge to everyone but me :)) I just got given the exact same advice and a long shpiel about backups when running a RAID array from someone else too. Makes sense, and the more I read about it, the more it seems like a bad idea. The point of the exercise was to achieve SSD speeds while avoiding the cost, until next year when they're "scheduled" to come down in price and go up in capacity. Perhaps I should look into importing a cheaper SSD till then as a placebo.
 

koffiejunkie

Executive Member
Joined
Aug 23, 2004
Messages
9,588
Well, your dual boot situation complicates things. If you were just using Linux you could safely go with mdraid (although it's pretty sensitive and I still wouldn't recommend RAID-0). fakeraid is just pretty crap because there's very little in the way of standards on how is should be implemented, and it's all in software, so what you end up with is something like mdraid but with inconsistent interfaces.

Something else: contrary to popular belief, RAID-1 is actually faster than a single disc. In fact, most of the time, it's much faster all-round. For write operations, it is about the same, but when reading, it acts in exactly the same way as a RAID-0 i.e. it splits the reading between the drives. The same is true of RAID-5 although writing is faster too. If you want to get more speed out of it, and don't want to risk everything, RAID-5 is where it's at. That said, given how freaking long it takes to rebuild a drive whose capacity is measured in "TB", I'm more inclined to go for RAID-6 (two parity drives) next time I do something like this.

So how about this. Your OS does not need a lot of space. In fact, for OS and programs, 15-20GB should be more than sufficient for Windows and Linux each. How about getting a 40GB SSD to put your OS on, and putting your data on the big drive? The Intel X25-V models are roughly the same price as a 1.5-2TB drive. They're not the fastest SSDs out there, but trust me, they're way faster than a regular disc drive.
 

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
I just came to the same conclusion, but with a slightly larger SSD that I found on special.

Given the configuration I posted above - is it possible to clone just the W7/Linux partitions onto the SSD, leaving out the large data partition but still being able to dual boot with the grub installation? Or is it necessary to do a full reinstall of both?
 

koffiejunkie

Executive Member
Joined
Aug 23, 2004
Messages
9,588
You should be able to clone them just fine if they're small enough to fit. You'll just need to re-install grub.
 

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
Cool, sounds promising - thanks for your help and your input.

I assume once I've done the cloning, I can boot into my current setup, mount the new drive and run grub-install on it? Do I aim it at a specific partition, or just whichever I mark as bootable when setting up the disk?
 

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
I meant booting into the installation on my current disk, having the SSD as another disk and then mounting it. I guess using the LiveCD is pretty much the same thing
 

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
Thanks again for the help - much appreciated :)

Been doing some reading about Ubuntu + SSD's. Looks like GParted actually has an option for automatic partition alignment when creating a partition, so I'm hoping the process is as simple as creating an NTFS partition for W7, Ext4 for Ubuntu with "round to cylinders" unticked, then copying the partitions from one drive to another and reinstalling Grub. What do I do with the swap partition though? It's not recommended to have it on the SSD, so I was thinking of placing on the SATA drive. Will Ubuntu boot if I don't create it on the SSD, and then recreate it from within Ubuntu once I've booted it?
 

koffiejunkie

Executive Member
Joined
Aug 23, 2004
Messages
9,588
What do I do with the swap partition though? It's not recommended to have it on the SSD, so I was thinking of placing on the SATA drive. Will Ubuntu boot if I don't create it on the SSD, and then recreate it from within Ubuntu once I've booted it?

You don't need swap, unless you run out of memory. Linux can boot fine without it. Weather the installer will let you proceed without creating it is a different story - I don't know.
 

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
Having some trouble with this, hoping you can help before I'm forced to reinstall. I partitioned the disk in g parted, then marked the ext4 partition bootable. Copied the current linux install over using cp -arv.booted into g parted live cd, followed the instructions here: http://www.ubuntu-inside.me/2009/06/howto-recover-grub2-after-windows.html but no luck. It still had menu options from my old install and gave me errors about missing device id.at a loss now and really don't want to reinstall. Any ideas?
 

fskmh

Expert Member
Joined
Feb 23, 2007
Messages
1,184
I suspect you have two different problems.
One is that grub has to be reinstalled and the second is that your /etc/fstab refers to a UUID that is no longer valid. It uniquely identifies the partition that the OS was first installed on. Pain in the butt when making an image for a bunch of lab PCs.

I would boot from the CD and mount the partition containing the OS, replace the UUID in /etc/fstab with the actual device name, e.g. /dev/sda2 or whatever.
Then I would rerun grub. Suppose I had the partition containing the OS mounted under /mnt/sda2 and I needed grub installed to a second drive called /dev/sdb, I would do "grub-install --root-directory=/mnt/sda2 /dev/sdb"

BTW, you might want to have a look at clonezilla to create/deploy images.
 

Seeyou

Expert Member
Joined
May 1, 2007
Messages
2,705
Thank you for the fstab suggestion. GRUB not booting the new partition ended up being a GRUB configuration issue, but had I not edited fstab too it would've died at that point too.
 
Top