Rich Freeman on 4 Mar 2013 17:54:08 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Survey: Linux RAID mirror sync time


On Mon, Mar 4, 2013 at 8:17 PM, Casey Bralla <MailList@nerdworld.org> wrote:
> I've got a server that crashed last year and then I f'ed up the restore.  I'd
> like to add a RAID mirror, but thought I had to start off that way from a clean
> install.  is there an easy way to setup RAID on a running system?

Is it working now?  If you messed up the restore then you might be
doing a fresh install anyway.  Assuming it is working, then how easy
it is depends in part on whether you're using LVM.  If you're using
LVM then everything but your boot partition/grub should be REALLY easy
to migrate.  If not you don't need to do a full reinstall, but you'll
likely end up booting off of a rescue CD to do it.

Set up your new drive with a partition for boot and one for everything
else (under LVM).  If you're using LVM already then create a raid with
a missing volume in the large partition, and then create an lvm
physical volume on that raid and add it to your volume group.  Then
run pvmove to move everything into it (works fine while the server is
up - though if this is a real production server you'll likely want to
do this off-hours with backups/etc - it is pretty low risk but you can
mess things up and if you/I miss anything it won't boot without a
rescue CD).  You'll likely want to set up a raid1 with the old
metadata version and with a missing volume for your boot partition
(unless grub2 supports booting off of something fancier).  Then create
a filesystem on top of the raid1 and copy your /boot into it.  Now all
your data is on the raid.  Go ahead and unmount/repartition the old
drive to be identical to the new one, and then add those partitions to
the two raids, and they'll start to sync - when that finishes you'll
be completely on RAID (I'd sync boot first - it will be almost instant
and then your server will boot fine once you've installed grub even if
the rest of the drive isn't done syncing).  You need to install grub
on both drives and point each to the correct boot drive (the idea is
to make it bootable if either drive is the boot drive) - there are
some howtos on that.  Edit your fstab if necessary - /boot likely
needs some fixing, and if you were using LVM all along the rest is
likely fine as-is.

If you aren't using LVM then you'll want to set it up on your RAID,
then create new filesystems and copy all the data over onto the raid
the old fashioned way from a rescue CD.  Otherwise it will be about
the same from there.

Oh, and I wouldn't do any of the above unless you're pretty confident
you understand the general concepts behind all of this stuff and you
have backups (well, if you do have backups you can't go too wrong,
assuming you really do have backups and don't just think you have
backups).

Maybe an LVM+RAID talk might be a good newbie topic for an upcoming
PLUG?  That's a VERY good topic to understand, and if you aren't using
LVM you probably should be.

Rich

> On Monday, March 04, 2013 7:36:59 PM Eric at Lucii.org wrote:
>> Just curious what folk's experience is with this.
>> If you replace one drive of a RAID mirror pair with
>> a blank drive how long does it take to sync?

I've got a raid5 that is now a few TB (from 1TB drives).  Things like
reshaping/resyncing/scrubbing take maybe 8 hours or so, not that I've
kept careful records.  Obviously the larger the drives the longer it
takes - the size of the individual drives probably matters more than
the number of drives, since transfer to any individual drive is likely
to be rate-limiting.
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug