Product SiteDocumentation Site

8.8. ضبط محمّل الإقلاع

الأغلب أن محمّل الإقلاع يعمل بشكل سليم، لكن من الجيد دوماً معرفة طريقة إعداد وتثبيت مُحمِّل الإقلاع في حال اختفى من سجل الإقلاع الرئيسي، خصوصاً بعد تثبيت نظام تشغيل آخر، مثل ويندوز. قد تساعدك المعلومات التالية على تعديل إعدادات محمل الإقلاع إذا احتجت لذلك.

8.8.1. التعرف على الأقراص

Configuration of the bootloader must identify the different hard drives and their partitions. Linux uses “block” special files stored in the /dev/ directory, for this purpose. Since Debian Squeeze, the naming scheme for hard drives has been unified by the Linux kernel, and all hard drives (IDE/PATA, SATA, SCSI, USB, IEEE 1394) are now represented by /dev/sd*.
يمثّل كل قسم برقمه على القرص الذي يحويه: مثلاً، /dev/sda1 هو القسم الأول من القرص الأول، و /dev/sdb3 هو القسم الثالث على القرص الثاني.
The PC architecture (or “i386”, including its younger cousin “amd64”) has long been limited to using the “MS-DOS” partition table format, which only allows four “primary” partitions per disk. To go beyond this limitation under this scheme, one of them has to be created as an “extended” partition, and it can then contain additional “secondary” partitions. These secondary partitions are numbered from 5. Thus the first secondary partition could be /dev/sda5, followed by /dev/sda6, etc.
Another restriction of the MS-DOS partition table format is that it only allows disks up to 2 TiB in size, which is becoming a real problem with recent disks.
A new partition table format called GPT loosens these constraints on the number of partitions (it allows up to 128 partitions when using standard settings) and on the size of the disks (up to 8 ZiB, which is more than 8 billion terabytes). If you intend to create many physical partitions on the same disk, you should therefore ensure that you are creating the partition table in the GPT format when partitioning your disk.
ليس سهلاً دائماً أن تتذكر أي قرص يتصل بأي متحكم SATA، أو أي قرص هو الثالث في سلسلة SCSI، خصوصاً وأن تسمية الأقراص الصلبة التي تدعم التوصيل الساخن (وهذا يشمل معظم أقراص SATA والأقراص الخارجية وغيرها) قد تتغير بعد إعادة الإقلاع. لحسن الحظ، ينشئ udev روابطاً رمزية أسماؤها ثابتة بالإضافة إلى /dev/sd*، يمكنك استخدامها إذا كنت تريد تعريف القرص الصلب بطريقة غير غامضة. تُخزَّن هذه الروابط الرمزية في /dev/disk/by-id. يمكن أن تجد التالي مثلاً على جهاز فيه قرصين فيزيائيين.
mirexpress:/dev/disk/by-id# ls -l
total 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# 
لاحظ أن بعض الأقراص قد ذكرت عدة مرات (لأنها تتصرف كأقراص ATA و SCSI في آن معاً)، لكن المعلومات المهمة هي موديل القرص ورقمه التسلسلي أساساً، التي تتيح لك التعرف على ملف الجهاز الملحق.
تعتمد ملفات الضبط المعطاة في الأمثلة في الأقسام التالية على هذا الإعداد نفسه: قرص SATA وحيد، حيث يحوي القسم الأول نسخة ويندوز سابقة والثاني يحوي دبيان غنو/لينكس.

8.8.2. ضبط LILO

LILO‏ (Linux Bootloader، أو مُحمِّل لينكس) هو أقدم محمّل إقلاع — صلب لكنه صدئ. يعتمد LILO على كتابة العنوان الفيزيائي للنواة التي ستقلع في MBR، ولهذا يجب أن تتبع كل تحديث لها (أو لملف إعدادات LILO) بالأمر lilo. إذا نسيت عمل ذلك سيعجز النظام عن الإقلاع إذا أزيلت النواة القديمة أو استبدلت لأن النواة الجديدة لن تكن في الموقع نفسه على القرص.
ملف إعدادات 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

8.8.3. GRUB 2 Configuration

GRUB‏ (Grand Unified Bootloader ، أو مُحمِّل الإقلاع الموحد الكبير) هو محمّل إقلاع أحدث. لا يشترط استدعاؤه بعد كل تحديث للنواة؛ إذ أن GRUB يعرف كيف يقرأ نظم الملفات ويعثر على القسم الذي يحوي النواة على القرص وحده. لتثبيت GRUB على MBR القرص الأول، فقط اطبع grub-install /dev/sda.
GRUB 2 configuration is stored in /boot/grub/grub.cfg, but this file (in Debian) is generated from others. Be careful not to modify it by hand, since such local modifications will be lost the next time update-grub is run (which may occur upon update of various packages). The most common modifications of the /boot/grub/grub.cfg file (to add command line parameters to the kernel or change the duration that the menu is displayed, for example) are made through the variables in /etc/default/grub. To add entries to the menu, you can either create a /boot/grub/custom.cfg file or modify the /etc/grub.d/50_custom file. For more complex configurations, you can modify other files in /etc/grub.d, or add to them; these scripts should return configuration snippets, possibly by making use of external programs. These scripts are the ones that will update the list of kernels to boot: 10_linux takes into consideration the installed Linux kernels; 20_linux_xen takes into account Xen virtual systems, and 30_os-prober lists other operating systems (Windows, OS X, Hurd).

8.8.4. خاص بحواسيب ماكنتوش (PowerPC): ضبط Yaboot

Yaboot هو محمل الإقلاع الذي تستخدمه حواسيب ماكنتوش القديمة التي تستخدم معالجات PowerPC. لا تقلع هذه الحواسيب كالحواسيب الشخصية PC، بل تعتمد على قسم إقلاع (‎“bootstrap” partition)، يُنفّذ منه BIOS (أو OpenFirmware) محمل الإقلاع، ويثبت البرنامج ybin المحمل yaboot وملف إعداداته على ذلك القسم. تحتاج إعادة تشغيل هذا الأمر فقط في حال تعديل /etc/yaboot.conf (الذي يُنسَخ على قسم الإقلاع، ويَعرِفُ yaboot طريقة العثور على مواقع النَوَى على الأقراص).
يجب أن تملك ملف /etc/yaboot.conf سليم قبل استدعاء ybin. فيما يلي مثالاً عن إعدادات أصغرية.

مثال 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