[ale] RAID and an existing partition?

Robert L. Harris Robert.L.Harris at rdlg.net
Tue Feb 3 15:47:09 EST 2004



The easy way is roughly this:

sfdisk -d /dev/hda | sfdisk -d /dev/hdb
  (duplicate the partition structure)
sfdisk --no-reread --force -c /dev/hdb 1 fd
mdadm --create /dev/md1 -l 1 -n 2 /dev/hdb2 missing
mkfs -t ext3 /dev/md1
mount /dev/md1 /tmp/mnt
rsync -avx /data /tmp/mnt (or whatever the second partition is)
umount /tmp/mnt

If the partition is unmountable (not / or /usr) then
  umount /dev/hda2
  mount /dev/md1 /data
  verify content.
  If it's good:
    modify /etc/fstab to use /dev/md1
    mdadm -a /dev/md1 /dev/hda1

If it's not unmountable:
  modify /etc/fstab to use /dev/md1
  reboot 
  If it's good:
    mdadm -a /dev/md1 /dev/hda1

You can do the root filesystem also but it can be a bit more convoluted
but it's very similar to the second option.


Thus spake John Cole (JohnC at LGEFCU.org):

> Howdy all!
> 
> I'm looking at creating a software raid array from 2 60GB drives using Linux
> on 2.4 kernel.
>   One 60GB drive already has data on it that I want to mirror.  The other
> 60GB drive has data I want to overwrite.
> 
> 1)  I'm assuming I need to repartition/reformat the second drive?
> 2)  Will there be any problems with the data on the first drive?
> (theoretically it should keep all my data and just copy it to drive 2,
> right?).
> 
> btw, I've never setup a RAID with an existing system, only newly built
> systems.
> 
> Thanks,
> John Cole, TICSA
> 
> Network Administrator / Security
> Lockheed Georgia Employees' Federal Credit Union
> 430 Commerce Park Drive
> Marietta, GA 30060
> (770) 424-0060
> (800) 541-8921
> Disclaimer: The information contained in this email is proprietary and
> confidential.  It is intended solely for the use of the person identified
> and intended as the recipient. This document is forwarded to you in such a
> form (E-mail) that LGEFCU cannot guarantee the completeness and/or
> correctness of its contents and information. If you have received this
> E-mail message in error, please notify us immediately. Please also delete
> this document from your computer. This document may not be reproduced,
> copied, distributed, published, modified, or furnished to third parties,
> without the prior written consent of LGEFCU. LGEFCU specifically disclaims
> any responsibility or liability for any personal information or opinions of
> the author expressed in this email.
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale

:wq!
---------------------------------------------------------------------------
Robert L. Harris                     | GPG Key ID: E344DA3B
                                         @ x-hkp://pgp.mit.edu
DISCLAIMER:
      These are MY OPINIONS ALONE.  I speak for no-one else.

Life is not a destination, it's a journey.
  Microsoft produces 15 car pileups on the highway.
    Don't stop traffic to stand and gawk at the tragedy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature




More information about the Ale mailing list