This guide assumes that there are two disks hda & hdc, and that "/" is
/dev/hda2

It also assumes that /boot (The kernel) is NOT on /.  /boot requires
special handling but I suggest simply maintaining a copy on both disks
until LILO is raid aware.

This example was done with Martin Bene's failed disk patch and raidtools
snapshot 19990421 (+kernel patches) and Linux 2.2.6.  All of which must be
installed before you start!

1. Create "raidtab" file. (Note deliberately failed disk = mounted "/")

raiddev /dev/md0
  raid-level            1
  chunk-size            64
  nr-raid-disks         2
  nr-spare-disks        0

  device                /dev/hdc2
  raid-disk             0
  device                /dev/hda2
  failed-disk           1

2. run mkraid.

DESTROYING the contents of /dev/md0 in 5 seconds, Ctrl-C if unsure!
handling MD device /dev/md0
analyzing super-block
disk 0: /dev/hdc2, 700560kB, raid superblock at 700480kB
disk 1: /dev/hda2, failed

3. mke2fs the new array

mke2fs 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
Linux ext2 filesystem format
Filesystem label=
175440 inodes, 700480 blocks
35024 blocks (5.00%) reserved for the super user
First data block=1
Block size=1024 (log=0)
Fragment size=1024 (log=0)
86 block groups
8192 blocks per group, 8192 fragments per group
2040 inodes per group
Superblock backups stored on blocks: 
        8193, 16385, 24577, 32769, 40961, 49153, 57345, 65537, 73729,
81921, 
        90113, 98305, 106497, 114689, 122881, 131073, 139265, 147457,
155649, 
        163841, 172033, 180225, 188417, 196609, 204801, 212993, 221185,
229377, 
        237569, 245761, 253953, 262145, 270337, 278529, 286721, 294913,
303105, 
        311297, 319489, 327681, 335873, 344065, 352257, 360449, 368641,
376833, 
        385025, 393217, 401409, 409601, 417793, 425985, 434177, 442369,
450561, 
        458753, 466945, 475137, 483329, 491521, 499713, 507905, 516097,
524289, 
        532481, 540673, 548865, 557057, 565249, 573441, 581633, 589825,
598017, 
        606209, 614401, 622593, 630785, 638977, 647169, 655361, 663553,
671745, 
        679937, 688129, 696321

Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

4. Change root to /dev/md0 in /etc/fstab.

5. Copy filesystem to new array, mounted on /mnt.

moo:/# for i in `ls | grep -v mnt | grep -v proc`
> do
> cp -dpR $i /mnt
> done

6. Edit /etc/lilo.conf on old copy to spec "root = /dev/md0" (The new
array)

7. Run lilo to reinstall the bootblock

moo:/# lilo
Added Linux *
moo:/#

8. Use fdisk to mark the new partition as type "0xfd" so it can autostart.

9. Reboot

10. Pray, time passes.

11. run "df" to ensure that your new array is indeed  mounted as "/"

12. edit lilo.conf (You have an old copy now!) to refer to your array.
(You could have edited this before booting but I think it's better to do
it now since you are making it look like your system does now, not what
you think it might look like in the future  You can predict the future
if you like once you become an expert at this.)

13. run lilo again to reinstall the bootblock, ensure it doesn't error!!
If you get an error return to step 11.

14. mkdir /proc & /mnt (You excluded these earlier to avoid recursive
copy)

15. mount /proc

16. raidhotadd /dev/mnt /dev/hda2 (Add your old root volume to the
array... Like ODS/SDS metareplace.

17. cat /proc/mdstat and see your reconstruction in progress...

moo:~# more /proc/mdstat
Personalities : [raid0] [raid1] [raid5] 
read_ahead 1024 sectors
md0 : active raid1 hda2[2] hdc2[0] 700480 blocks [2/1] [U_] recovery=2% finish=17.3min
unused devices: <none>

18. Use fdisk to mark old "/" partition as type "0xfd" so it can also
autostart.

19. Wait until resync complete and reboot.

20. Congratulations you now have a mirrored "/"

Now think about swap and /boot...

James ([EMAIL PROTECTED])
It doesn't run on an open source platform,
therefore it, by definition, does not matter.

Reply via email to