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

Re: moving an installed Debian system onto RAID-1



Hi Robert,

I just succesfully completed a 3-day crusade against my scsi chain.
At the end it turns out all I needed was a black goat and some incense.

Your problem sounds similar too mine, boot stops right before or during 
mounting the / fs , with messages it cannot read from the disk
from various fs-drivers (reiser in my case) when trying to install / fs
on scsi drives in raid1 formation.


I assume you followed the various howto's as I did. I recently did
this "making into RAID-1" with IDE drives and everything worked just fine,
so I thought I'd do the procedure exactly the same, only with scsi.
 
After countless reinstalls I found a procedure that worked for me.
I only have 1 partition (excluding swaps), the one that is raid1 (/dev/md0).
This partition also contains /boot .Containing /boot on the raid 
might even be necessary to get it working in the end.

The steps that I think were in the right direction:

 -add an IDE hd.
 -boot into knoppix.
 -make /etc/raidtab
 -mount one of the two disks mentioned in the raidtab, this disk should
 have the data on it that will finally run in raid.( for me this data
      was an almost clean woody upgraded to sarge)
 -make a fs on the newly added IDE disk
 -cp everything from your mounted scsi disk (the one with the data to
     be raided) to the fresh IDE.
     (in your case you might need to do this for other /dev/md* partitions
     too, don't forget /boot)
 
  -now you should have an ide disk that's a full install of everything
   that is in a normal 1 partition OS. (/boot, /dev, /proc ..etc)
   (verify this. If you're having data besides a clean install, this
    IDE disk will be the only copy you have, since the scsi disks
    seem to be needing a clean synchronised raid initiation, not
    the "failed-disk" trick found in many howto's. You even might
    want to physically disconnect the IDE during a reboot, just to make sure
    .)
    
  -install mdadm 
  -unmount all your scsi partitions
  -mdadm --zero-superblock /dev/sda
  -mdadm --zero-superblock /dev/sdb
  -fdisk both /dev/sda and sdb to a single FD type partition
  -mount the IDE disk (/mnt)
  make sure you have a good /dev/raidtab in /etc (on the live filesystem)
  here's mine for good measure

  raiddev		/dev/md0
  raid-level	1
  nr-raid-disks	2
  chunk-size	32
  nr-spare-disks	0
  persistent-superblock	1
  device		/dev/sda1
  raid-disk	0
  device		/dev/sdb1
  raid-disk	1

  -mkraid /dev/md0
  -raidstart /dev/md0
  -wait untill the disks are in sync again (monitor with #cat /proc/mdstat)
  -make a filesystem on /dev/md0
  
  -mount /dev/md0 to /mnt2
  -cp everything from /mnt to /mnt2 (ie #cd /mnt2;cp -a /mnt/* .)
  now you should have a complete OS filesystem on /dev/md0 
  -#mount -t proc /proc /mnt2/proc
  -chroot /mnt2
  your now inside an md filesystem, this is the filesystem that
  will be the final raided /
  -edit /etc/lilo.conf to look like

<snip>

# +---------------------------------------------------------------+

# Support LBA for large hard disks.
#
lba32

# Overrides the default mapping between harddisk names and the BIOS'
# harddisk order. Use with caution.
#disk=/dev/hde
#    bios=0x81

disk=/dev/sda
    bios=0x80

# Specifies the boot device.  This is where Lilo installs its boot
# block.  It can be either a partition, or the raw device, in which
# case it installs in the MBR, and will overwrite the current MBR.
#
boot=/dev/sda

# Specifies the device that should be mounted as root. (`/')
#
root=/dev/md0

<snip>

# Kernel command line options that apply to all installed images go
# here.  See: The `boot-prompt-HOWO' and `kernel-parameters.txt' in
# the Linux kernel `Documentation' directory.
#
# append=""

# Boot up Linux by default.
#
default=Linux

image=/vmlinuz
	label=Linux
	read-only
	initrd=initrd.img
#	restricted
#	alias=1

<snip>

-now I install the kernel-image-2.4.26-1-686, in my case it's 
  already installed
  so I issue #apt-get --reinstall install kernel-image-2.4.26-1-686.
  This is an initrd kernel (hence the initrd line in lilo.conf),
  which should take care of the fs,raid driver nastiness.
-then I run #lilo
  which issues some errors but still installs
  *Linux
   Linux-old
-edit /etc/fstab to mount /dev/md0 on /
- #exit (exit the chroot) 
-unmount /mnt2/proc
-umount /mnt2
-light incense, feed goat and pray
-reboot


after this I had a system that booted with /dev/md0 as / .Having this working
system I happily attached a tape-drive to the scsi-chain which made lilo
explode (L99 L99 L99 etc.), after which I had to redo every step (most of which
ofcourse I had already forgotten :)

For as far as I know the voodoo bit is somewhere in the beginning of
the lilo.conf, around the bios line, but I could be totally wrong.

A lot of steps may or may not be absolutely redundant or not even 
relevant to the problem, and I might even have forgotten some
essential steps, but this is to my recollection what I had to
do to make it happen.


If it fails and you want to try the procedure with some tweaking,
it's best to start from the top, and rebuild a clean synched /dev/md0 with
a filesystem on which to install lilo.
With clean I mean really clean, MBR, superblock, a newly fdisked partition
with type FD, otherwise confusing stuff might happen.


If all works well you end up with a single raid partition (and swaps).


I tried a lot of things, so the order of the steps might not be 
exactly right, or the commands misspelled etc.., since I can't 
exactly recollect them.

I've been at this for a long time now, so I'm not exactly in 
my most eloquent disposition atm. I tried to jot everything 
down to the best of my abilities at this point. However, if 
you have questions because any the above is unclear, fuzzy 
or wrong, I'll be glad to hear about it.


Good luck,
     Andreas



Reply to: