Difference between revisions of "Boot-methods"

From Bashlinux
Jump to: navigation, search
(talk)
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
  +
<!-- ## page was renamed from boot -->
 
== Booting Devices ==
 
== Booting Devices ==
 
==== DVD/CD-ROM ====
 
==== DVD/CD-ROM ====
Line 91: Line 92:
 
'''Kernel:''' `vmlinuz`
 
'''Kernel:''' `vmlinuz`
 
'''Initial RAM Disk:''' `initrd.img` (also can be found as `initrd.gz`)
 
'''Initial RAM Disk:''' `initrd.img` (also can be found as `initrd.gz`)
  +
 
 
<pre><nowiki>
 
<pre><nowiki>
LABEL My Distro
+
LABEL My Distro
kernel /images/mydistro/vmlinuz
+
kernel /images/mydistro/vmlinuz
append initrd=/images/mydistro/initrd.img
+
append initrd=/images/mydistro/initrd.img
</nowiki></pre>
+
</nowiki></pre>
   
   
Line 105: Line 106:
 
'''Kernel:''' memdisk (Usually placed under `/usr/lib/syslinux/memdisk`)
 
'''Kernel:''' memdisk (Usually placed under `/usr/lib/syslinux/memdisk`)
 
'''Initial RAM Disk:''' could me any DOS distro image distributed over the internet
 
'''Initial RAM Disk:''' could me any DOS distro image distributed over the internet
  +
 
 
<pre><nowiki>
 
