|
|

楼主 |
发表于 2004-11-19 14:32:52
|
显示全部楼层
=>Install debian to ICH5/R's SATA Disk<= here ~~~!!
Toshikazu Aiyama <tyaiyama@yahoo.com>
Version: 0.5
Date Last Modified: February 29th, 2004
This write-up enables a SATA drive connected to ICH5/R as a boot drive in debian. If you know how to "cross-install" in other distribution, you can follow the similar path easily. The whole task involves debian install to a PATA disk with kernel recompile, and another debian install to a SATA disk with kernel recompile.
1. Introduction
The recent new PC market is populated with PCs based on Intel's 865/875 chipsetts. Its ICH5 can accommodate 2 channels of EIDE each channel supporting dual ATAPI devices each, and 2 channels of SATA each supporting a single device, all together 6 ATA devices.
Recently linux kernel 2.4.25 has been released, and it supports ICH5 but not RAID. The recent trend in kernel treats a SATA disk as if it is a SCSI disk. We do not like a SCSI implementation because it allows to partition only up to 15 sections. ATA implementation, however allows us up to 63rd partitions. One partition has to be allocated to an extended partition regardless of SATA's actual implementation; thus actual difference is 14 against 62, almost 4 times.
Furthermore today's ever increasing size of hard disk, good practice to allocate several partitions to install an OS, and the need of capability of multi-boot combined together strongly support ATA implementation of SATA disk.
The current debian installer does not directly let you install debian to a SATA hard disk attached to Intel ICH5. Furthermore we still doubt the next release of debian "sarge" will let you install to it. For the time being, a distribution has to allow "cross-install" easily to install linux.
We have now succeeded to boot sarge direct from the SATA disk not treating it as a SCSI. We succeeded to boot up woody directly from the SATA drive in summer 2003. We employed kernel 2.4.22 and ASUS P4P800, and its SATA is supported through ICH5R. Now we use GA-8I875 and GA-8IPE1000 Pro2 to confirm the procedures. We will intend to verify ASUS and Intel motherboard later. We firmly believe the basic process is good enough to be applicable to any motherboard using ICH5 or ICH5R. Needless to say, there are some differences in BIOS setting terminology. But what we would like to accomplish is clear enough; thus you can figure out for your own motherboard.
The installation process requires two hard disks: one PATA and one SATA. And depending on the installation method, a floppy or a CD-ROM drive may also be necessary. Our previous example system's hardware configuration was as follows:
Motherboard: ASUS P4P800
Primary Master: Maxtor 4R120L0
Primary Slave: None
Secondary Master: Panasonic DVD-ROM SR8585
Secondary Slave: Pioneer DVR-A05-J
SATA Primary: Seagate ST3120026AS
SATA Secondary: None
Our new systems' configuration is as follows:
M/B Gigabyte GA-8I875 875/ICH5R
M/B Gigabyte GA-8IPE1000 Pro2 865/ICH5
2. Prerequisite
A linux network driver for your NIC (for example, some Asus M/B, 3COM 3C940) should be downloaded elsewhere, and it should be readily available without further downloading during the installation process because the procedure explained here is basically network install. Your system's NIC linux driver is absolute bare minimum necessity; otherwise you fail to install/upgrade the system.
Next, linux kernel 2.4.25/2.6.3 or other kernel source which can recognize intel ICH5-SATA properly should be downloaded, and be readily available for convenience. Needless to say, you may download it after you install stock debian, but it requires making nonstandard network driver module twice, if your NIC falls in this category.
Finally, a partition plan for SATA disk should be prepared in advance. We strongly recommend to set at least four separate partitions: root, swap, /var, and /usr. Note that one swap partitions default maximum size is previously 2GB per partition. But now you can allocate 4GB in one shot. We do not know the limit per partition now. But considering P4's physical address space, what is the point of allocating more than 4GB?
3. Major Steps Summary
The basic flow of steps are presented bellow and somewhat detailed explanation of these steps are illustrated in the subsequent sections.
1. At BIOS setup, disable the SATA drives.
2. Using whatever method, install debian to the PATA disk.
3. Upgrade its kernel with appropriate options to recognize the SATA disk.
4. At BIOS setup, enable the SATA drives.
5. Install debootstrap, and using it, install debian to the SATA disk.
6. Complete the basic debian configuration.
7. Install the kernel to the SATA partition.
8. Configure boot manager properly to boot from the SATA partition.
4. Step 1: Disable SATA
Two motherboard cases are explained here. But other cases you can easily guess the steps. Bottom line in this step is disable SATA and make PATA hard disk accessible. We describe Asus(/AMI) case first.
a. At BIOS Setup Main Menu, choose IDE configuration. At the sub-menu, set "On-board IDE Operate Mode" to "Compatible Mode", and set "IDE Port Settings" to " -ATA Ports Only" to disable SATA.
b. At BIOS Setup Boot Menu, set "Boot Device Priority" to as follows:
1st Boot Device [1st FLOPPY DRIV]
2nd Boot Device [SM-MATSHITADVD-]
3rd Boot Device [PM-Maxtor 4R120]
c. At the same menu, set "Hard Disk Drives" to as follows:
1st Boot Device [PM-Maxtor 4R120]
In case of Gigabyte(/Award), at BIOS setup main menu, choose "Integrated Peripherals". Then in the sub-menu, set "On-Chip SATA" to "Disabled". Make sure the BIOS can see the normal PATA disks.
Unless you disable SATA, debian install fails in the middle of the bootstrap. Before exiting BIOS setup, always choose "save changes and exit".
5. Step 2: Debian Install
Debian sarge network install is illustrated elsewhere in this url (in progress) or at debian-installer site. If you would like to read the complete manual it is here. You need to have several information before install like network parameters, partition to install, and etc.
After second stage debian install completes, make sure you have proper /etc/apt/sources.list file. Current installer produces a wrong one because it is targeted to be installed as a stable release. Since we would like to install through network, we do not need CD-ROM reference; thus we must comment it out. Also since sarge is not "stable"; thus it is not maintained by a security team; therefore we must comment it out, too. After you change the file, do not forget to update it by:
# apt-get update
# apt-get dist-upgrade
Since current one may require restart, we do if it is required:
# shutdown -r now
6. Step 3: Kernel Install
Debian stock kernel does not let the system to recognize SATA drive properly; rather it hangs if you try to; thus you need to change kernel behavior by installing some modules. But we do not know which modules are necessary, and whether they are modularized at a stock debian kernel.
We use wget to download kernel 2.4.25.
# cd /usr/src
# wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.25.tar.bz2
You may use different download site. Kernel mirrors are listed at http://www.kernel.org/mirrors/.
A linux kernel 2.4.x installation is best explained in this url. Our 2.4.25 kernel configuration file is here. Our kernel configuration let your system recognize SATA disk properly. But we configure it to suit our needs; thus you are strongly encouraged to modify it to suit your own needs. You can further investigate what is involved kernel in 2.4.x configuration in the reference section. Also 2.6.x kernel compilation involves some different procedures; thus you need to reference some other url.
Current default debian install uses grub not lilo as boot manager; thus you need to edit /boot/grub/menu.lst to reflect the upgrade of the kernel. We use a brute force edit of the file. You can see our file here. Finally, you need to power up to a new kernel by:
# shutdown -r now
7. Step 4: Enable SATA
If your PC motherboard is made by Asus, then follow these steps:
a. At BIOS Setup Main Menu, choose IDE configuration. At the sub-menu, set "On board IDE Operate Mode" to "Enhanced Mode", and set "Enhanced Mode Support On" to " -ATA+S-ATA" to enable SATA.
b. At BIOS Setup Boot Menu, set "Hard Disk Drives" to as follows:
1st Drive [PM-Maxtor 4R120]
2nd Drive [3M-ST3120026AS]
In case of Gigabyte(/Award), at BIOS setup main menu, choose "Integrated Peripherals". Then in the sub-menu, set "On-Chip SATA" to "Manual". Assuming a SATA disk is attached to SATA0, set "SATA Port0 configure as" to "SATA Port0" in the same submenu.
In all motherboard, make sure that ICH5R's RAID function is disabled, if your motherboard chip-sets consist of ICH5R. Finally, choose "Save & Exit Setup" before exiting BIOS setup. Make sure the system can see both PATA and SATA disks.
8. Step 5: Install The Base System
Verify ICH5-SATA is properly recognized at start up, by using Alt+PageUp/PageDown, or by viewing /var/log/dmesg. Then follow these steps:
a. Install debootstrap.
# apt-get install debootstrap
b. Partition the SATA disk as you planned. Create at least 2 partitions, one root and another swap.
# fdisk /dev/hde
c. Create file systems to non-swap partitions. For example, to create an ext3 file system on partition /dev/hde10 (that's our sample root partition):
# mkfs.ext3 /dev/hde10
d. Initialize the swap partition (substitute the partition for your planned swap partition):
# mkswap /dev/hde14
e. Create a mount point for the new SATA root partition, and mount to it the partition created at sub-step c. Since we would like to have separate partitions for /usr and /var, we also create these mount points, and mount the partitions to them. If you would like to have other separate partitions, follow a similar steps. Just make sure you create a parent directory first, mount a partition, then create sub-directory, and finally mount a corresponding partition.
# mkdir /mnt/target
# mount /dev/hde10 /mnt/target
# mkdir /mnt/target/usr
# mkdir /mnt/target/var
# mount /dev/hde7 /mnt/target/usr
# mount /dev/hde16 /mnt/target/var
f. Using debootstrap, create the basic debian system on /mnt/target.
# debootstrap --arch i386 sarge /mnt/target \
http://http.us.debian.org/debian
If you want to install sarge or woody, substitute sarge for it. Since sid are unstable stage, you need to be good at debootstrap options and later some adjustments. Just get prepared some errors/abnormal events, we have warned you.
Furthermore, if you would like to use faster http site, choose an appropriate debian mirror site. The list of mirror is available at http://www.debian.org/mirror/list. We live in Japan, and our provider is Asahi-net; thus we use: local mirror http://ring.asahi-net.or.jp/archives/linux/debian/debian. But sometimes this local mirror is in a confused state, and let debootstrap produces some phony errors. Thus we frequently use an authoritative mirror in Japan http://ftp.jp.debian.org/debian. You may experience similar errors, then try to change your mirror.
9. Step 6: Configure The Base System
Now a debian base system is in partitions of ICH5/R's attached SATA disk. We need to configure the system before kernel install and the subsequent reboot.
a. chroot into the root partition to configure the system.
# chroot /mnt/target /bin/bash
b. Create /etc/fstab. Our sample fstab is here.
c.Mount all the file systems you have specified in your /etc/fstab. And also mount /proc.
# mount -a
# mount /proc
d. Complete the 2nd stage debian basic configuration
# /usr/sbin/base-config
e. Configure network by editing /etc/network/interfaces, and /etc/hosts. Our sample /etc/network/interfaces file is here, and our sample /etc/hosts file is there. Restart the network:
# /etc/init.d/networking restart
f. Edit /etc/apt/sources.list, and then update it. Our sample /etc/apt/sources.list file is here.
# apt-get update
# apt-get dist-upgrade
A. Step 7: Install The Kernel
Here we install our real target kernel different from Step 3. We should be careful its installation.
a. Install kernel 2.4.25. You can use the same configuration file used in step 3.
b. If necessary, install network module because P4P800's NIC driver is not supported by the kernel.
c. Edit /etc/modules. Our sample /etc/modules file is here.
d. Edit /etc/lilo.conf. Our sample /etc/lilo.conf file is here. We use multi-drive, multi-partition boot floppy to choose which drive, which partition to boot from. If you use the same one or similar one, you can write /etc/lilo.conf similar to us; otherwise you need to install the boot code to MBR of /dev/hda if you choose to boot from Primary Master disk, or /dev/hde if you choose to boot from SATA disk. Anyway unless you use some sort of boot-disk-free software, you need to adjust your lilo.conf and BIOS setting to match your need.
If you would like to use ours it is in our assembly language section. We can install it to a MBR of a hard disk, but I do not place it there. Our floppy-based bootstrapper does not change anything even MBR of disks, and can freely test any OS boot-up from MBR or any partitions of any ATA disk.
e. Install lilo.
# /sbin/lilo -v
f. Unmount all partitions, exit from chroot environment, and reboot.
# umount -a
# exit
# shutdown -r now
B. Step 8: BIOS setting change
If necessary, at BIOS Setup Boot Menu, set "Hard Disk Drives" to as follows:
1st Drive [3M-ST3120026AS]
2nd Drive [PM-Maxtor 4R120]
C. Step 8: Review system boot-up and fix
Review carefully what error messages the system produces. Use Alt-PgeUp or PageDown to review the most recent messages. Also examine /var/log/dmesg carefully. Some messages we know how to fix them; other we do not know, or we care less about them. If after shutdown reboot
Warning: Fake start-stop-daemon called, doing nothing
shows up, then fix it by:
# mv /sbin/start-stop-daemon.REAL /sbin/start-stop-daemon
D. Conclusion
The whole procedure is an example of a linux cross-install. We did not develop any codes, we just have shown you how to use cross-install facility of debian. Thus we are heavily dependant on the success of debian-installer development, and kernel, of course. Even though we have tested using both 865 and 875 based PCs, there may be some errors. Please let us know by mailing to us. Also if you have any questions, please mail to us. We will try our best to promptly answer your inquiry. Thank you for your interest in our url.
E. References
http://www.debian.org/releases/stable/i386/ch-preparing.en.html
http://lists.debian.org/debian-b ... 00207/msg00084.html |
|