lilo boot
prompt. At the prompt, type
linux single boot=/dev/hdc root=/dev/hdc1 where
/dev/hdc reflects the location of the
old drive. When prompted, enter
root's password.
mount /dev/md0 /raid
cp -ax / /raid
lilo.conf to reflect the array's
presence by running
cp -a /raid/etc/lilo.conf.raid /raid/etc/lilo.conf
dd if=/dev/zero of=/raid/swapfile bs=1024 count=262144
and then mskwap /raid/swapfile
fstab file (/raid/etc/fstab to
specify the array as the root filesystem and the swap file. For example,
if /etc/fstab on the old disk looked
like this:
/dev/hda1 / ext3 errors=remount-ro 0 0 proc /proc proc defaults 0 0 /dev/fd0 /floppy auto user,noauto 0 0 /dev/cdrom /cdrom iso9660 ro,user,noauto 0 0 /dev/hda2 none swap sw 0 0then you should change
/raid/etc/fstab to the following:
/dev/md0 / ext3 errors=remount-ro 0 0 proc /proc proc defaults 0 0 /dev/fd0 /floppy auto user,noauto 0 0 /dev/cdrom /cdrom iso9660 ro,user,noauto 0 0 /swapfile none swap sw 0 0Note that the swap partition has been changed to the swap file created in the previous step.
/boot directory onto the root partition by
running mount --bind /raid/boot /boot
lilo will not write a correct bootloader and the
array will not be bootable. The bind option was first
introduced in the 2.4.0 kernel.cfdisk /dev/hdayesEnter/sbin/lilo -v2 -C /raid/etc/lilo.conf.raid
root and check that
you are running off of the array by running mount. You should
see that the root partition (/) is physically located on
/dev/md0
/etc/raidtab and change failed-disk to
raid-disk
/sbin/raidhotadd /dev/md0 /dev/hdc1
cat /proc/mdstat
md: md0: sync done. RAID1 conf printout: --- wd:1 rd:2 nd:3 (many lines not shown) RAID1 conf printout: --- wd:2 rd:2 nd:3 (many lines not shown) md: updating md0 RAID superblock on device md: hdc1 [events: 00000013]<6>(write) hdc1's sb offset: 4210816 md: hda1 [events: 00000013]<6>(write) hda1's sb offset: 4210816 md: recovery thread finished ...
cat /proc/mdstat. You should see the following (sizes will
vary):
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 hdc1[1] hda1[0]
4210816 blocks [2/2] [UU]
unused devices: <none>
Make sure that the drives listed are hdc1 and hda1
if you see the drives listed as hdc1 and hda,
see the FAQ.