Re: Dealing with Raid 1

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

 



On 12/12/05, Franck Y <franck110@xxxxxxxxx> wrote:
> Martin,
> Does it delete my files ?
> And when i will make the raid configuration ?

I'd recommend allowing someone else to look these directions over, but
I believe this will create your mirrored devices while preserving your
data.  I'm not terribly familar with LVM under Linux so again, I'd
encourage you to let someone else look these steps over for
correctness before using them.

These are basically step by step commands that create a 2 new md
devices for your 2 mirrored partitions, each mirror containing only 1
device.  These devices then have your data copied over to them.  After
the data is copied onto the md devices, the additional disks are
added.  The md subsystem then takes care of syncing the mirrors
automatically.

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda2 missing
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/hdc2 missing
mke3fs /dev/md0
mke3fs /dev/md1
mkdir /mnt/md0
mkdir /mnt/md1
mkdir /mnt/hda1
mkdir /mnt/hdc1
mount -t ext3 /dev/md0 /mnt/md0
mount -t ext3 /dev/md1 /mnt/md1
mount -t ext3 /dev/hda2 /mnt/hda1
mount -t ext3 /dev/hdc2 /mnt/hdc1
cp -av /mnt/hda2 /mnt/md0
cp -av /mnt/hdc2 /mnt/md1
umount /mnt/md0
umount /mnt/md1
umount /mnt/hda1
umount /mnt/hdc1
mdadm --add /dev/md0 /dev/hda1
mdadm --add /dev/md1 /dev/hdc1
mdadm --detail --scan | head -1 > /etc/mdadm.conf

You'll want to create the appopriate entries in /etc/fstab to ensure
these are mounted at boot time.  Also, you'll probably want to edit
/etc/mdadm.conf to add the following above each ARRAY line:

DEVICE partitions
MAILADDR root

At the end of each ARRAY line, you'll want to add the option auto=md
-- this will force mdadm to create the appropriate md devices in /dev
should they not exist at the time the mirrored volumes are found at
boot.

Best of luck!

--
Chris

"I trust the Democrats to take away my money, which I can afford.  I
trust the Republicans to take away my freedom, which I cannot."


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux