Installing
Debian
Sarge on a Sata Drive
Date: 6/23/05
This article discusses how to install Debian Sarge on a sata drive. It
assumes that you have a currently working Debian installation on an IDE
drive in your system.
Introduction:
Host System
Soyo Dragon Platinum Plus motherboard
AMD 2600XP processor
2 IDE drives
1 Maxtor 80 gig sata drive using a VT6421 PCI controller
Via-rhine NIC PCI card
512 mb DDR RAM
Microtek SlimScan C6 USB scanner
HP LaserJet 5L printer
The final version of Debian Sarge 3.1r0a was used, using the
2.6.11-1-k7 kernel, which supports sata drives and the host controller.
Acknowledgment:
This
article borrows heavily from the fine article by Toshikazu Aiyama, Install debian to
ICH5/R's SATA disk.
1 This article will be used i
it's entirety as a reference.
Description:
Debian Sarge was already installed on my primary hard drive. I wanted
to install Debian on my sata drive, but the Debian installer did not
recognize the PCI controller.
The stock 2.6.8 kernel did not see the sata controller. I upgraded the
kernel using apt-get, retrieving the kernel-image and kernel headers
2.6.11.-1-k7 packages, appropriate for my system. Once the new kernel
was booted, the controller was recognized and I could manipulate the
sata drive.
My method differed from Mr. Aiyama's, in that i already had a working
Debian system that could recognize the sata drives. Steps 1-4 were
bypassed and I moved on to step 5, setting up the sata drive.
The 2.6.11-1-k7 kernel saw my sata drive as sda. No problem. I just
substituted sda for hde in his directions.
Procedure;
First, I installed the bootstrap package using apt-get.
#apt-get install bootstrap
My sata hard drive was set up using PartitionMagic, however, Debian
still did not see the partitions correctly. My ext3 partition
was
on sda5 and the swap file on sda5, so;
# mkfs.ext3 /dev/sda5
# mkswap /dev/sda6
Moving on to mounting the sata partiton and making the /usr and /var
directories on the root drive;
# mkdir
/mnt/target
# mount /dev/sda5 /mnt/target
# mkdir /mnt/target/usr
# mkdir /mnt/target/var
Creating the basic Debian system (step 6);
# debootstrap --arch i386 sarge
/mnt/target \
http://http.us.debian.org/debian
Make sure that you have the appropriate fstab set up. I used Mr.
Aiyama's sample file and changed my root partition from hde to sda5
NOTE:
Remember, I am working off a
currently working Debian installation. So you can use the File Manager
in superuser mode to edit your /etc/fstab.
Chroot to the new drive;
#chroot /mnt/target /bin/bash
Mount the proc system
#mount -a
#mount /proc
Completed the 2nd stage debian basic configuration
# /usr/sbin/base-config
Edit the /etc/network/interfaces file to match the one in my working
Debian installation.
Copied my /etc/hosts file to the new install.
Copied Mr. Aiyama's sample /etc/apt/sources.list file to the base file
on the new installation in /mnt/target (we will use this later on)
Complete the 2nd stage debian basic configuration
# /usr/sbin/base-config
This will install all the base packages that you will need to get the
base system going.
Installing a working kernel
At this point, you are chroot'ed to the new installation. So installing
the kernel will effect changes on the new sata installation. At a
terminal as root user;
#apt-get update
#apt-get install kernel-image-2.6.11-1-k7
#apt-get install
kernel-headers-2.6.11-1.k7 (this
will assure that the kernel headers are present when we need
them
later to configure the wireless LAN).
#apt-get install grub (this installs the
grub
package that we will be using later on).
At this point, you should have a basic Debian installation that will
allow you to boot your new Debian installation from your currently
working Debian system.
We are almost there. We now have to tell your currently working Debian
installation how to boot the new one on the sata drive. We will now add
the drive specification for the sata drive to your currently working
Debian system.
To your /boot/grub/device.map file, add;
(hd2).
/dev/sda
So that in my case, I have;
(fd0)
/dev/fd0
(hd0)
/dev/hda
(hd1)
/dev/hdb
(hd2)
/dev/sda
...where hd0 is my primary master, hd1 is my primary slave and hd2 is
my sata drive, as seen by Debian. The sata drive has no master/slave
designation.
Finally, tell grub where to find your vmlinuz and initrd files on the
sata drive, by adding the following (in my case);
title Debian sata sda5
root (hd2,4)
kernel /boot/vmlinuz-2.6.11.1-k7
root=/dev/sda5 ro
initrd /boot/initrd.img-2.6.11-1-k7
You
should now be able to boot into
your new installation on the sata drive!
References:
1. Install
debian to ICH5/R's SATA disk
2. No
DVD/DVDRW recognized
in Debian testing...