On Tue, Mar 27, 2001 at 05:09:50PM +1000, Marty Richards wrote:
I forgot there where so many steps before I started writing this :)
OK Here's john's not so short guide to RAID 1 :)
I'm gogin to assume you have two drives you want to RADI 1
/dev/hda
/dev/hdc
/dev/hda has / which is on hda3
/dev/hdc3 is the same size as /dev/hda3 but is unsed yet
a) find the Software raid HOWTO and read it in totality before you do
anything.
b) find the Software raid HOWTO and read it in totality before you do
anything.
c) find the Software raid HOWTO and read it in totality before you do
anything.
d) Recompile you're kernel with raid support. This needs to be th newer
raid support as stated in the HOWTO
ie either use a 2.4 kernel
or patch a 2.2 kernel with the approproate patch from
ftp.kernel.org/pub/linux/people/mingo i think
d.5) OK I forgot something. Do you're equivelant of
apt-get install raidtools2
that's the newer raidtools
e) reboot with new kernel. Make sure you have a /proc/mdstat and if you
run dmesg it says something about looking for autoraid partitions
f) vi /etc/raidtab and add something like this
raiddev /dev/md0
raid-level 1
nr-raid-disks 2
nr-spare-disks 0
chunk-size 4
persistent-superblock 1
device /dev/hda3
failed-disk 0
device /dev/hdc3
raid-disk 1
This will tell the raid tools that you want raid 1 on two disks but that
currently hda3 is a failed disk so don't use it.
g) mkraid /dev/md0
h) mke2fs /dev/md0
i) mount /dev/md0 /mnt
You now have a mounted and working raid albeit with only 1 disk
j) cd /
find . -xdev | cpio -pm /mnt
k) this copies / to the new riad partition
l) run lilo NB You need a newish version of lilo to be able to boot off
raid. I know you can;t do it with the lilo in debian stable for example
unstable is fine
l) vi /mnt/etc/lilo.conf
set root=/dev/md0
leave everything else as normal
m) run lilo -C /mnt/etc/lilo.conf
m.5) vi /mnt/etc/fstab
change
/ /dev/hda3 etc etc
to
/ /dev/md0 etc etc
n) fdisk /dev/hdc
change the partition type of /dev/hdc3 to fd this is the raid autodetect
type.
o) Cross fingers and reboot.
p) If all went well your / should be /dev/md0
cat /proc/mdstat you shoud see something like
root@kevlar:/export/customers/powwow# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 sdb1[1] sda1[0] 48064 blocks [1/2] [U_]
unused devices: <none>
If things went wrong then at lilo type
lilo: linux root=/dev/hda3
this will boot back normally wothout raid
q) OK uptill this point you can put everything back how it was. This is
where we break things.
vi /etc/raidtab
change failed-disk to raid-disk
r) raidhotadd /dev/md0 /dev/hda3
s) cat /proc/mdstat
You should see the raid rebuilding
t) fdisk /dev/hda
change type of /dev/hda3 to fd
u) Check /proc/mdstat when it says the rebuild is finished ie the line
looks like
md0 : active raid1 sdb1[1] sda1[0] 48064 blocks [2/2] [UU]
then reboot
v) You should now be fully raided
w) Read the HOWTO
x) READ the HOWTO
y) READ the HOWTO
z) OK I just wanted to use the whole alphabet
--
John Ferlito
Senior Engineer - Bulletproof Networks
ph: +61 (0) 410 519 382
http://www.bulletproof.net.au/
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug