raid-one

Les Mikesell lesmikesell at gmail.com
Thu Aug 16 17:24:27 UTC 2007


Tim wrote:
> On Thu, 2007-08-16 at 08:11 -0600, Karl Larsen wrote:
>>     Hi Tim, I think you suffer from a fear of "fisk" :-)      Yes you
>> do need to be careful. Look at it this way:
> 
> No, I don't.  Whatever "fisk" means...  ;-)
> 
>>     If your going to make a software raid-1 on Linux you must use a
>> root Terminal. A root Terminal is capable of deleting your entire
>> Linux! :-(
>>
>>     This paper is not for a person who has no knowledge of root and
>> what it can do. You need to know the basics. I will add a place where
>> they must show this basic knowledge or not try to do raid-1.
> 
> Now you're going off on a tangent.  The only disclaimer needed, as
> already mentioned by us, is to point out changing drive structures is
> potentially destructive.  Make backups before altering a pre-existing
> system.

With his approach he doesn't change the existing drive until the new one 
is known to work.  The potential failure mode is that you get the wrong 
device name for the fdisk or mke2fs steps.  There's not much sense in 
trying to describe Linux device names for anything but hd? devices since 
they are essentially randomized, so the user will be on his own there 
regardless of what you write anyway.

> What I see you doing, and everything you've said leads to this
> conclusion:  You're making the classic mistake of over-simplifying
> something to the point that you completely ignore necessary aspects.

It really will boil down to a very simple set of steps:
  fdisk the new target partition
  mdadm create a raid device with a missing mirror
  mkfs a filesystem on the md device
  mkdir a temporary mount point
  mount the md device on the tmp mount point
  copy the files from the old filesystem to the new.
repeat for all filesystems
  either label the new filesystem to match the old or fix fstab/grub.conf
  install grub on the new disk
  swap disks
  reboot

Once it all works with the new disk, fdisk the old one to match if it 
didn't already and mdamd --add the mirror partitions.

The tricky parts are dealing with what happens if you make duplicate 
filesystem labels and making the new drive bootable.  But those can be 
fixed with a rescue-mode boot.

-- 
   Les Mikesell
    lesmikesell at gmail.com




More information about the users mailing list