<pre><nowiki>
LABEL Oh no, DOS !!!
+
LABEL Oh no, DOS !!!
kernel /images/dos/memdisk
+
kernel /images/dos/memdisk
append initrd=/images/dos/bootdos.img
+
append initrd=/images/dos/bootdos.img
</nowiki></pre>
+
</nowiki></pre>
   
 
An excellent place to get DOS images is [http://www.bootdisk.com/bootdisk.htm]
 
An excellent place to get DOS images is [http://www.bootdisk.com/bootdisk.htm]
Line 119: Line 120:
 
# Download and decompress the image on a Linux station
 
# Download and decompress the image on a Linux station
 
# Mount the image as loop device
 
# Mount the image as loop device
  +
 
 
<pre><nowiki>
 
<pre><nowiki>
 
# mkdir -p /tmp/bashlinux
 
# mkdir -p /tmp/bashlinux
 
# mount -o loop bashlinux.iso
 
# mount -o loop bashlinux.iso
</nowiki></pre>
+
</nowiki></pre>
   
 
# Do the necessary changes, but consider the following:
 
# Do the necessary changes, but consider the following:
## The main file is called {{syslinux.cfg}} which has the same format as the PXE configuration file
+
## The main file is called `syslinux.cfg` which has the same format as the PXE configuration file
 
## Any name referenced on any menu must have less that 8 characters on name
 
## Any name referenced on any menu must have less that 8 characters on name
## The root for any reference on menus start on {{isolinux}} folder
+
## The root for any reference on menus start on `isolinux` folder
## The root for any reference with the parameter _cdrom:_ start on {{tapcode}} folder
+
## The root for any reference with the parameter ''cdrom:'' start on `tapcode` folder
 
# To create the ISO change dir to one level up to tapcode folder
 
# To create the ISO change dir to one level up to tapcode folder
 
 
Line 147: Line 148:
 
== GRUB Loader ==
 
== GRUB Loader ==
 
In order to display small fonts on terminal is necessary to set the vga value as kernel parameter to enable the frame buffer vga mode, the following table shows the possible values:
 
In order to display small fonts on terminal is necessary to set the vga value as kernel parameter to enable the frame buffer vga mode, the following table shows the possible values:
  +
 
 
<pre><nowiki>
 
<pre><nowiki>
Color depth | 640x480 800x600 1024x768 1280x1024
+
Color depth | 640x480 800x600 1024x768 1280x1024
-----------------+-------------------------------------
+
-----------------+-------------------------------------
256 (8bit)| 769 771 773 775
+
256 (8bit)| 769 771 773 775
32000 (15bit)| 784 787 790 793
+
32000 (15bit)| 784 787 790 793
65000 (16bit)| 785 788 791 794
+
65000 (16bit)| 785 788 791 794
16.7 Mill.(24bit)| 786 789 792 795
+
16.7 Mill.(24bit)| 786 789 792 795
</nowiki></pre>
+
</nowiki></pre>

Revision as of 19:44, 23 November 2009

Booting Devices

DVD/CD-ROM

The fastest way to get Linux CentOS 5 installed on host machine.

USB Drive

There are 2 options to install Linux from a USB drive, also known as USB Flash Memory:

  • USB HDD: For machines with recent bios.
  • USB ZIP: For older machines that cannot recognize the USB Drive as HDD.
#!wiki note
'''Be Careful'''

syslinux has a weird behavior under CentOS, sometimes it doesn't install fine on USB drive, in order to have done syslinux on USB Drive, run it from Debian or from Windows (Yes syslinux doesn't run as expected on CentOS Linux but does on Windows :( ).


USB-HDD

To start the installation process with a USB drive follow the next steps:

  1. Backup the data on USB drive
  2. Format it as FAT32
 # mkdosfs -vF 32 /dev/sda1 
  1. Copy MBR to new system on USB drive
 # cat /usr/lib/syslinux/mbr.bin > /dev/sda 
  1. Write syslinux bootloader to USB drive while the partition is still unmounted
 # syslinux -s /dev/sda1 
  1. Mount drive
 # mkdir -p /mnt/usb
 # mount /dev/sda1 /mnt/usb
 
  1. Copy all the data from CD/DVD to usb
 # cp /media/Centos5_DVD/isolinux/\* /mnt/usb 
  1. Change name to the main file isolinux.cfg
 # mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg 

Now setup the BIOS to boot first from USB-HDD, press F10 to save and exit and restart the machine.

USB-ZIP

There are some devices that cannot boot from a USB drive as HDD, so is necessary to trick the BIOS to make it reads the USB drive size as a USB ZIP.

  1. Modify the number of heads and sectors, this command will take along depending of the real size of the USB drive
 # mkdiskimage -4 /dev/sda 0 64 32
 
  1. Install syslinux in partition number 4
 # syslinux -s /dev/sda4
 
  1. Mount drive
 # mkdir -p /mnt/usb
 # mount /dev/sda1 /mnt/usb
 
  1. Copy all the data from CD/DVD to usb
 # cp /media/Centos5_DVD/isolinux/\* /mnt/usb
 
# Change name to the main file isolinux.cfg

 # mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg
 


Now setup the BIOS to boot first from USB-ZIP, press F10 to save and exit and restart the machine

Network

There are 2 ways to boot from network: PXE and Netboot. Each one of them have different configuration on dhcp server and therefore different kind of image is served to the client.

All this images must be placed under `/tftpboot/images`

PXE Linux

To boot any Linux distro just copy the kernel and the ramdisk from any image or cd that contains the pxeboot folder of such distro.

The common names for the files needed are: Kernel: `vmlinuz` Initial RAM Disk: `initrd.img` (also can be found as `initrd.gz`)

 LABEL My Distro
 kernel /images/mydistro/vmlinuz
 append initrd=/images/mydistro/initrd.img
 


PXE Dos

Some times is necessary to boot into DOS in order to execute specific applications like flash the BIOS. The files necessary to boot into the DOS shell are:

Kernel: memdisk (Usually placed under `/usr/lib/syslinux/memdisk`) Initial RAM Disk: could me any DOS distro image distributed over the internet

 LABEL Oh no, DOS !!!
 kernel /images/dos/memdisk
 append initrd=/images/dos/bootdos.img
 

An excellent place to get DOS images is [1]

Custom bootable ISO

The bootable ISO image is useful to boot either a virtual machine with capabilities to boot from an image or to be burned on a CD-ROM.

  1. Download and decompress the image on a Linux station
  2. Mount the image as loop device
  # mkdir -p /tmp/bashlinux
  # mount -o loop bashlinux.iso
 
  1. Do the necessary changes, but consider the following:
    1. The main file is called `syslinux.cfg` which has the same format as the PXE configuration file
    2. Any name referenced on any menu must have less that 8 characters on name
    3. The root for any reference on menus start on `isolinux` folder
    4. The root for any reference with the parameter cdrom: start on `tapcode` folder
  2. To create the ISO change dir to one level up to tapcode folder
 # cd /tmp
 
  1. Then issue the following command:
 mkisofs -o bashlinux.iso -b "isolinux/isolinux.bin" -c "isolinux/boot.cat" -no-emul-boot -boot-load-size 4 -boot-info-table -T -input-charset UTF-8 tapcode
 


The new image created is now on `/tmp/bashlinux.iso` and can be mounted on any system.

GRUB Loader

In order to display small fonts on terminal is necessary to set the vga value as kernel parameter to enable the frame buffer vga mode, the following table shows the possible values:

 Color depth      | 640x480  800x600  1024x768 1280x1024
 -----------------+-------------------------------------
 256        (8bit)|  769      771       773      775
 32000     (15bit)|  784      787       790      793
 65000     (16bit)|  785      788       791      794
 16.7 Mill.(24bit)|  786      789       792      795