Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> Linux資訊 >> 更多Linux

SCSI 硬碟的安裝與 initrd 客製

用 SCSI 硬碟開機時,核心必須能載入 SCSI 驅動才能接手指控。若核心沒有把驅動編進去,就得靠 initrd 補上。

先檢查 initrd 裡有什麼

想知道 initrd.img 包含哪些驅動:

cat initrd.img | gunzip > /tmp/myinitrdfs
mkdir /mnt/tmp
mount -o loop -t ext2 /tmp/myinitrdfs /mnt/tmp

接著看 /mnt/tmp 裡 linuxrc 的內容,就能知道開機時會 insmod 哪些模組。

把新的 SCSI 驅動塞進去

例如要加入 aic7xxx.o:

cd /mnt/tmp
vi linuxrc
# 加上一行:insmod /lib/aic7xxx.o
cp /lib/modules/`uname -r`/scsi/aic7xxx.o lib/
cd /
umount /mnt/tmp
dd if=/tmp/myinitrdfs | gzip > /boot/initrd2.img

這樣 initrd2.img 就含 aic7xxx 驅動了,修改 lilo.conf 或 grub.conf 指向它即可。

安裝時現場載入模組

以 Adaptec AACRAID 為例:在 Installation Method 選 Local CD-ROM;在 Devices 視窗按 Tab 選 Add Device;選擇 Adaptec AACRAID (aacraid),再選 Specify module parameter;按下 OK 進入 Module Parameters,在 Miscellaneous 欄位填入形如 aacraid_pciid=0x1028,0x0A,0x1028,0x0121 的裝置 ID(實際數值需查你所用控制卡的資料);最後 OK 繼續安裝。

另一個常見做法是用 mkinitrd 直接產生含指定模組的映像:mkinitrd --with=aic7xxx /boot/initrd.img 2.4.x,比手工解包再打包安全得多。

Copyright © Linux教程網 All Rights Reserved