Migrating Debian to SATA disks
what's this?
At work we weren't able to install a Dell PowerEdge 750 with real (read: libata) SCSI-level support. So we had installed the drive just as an IDE-disk using the standard Intel ICH5 chipset support in the kernel. One big problem, it doesn't support DMA at all. So readtimes are very slow, not very attractive if the server is a webserver :]. So, I went to the Gathering of Tweakers to discuss what to do. They tipped me to try a 2.6 kernel. Good idea, hadn't really thought about that, because I was more wondering how to turn off the emulated (PATA)-mode in the BIOS. Because of those Mickey Mouse BIOS used in Dell servers. And I can tell you that was the solution. So on this page you will find a description how everything took place. I have already published some of this info at my log.
who needs this?
Anyone who have installed their Debian Woody or Sarge to a normal harddisk (or at an emulated SATA-disk) and like to migrate it to a real SCSI-layer driver SATA disk (sdx).
starting
As said, I should have tried the 2.6-kernel according to the people at GoT. Because I was still running the 2.4-tree I also needed to upgrade some small libraries by hand. That (together with the LILO/Grub) difference makes it hard to make this howto also work for both Debian Woody and Sarge, so I have splitted it up.
Woody
First we've compiled a newer version of module-init-tools, which is needed due to the new module system in 2.6. Compiling shouldn't be to hard, but use `--prefix=''' instead of the regular path (/usr/local). You maybe also need to remove the SGML lines from your Makefile after you have ran configure rule. Then, before running `make install' make sure that you have moved the old modutils (/sbin/lsmod, /sbin/rmmod, /sbin/insmod, /sbin/depmod and /sbin/modprobe) to a backup directory. Otherwise module-init-tools will not copy the new binaries to the right destination.
Next thing to do is edit your /etc/fstab. Here you have to change your hd partitions to sd partitions. For example, if you had a line like:
/ /dev/hda1 ext3 yadayadayada
change it to
/ /dev/sda1 ext3 yadayadayada
Now you have to download and burn a Knoppix Live CD. Don't reboot to the normal situation yet! It won't work because your modified fstab.
Now it's time to compile your new 2.6 kernel, I hope you don't need much help here, in the future there maybe some helpt at my kernel page. What you have to enable is SCSI-support and SATA support under the SCSI low-level drivers category. Also pick the right SATA chipset out of that submenu. In our case that would be: `Intel PIIX/ICH SATA support'. Now compile your kernel and put it into your /boot directory. Now comes the tricky part. Reboot but boot on your Knoppix CD-ROM. When the Knoppix menu is on boot in console mode only (type `knoppix 2').
After the boot, you have to mount the root partition like this:
mount -o dev /dev/sda1 /mnt/sda1
Huh? SCSI-disks? That's right, Knoppix detected the SATA-disks as SCSI-disks, that's exactly what our kernel has to do next reboot...
When you have mounted the root disk it's time to chroot to that disk:
chroot /mnt/sda1
You're back in your own system. Now edit `nano /etc/lilo.conf' and replace every /dev/hda for example to /dev/sda, and /dev/hda1 to /dev/sda1, etc. etc. Close the editor and run:
lilo
Your system has to be ready to reboot by now. So: let's `exit' the chroot, `unmount /mnt/sda1' the disk and `reboot'. If you had run through everything ok your system has to be boot like a SCSI-system! So your SATA-disk drivers run onder the SCSI-layer.
Sarge
Just run:
apt-get install module-init-tools
Yep, Sarge has a package for that. Now you have to edit fstab just like described above at the Woody-setup.
Because Sarge does not use LILO as its standard boot loader but Grub there's a small difference between both setups. We don't need a Knoppix CD here (unless you screw up ;]). What you have to do is open `/boot/grub/menu.lst' and put a new title section up with the name of your fresh-compiled kernel. Copy the `root' value from the previous kernel, don't change it (if it was root (hd0,0), leave it to (hd0,0)). The only thing you have to change is the root value after kernel. If you had for example this title block:
title Debian GNU/Linux, kernel 2.4.31
root (hd0,0)
kernel /boot/kernel-2.4.31 root=/dev/hda1 ro
savedefault
boot
Change it like this:
title Debian GNU/Linux, kernel 2.6.12, with sata
root (hd0,0)
kernel /boot/kernel-2.6.12 root=/dev/sda1 ro
savedefault
boot
Note the difference at the root parameter. Double check everything, otherwise you either have to get your Knoppix CD. When everything has been changed it's time te reboot. This also goes like the Woody setup.
sources
- Debian install manual - Technical information on the Boot Floppies
- IntelĀ® PRO/10/100/1000/10GbE Drivers
enhancements, questions, etc.
I hope this was quite useful, if you have any enhancements/questions/other things don't hesitate to contact me.
