/dev/ 文件夹内。因为 Debian Squeeze 版本使用源自 Linux 核心的硬盘命名架构,所有的硬盘 (IDE/PATA、SATA、SCSI、USB、IEEE 1394) 都以 /dev/sd* 表示。
/dev/sda1 是第一个磁盘的第一个分区,而 /dev/sdb3 是第二个磁盘的第三个分区。
/dev/sda5,然后是 /dev/sda6,余此类推。
udev 以固定的名称,添加 /dev/sd* 以外的符号链接,就能够轻易的辨识硬式磁盘机。这种符号链接保存在 /dev/disk/by-id 之内。例如,在两个实体磁盘的机器,可以找到如下的消息:
mirexpress:/dev/disk/by-id#ls -ltotal 0 lrwxrwxrwx 1 root root 9 23 jul. 08:58 ata-STM3500418AS_9VM3L3KP -> ../../sda lrwxrwxrwx 1 root root 10 23 jul. 08:58 ata-STM3500418AS_9VM3L3KP-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 23 jul. 08:58 ata-STM3500418AS_9VM3L3KP-part2 -> ../../sda2 [...] lrwxrwxrwx 1 root root 9 23 jul. 08:58 ata-WDC_WD5001AALS-00L3B2_WD-WCAT00241697 -> ../../sdb lrwxrwxrwx 1 root root 10 23 jul. 08:58 ata-WDC_WD5001AALS-00L3B2_WD-WCAT00241697-part1 -> ../../sdb1 lrwxrwxrwx 1 root root 10 23 jul. 08:58 ata-WDC_WD5001AALS-00L3B2_WD-WCAT00241697-part2 -> ../../sdb2 [...] lrwxrwxrwx 1 root root 9 23 jul. 08:58 scsi-SATA_STM3500418AS_9VM3L3KP -> ../../sda lrwxrwxrwx 1 root root 10 23 jul. 08:58 scsi-SATA_STM3500418AS_9VM3L3KP-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 23 jul. 08:58 scsi-SATA_STM3500418AS_9VM3L3KP-part2 -> ../../sda2 [...] lrwxrwxrwx 1 root root 9 23 jul. 08:58 scsi-SATA_WDC_WD5001AALS-_WD-WCAT00241697 -> ../../sdb lrwxrwxrwx 1 root root 10 23 jul. 08:58 scsi-SATA_WDC_WD5001AALS-_WD-WCAT00241697-part1 -> ../../sdb1 lrwxrwxrwx 1 root root 10 23 jul. 08:58 scsi-SATA_WDC_WD5001AALS-_WD-WCAT00241697-part2 -> ../../sdb2 [...] lrwxrwxrwx 1 root root 9 23 jul. 16:48 usb-LaCie_iamaKey_3ed00e26ccc11a-0:0 -> ../../sdc lrwxrwxrwx 1 root root 10 23 jul. 16:48 usb-LaCie_iamaKey_3ed00e26ccc11a-0:0-part1 -> ../../sdc1 lrwxrwxrwx 1 root root 10 23 jul. 16:48 usb-LaCie_iamaKey_3ed00e26ccc11a-0:0-part2 -> ../../sdc2 [...] lrwxrwxrwx 1 root root 9 23 jul. 08:58 wwn-0x5000c50015c4842f -> ../../sda lrwxrwxrwx 1 root root 10 23 jul. 08:58 wwn-0x5000c50015c4842f-part1 -> ../../sda1 [...] mirexpress:/dev/disk/by-id#
lilo。忘记的话,移除或更新核心后,新的核心就不会在磁盘的原来位置,以致系统无法启动。
/etc/lilo.conf;一个简单的文件供标准配置之用,如下例。
例 8.3. LILO 配置文件
# The disk on which LILO should be installed. # By indicating the disk and not a partition. # you order LILO to be installed on the MBR. boot=/dev/sda # the partition that contains Debian root=/dev/sda2 # the item to be loaded by default default=Linux # the most recent kernel image image=/vmlinuz label=Linux initrd=/initrd.img read-only # Old kernel (if the newly installed kernel doesn't boot) image=/vmlinuz.old label=LinuxOLD initrd=/initrd.img.old read-only optional # only for Linux/Windows dual boot other=/dev/sda1 label=Windows
grub-install /dev/sda 命令就能够把它安装在第一个磁盘的 MBR。
/boot/grub/grub.cfg 内,但该文件 (在 Debian 环境下) 以其他方式产生。不可以人工方式修改它,否则在下次运行 update-grub 时 (更新多个软件包时需运行它),将失去该等修改的内容。修改 /boot/grub/grub.cfg 文件 (添加给核心使用的参数或改变显示菜单的时间,举例而已) 通常经由 /etc/default/grub 的变量。添加条目至菜单时,可以新建 /boot/grub/custom.cfg 文件或修改 /etc/grub.d/50_custom 文件。更复杂的配置,可以修改 /etc/grub.d 内的其他文件,或添加之;这些脚本应送回配置的片断,很可能是外部程序做的修改。这些脚本将更新启动的核心:10_linux 考量安装 Linux 核心;20_linux_xen 考量 Xen 虚拟系统,而 30_os-prober 则列出其他的操作系统 (Windows、OS X、Hurd)。
ybin 程序安装 yaboot 及其配置档。修改 /etc/yaboot.conf 文件后 (在启动程序分区复制,且 yaboot 知道如何到磁盘找寻核心的位置),需再次运行此命令。
例 8.4. Yaboot 配置文件
# bootstrap partition
boot=/dev/sda2
# the disk
device=hd:
# the Linux partition
partition=3
root=/dev/sda3
# boot after 3 seconds of inactivity
# (timeout is in tenths of seconds)
timeout=30
install=/usr/lib/yaboot/yaboot
magicboot=/usr/lib/yaboot/ofboot
enablecdboot
# last kernel installed
image=/vmlinux
label=linux
initrd=/initrd.img
read-only
# old kernel
image=/vmlinux.old
label=old
initrd=/initrd.img.old
read-only
# only for Linux/Mac OSX dual-boot
macosx=/dev/sda5
# bsd=/dev/sdaX and macos=/dev/sdaX
# are also possible