|
After you modify /etc/lilo.conf, run /sbin/lilo !
|
| w2k | lcp90 |
Links
|
End
|
mapa
|
The boot= directive in /etc/lilo.conf tells Lilo where it should place its primary boot loader. [knoppix]: Specifies the boot device. This is where Lilo installs its boot block.
In general, you can either specify
Para detectar un sistema operativo, Partition Magic comprueba
| Warning : to make an operating system installed on a non-first disk visible for Boot Magic, write the boot loader onto a partition (hdc1, hdc2, etc) and not onto the MBR (hdc). |
When the computer is powered on, a mechanism is required to manipulate interrupts, find the hard disk(s), and launch code necessary to load drivers located on the boot drive.
The MBR of a hard disk resides at the first physical sector of the disk : track 0, side 0, sector 1.
Mind that d'512 = h'200
Here, mind d'446 = h'1BE
dd if=full_MBR_of_sda.img of=/dev/sda bs=446 count=1
An MBR has 3 parts:
So, just for fun, let's
dd if=/dev/hda of=hda_mbr.img bs=512 count=1
od -h hda_mbr.img (*** warning : swaps bytes ***)
or
khexdit hda_mbr.img (*** best, GUI ***)
or
emacs hda_mbr.img (not yet in hex)
or
hexdump hda_mbr.img (*** best, command line ***)
Read uSoft about MBR and partition signature != 55AA. Solution = FDISK /MBR.
The structure of the Bootsector ( from HELPPC 2.x by David Jurgens )
To display an existing one (under Linux), you can use "fdisk /dev/hda" plus "x" plus "d"Offset Size (bytes) Description ---------------------------------------------------------------------------- 00h 03 jump to executable code (E9h 3Bh 7Bh) 03h 08 OEM name and version (if wanted) 0Bh 02 bytes per sector 0Dh 01 sectors per cluster (allocation unit size) 0Eh 02 number of reserved sectors (starting at 0) 10h 01 number of FAT's on disk 11h 02 number of root directory entries (directory size) 13h 02 number of total sectors (0 if partition > 32Mb) 15h 01 media descriptor byte (see MEDIA DESCRIPTOR) 16h 02 sectors per FAT 18h 02 (DOS 3+) sectors per track 1Ah 02 (DOS 3+) number of heads 1Ch 02 (DOS 3+) number of hidden sectors 20h 04 (DOS 4+) number of sectors if offset 13h was 00h 24h 01 (DOS 4+) physical drive number 25h 01 (DOS 4+) reserved 26h 01 (DOS 4+) signature byte (29h) 27h 02 (DOS 4+) volume serial number 2Bh 11 (DOS 4+) volume label 36h 08 (DOS 4+) reserved 3Eh-1FDh Bootstrap loader (< 445 bytes) - code + load kernel (COMMAND.COM) 1BEh-1FDh Partition table (only the primary partitions) 1FEh 02 bootsector identifier (AA55h)
The values displayed by Partition Info are :
1. Jump EB5980 15. Big Sectors per FAT 2025 2. OEM Name MSWIN4.1 16. Extended Flags 0000 3. Bytes per Sector 512 17. FS Version 0000 4. Sectors per Cluster 8 18. First Cluster of Root 3387 5. Reserved Sectors 32 19. FS Info Sector 1 6. Number of FATs 2 20. Backup Boot Sector 6 7. Reserved 0000 21. Reserved 000000000000000000000000 8. Reserved 0000 22. Drive ID 80 9. Media Descriptor F8 23. Reserved for NT 00 10. Sectors per FAT 0 24. Extended Boot Sig 29 11. Sectors per Track 63 25. Serial Number 37B9C73D 12. Number of Heads 240 26. Volume Name C_DRIVE 13. Hidden Sectors 63 27. File System ID FAT32 14. Big Total Sectors 2101617 28. Signature AA55
boot=/dev/hda
timeout=50
prompt
default=linux
vga=normal
read-only
image=/boot/vmlinuz-2.2.12-20
label=linux
root=/dev/hda3
other=/dev/hda1
label=nt
dd if=/dev/hda5 of=/bootsect.lnx bs=512 count=1
C:\bootsect.lnx="Mandrake Linux 8.2"
Here's all the lilo.conf I have :
boot = /dev/hda2 install = /boot/boot.b message = /boot/message prompt # wait 20 seconds (200 10ths) for user to select the entry to load timeout = 200 # default entry image = /boot/vmlinuz label = linuxMIN root = /dev/hda2 read-only append = "ide1=0x170,0x376,15" # additional entries image = /boot/vmlinuz label = linuxIDE root = /dev/hda2 read-only append = "ide1=0x170,0x376,15"
boot=/dev/hdc1 #compact # faster, but won't work on all systems. vga = normal # force sane state read-only prompt timeout=100 # End LILO global Section # image = /boot/vmlinuz root = /dev/hdc1 label = SuSeIONNA
boot=/dev/sdc map=/boot/map install=/boot/boot.b prompt timeout=50 linear default=xykra image=/boot/bzImage label=xykra read-only root=/dev/sdc6
boot=/dev/hda map=/boot/map install=/boot/boot.b prompt timeout=50 linear default=linux
image=/boot/vmlinuz-2.2.14-5.0 label=linux read-only root=/dev/hda5
LILO version 21, Copyright 1992-1998 Werner Almesberger Reading boot sector from /dev/hda2 Global settings: Delay before booting: 0.0 seconds Command-line timeout: 20.0 seconds Always enter boot prompt Serial line access is disabled Boot prompt message is 43777 bytes No default boot command line Images: linuxMIN * No password Boot command-line won't be locked No single-key activation VGA mode is taken from boot image Kernel is loaded "high", at 0x00100000 No initial RAM disk No fallback Options: "ro root=302 ide1=0x170,0x376,15" linuxIDE No password Boot command-line won't be locked No single-key activation VGA mode is taken from boot image Kernel is loaded "high", at 0x00100000 No initial RAM disk No fallback Options: "ro root=302 ide1=0x170,0x376,15"
Warning: /dev/hdc1 is not on the first disk LILO version 21, Copyright 1992-1998 Werner Almesberger Reading boot sector from /dev/hdc1 Global settings: Delay before booting: 0.0 seconds Command-line timeout: 10.0 seconds Always enter boot prompt Serial line access is disabled No message for boot prompt No default boot command line Images: SuSeIONNA *No password Boot command-line won't be locked No single-key activation VGA mode: NORMAL Kernel is loaded "high", at 0x00100000 No initial RAM disk No fallback Options: "ro root=1601"
Warning: BIOS drive 0x82 may not be accessible Warning: /dev/sdc is not on the first disk LILO version 21, Copyright 1992-1998 Werner Almesberger Reading boot sector from /dev/sdc Global settings: Delay before booting: 0.0 seconds Command-line timeout: 5.0 seconds Always enter boot prompt Serial line access is disabled No message for boot prompt No default boot command line Images: xykra * No password Boot command-line won't be locked No single-key activation VGA mode is taken from boot image Kernel is loaded "high", at 0x00100000 No initial RAM disk Warning: BIOS drive 0x82 may not be accessible Warning: BIOS drive 0x82 may not be accessible Warning: BIOS drive 0x82 may not be accessible No fallback Options: "ro root=826"
LILO version 21, Copyright 1992-1998 Werner Almesberger Reading boot sector from /dev/hda Global settings: Delay before booting: 0.0 seconds Command-line timeout: 5.0 seconds Always enter boot prompt Serial line access is disabled No message for boot prompt No default boot command line Images: linux * No password Boot command-line won't be locked No single-key activation VGA mode is taken from boot image Kernel is loaded "high", at 0x00100000 No initial RAM disk No fallback Options: "ro root=305"
Disk /dev/hda: 543 cylinders, 32 heads, 63 sectors/track Units = cylinders of 1032192 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/hda1 0+ 293 294- 296320+ 16 Hidden FAT16 /dev/hda2 * 294 508 215 216720 83 Linux /dev/hda3 509 541 33 33264 82 Linux swap /dev/hda4 0 - 0 0 0 Empty Disk /dev/hdc: 1027 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/hdc1 65 1022 958 7695135 5 Extended /dev/hdc2 0+ 64 65- 522081 6 FAT16 /dev/hdc3 1023 1026 4 32130 83 Linux /dev/hdc4 0 - 0 0 0 Empty /dev/hdc5 65+ 511 447- 3590496 b Win95 FAT32 /dev/hdc6 512+ 894 383- 3076416 b Win95 FAT32 /dev/hdc7 895+ 928 34- 273073+ b Win95 FAT32 /dev/hdc8 929+ 1022 94- 755023+ 83 Linux
Disk /dev/hda: 708 cylinders, 16 heads, 63 sectors/track Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/hda1 * 0+ 203 204- 102784+ 6 FAT16 /dev/hda2 204 706 503 253512 5 Extended /dev/hda3 0 - 0 0 0 Empty /dev/hda4 0 - 0 0 0 Empty /dev/hda5 204+ 604 401- 202072+ 6 FAT16 /dev/hda6 605+ 706 102- 51376+ 83 Linux Disk /dev/hdc: 768 cylinders, 14 heads, 62 sectors/track Units = cylinders of 444416 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/hdc1 * 0+ 471 472- 204817 83 Linux /dev/hdc2 472 766 295 128030 82 Linux swap /dev/hdc3 0 - 0 0 0 Empty /dev/hdc4 0 - 0 0 0 Empty
Disk /dev/sda: 379 cylinders, 64 heads, 32 sectors/track Units = cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 * 0+ 277 278- 284656 6 FAT16 /dev/sda2 278 378 101 103424 5 Extended /dev/sda3 0 - 0 0 0 Empty /dev/sda4 0 - 0 0 0 Empty /dev/sda5 278+ 378 101- 103408 6 FAT16 Disk /dev/sdb: 516 cylinders, 64 heads, 32 sectors/track Units = cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sdb1 0+ 515 516- 528368 5 Extended /dev/sdb2 0 - 0 0 0 Empty /dev/sdb3 0 - 0 0 0 Empty /dev/sdb4 0 - 0 0 0 Empty /dev/sdb5 0+ 515 516- 528352 83 Linux Disk /dev/sdc: 516 cylinders, 64 heads, 32 sectors/track Units = cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sdc1 0+ 16 17- 17392 83 Linux /dev/sdc2 17 515 499 510976 5 Extended /dev/sdc3 0 - 0 0 0 Empty /dev/sdc4 0 - 0 0 0 Empty /dev/sdc5 17+ 81 65- 66544 82 Linux swap /dev/sdc6 82+ 515 434- 444400 83 Linux Disk /dev/sdd: 517 cylinders, 64 heads, 32 sectors/track Units = cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sdd1 0+ 516 517- 529392 83 Linux /dev/sdd2 0 - 0 0 0 Empty /dev/sdd3 0 - 0 0 0 Empty /dev/sdd4 0 - 0 0 0 Empty
Disk /dev/hda: 589 cylinders, 64 heads, 63 sectors/track Units = cylinders of 2064384 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/hda1 * 0+ 8 9- 18112+ 83 Linux /dev/hda2 9 588 580 1169280 5 Extended /dev/hda3 0 - 0 0 0 Empty /dev/hda4 0 - 0 0 0 Empty /dev/hda5 9+ 555 547- 1102720+ 83 Linux /dev/hda6 556+ 588 33- 66496+ 82 Linux swap
Solution : run /sbin/lilo
From here
Before installing GRUB, you need to know how GRUB understands your hard drive and partition information.
First and most of all, counting starts from 0, not from 1.
In Linux, your first hard drive attached to the primary master controller is called "hda". In GRUB it becomes "hd0". Likewise, your first floppy drive in GRUB is "fd0". So the first, second and third partitions on the first hard disk (hda1, hda2 and hda3), become "hd0,0", "hd0,1" and "hd0,2" in GRUB.
NOTE: the comma is an integral part of GRUB partition nomenclature.
To integrate the two fields (disk drive number and partition number) around the comma into one, use parentheses.
For example: (hd0,0) (hd0,1) (hd0,2) and so on. (hd0,0) is first partition on first hard disk. Similarly, (hd1,5) is the sixth partition on second hard disk and (hd2,0) is first partition on third hard disk.
This said we can go into the gory bits ... Configuration
GRUB provides a menu-based interface that you can use. By default GRUB will install into /boot/grub and the configuration file will also reside there. The default configuration file is menu.lst. This is the GRUB equivalent of lilo.conf. This is the file where you define the various boot options, boot images etc.
Here is a sample menu.lsttimeout 10 default 0 title MyLinux v1.0 root (hd0,5) kernel /vmlinuz root=/dev/hda6 ro initrd /boot/initrd.gz title Windows rootnoverify (hd0,0) makeactive chainloader +1OK, lets go through the file line by line:
timeout: the delay in seconds before the default entry is booted.
default: default entry that will be booted. Here the first entry, remember, start counting from 0 and not 1.
For each entry: title: name for the entry.
For Linux/Unix: root: partition where the OS is installed, named the 'grub' way.
kernel: point to the kernel to be loaded adding the root device the 'linux' way (/dev/hdax) and the read-only option (ro). This is much line the option you can pass at the lilo prompt.
initrd: point to the initrd file if you need one. Usually need for machine with scsi devices.
For Windows: rootnoverify: same as root above but to be used for Windows.
makeactive: activate the partition to be bootable, this is because we are chainloading Windows.
chainloader: chainload Windows, and tell the grub to read 1 sector from the start of the partition where Windows resides.
All right, there are more options to grub, check 'info grub' but here are the ones you might meet:
color: used to colorise the grub menu, for example: color black/yellow yellow/black. The first entry is the foreground and background for each menu entry, the second is for the highlighted entry.
password: this is to restrict access to your box, for example: password linuxrox
splashimage: this is to set a background picture to the grub menu, for example: splashimage=(hd0,0)/grub/splash.xpm.gz
Once you have made the changes that were need in menu.lst you need to copy that to the MBR. Usegrub-install /dev/hdaor whichever /dev/hdx you want it to go to. Once this done, you can reboot and see the results of your change.
Good Luck!
grub-install --recheck recommended !
(1) Burn free Dos Boot Cdrom image (this is about 7.1 MB in size) and boot it
http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/fdbasecd.iso
(2) Fix the master boot record [MBR] :
|
|
Site under construction. |
|
Actualitzat el 14 de Desembre de 2011. |
|