Difference between revisions of "Boot-methods"

From Bashlinux
Jump to: navigation, search
(talk)
(Redirected page to Booting devices)
 
Line 1: Line 1:
  +
#REDIRECT [[Booting devices]]
__NOTOC__
 
<!-- ## page was renamed from boot -->
 
= Booting Devices =
 
 
== How to to boot Linux installer from 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.
 
 
<pre><nowiki>#!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 :( ).
 
</nowiki></pre>
 
 
 
== How to setup a USB drive as USB-HDD ==
 
 
To start the installation process with a USB drive follow the next steps:
 
# Backup the data on USB drive
 
# Format it as FAT32
 
 
<pre><nowiki>
 
# mkdosfs -vF 32 /dev/sda1
 
</nowiki></pre>
 
 
# Copy MBR to new system on USB drive
 
 
<pre><nowiki>
 
# cat /usr/lib/syslinux/mbr.bin > /dev/sda
 
</nowiki></pre>
 
 
# Write syslinux bootloader to USB drive while the partition is still unmounted
 
 
<pre><nowiki>
 
# syslinux -s /dev/sda1
 
</nowiki></pre>
 
 
# Mount drive
 
 
<pre><nowiki>
 
# mkdir -p /mnt/usb
 
# mount /dev/sda1 /mnt/usb
 
</nowiki></pre>
 
 
# Copy all the data from CD/DVD to usb
 
 
<pre><nowiki>
 
# cp /media/Centos5_DVD/isolinux/* /mnt/usb
 
</nowiki></pre>
 
 
# Change name to the main file isolinux.cfg
 
 
<pre><nowiki>
 
# mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg
 
</nowiki></pre>
 
 
 
Now setup the BIOS to boot first from USB-HDD, press F10 to save and exit and restart the machine.
 
 
== How to setup a USB drive as 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.
 
# Modify the number of heads and sectors, this command will take along depending of the real size of the USB drive
 
 
<pre><nowiki>
 
# mkdiskimage -4 /dev/sda 0 64 32
 
</nowiki></pre>
 
 
# Install syslinux in partition number 4
 
 
<pre><nowiki>
 
# syslinux -s /dev/sda4
 
</nowiki></pre>
 
 
# Mount drive
 
 
<pre><nowiki>
 
# mkdir -p /mnt/usb
 
# mount /dev/sda1 /mnt/usb
 
</nowiki></pre>
 
 
# Copy all the data from CD/DVD to usb
 
 
<pre><nowiki>
 
# cp /media/Centos5_DVD/isolinux/* /mnt/usb
 
</nowiki></pre>
 
 
# Change name to the main file isolinux.cfg
 
 
<pre><nowiki>
 
# mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg
 
</nowiki></pre>
 
 
 
Now setup the BIOS to boot first from USB-ZIP, press F10 to save and exit and restart the machine
 
 
== How to setup Linux to boot from network ==
 
 
There are 2 ways to boot from network:
 
* PXE for regular hardware
 
* Netboot for Apple hardware
 
 
Each one of has 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`)
 
 
<pre><nowiki>
 
LABEL My Distro
 
kernel /images/mydistro/vmlinuz
 
append initrd=/images/mydistro/initrd.img
 
</nowiki></pre>
 
 
 
'''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
 
 
<pre><nowiki>
 
LABEL DOS
 
kernel /images/dos/memdisk
 
append initrd=/images/dos/bootdos.img
 
</nowiki></pre>
 
 
An excellent place to get DOS images is [[http://www.bootdisk.com/bootdisk.htm]]
 
 
== Howto make a 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.
 
 
# Download and decompress the image on a Linux station
 
# Mount the image as loop device
 
 
<pre><nowiki>
 
# mkdir -p /tmp/bashlinux
 
# mount -o loop bashlinux.iso
 
</nowiki></pre>
 
 
# 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
 
## 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 with the parameter ''cdrom:'' start on `bashlinux` folder
 
# To create the ISO change dir to one level up to `bashlinux` folder
 
 
<pre><nowiki>
 
# cd /tmp
 
</nowiki></pre>
 
 
# Then issue the following command:
 
 
<pre><nowiki>
 
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 bashlinux
 
</nowiki></pre>
 
 
The new image created is now on `/tmp/bashlinux.iso` and can be mounted on any system.
 
 
== Howto make a custom bootable DVD ==
 
A bootable DVD has the advantage that could be created adding binaries to the process described above, or by editing an original ISO from a vendor.
 
The command to create a DVD is:
 
 
<pre><nowiki>
 
mkisofs -o bashlinux-server.iso -b "isolinux/isolinux.bin" -c "isolinux/boot.cat" -no-emul-boot -boot-load-size 4 -boot-info-table -T -input-charset UTF-8 -max-iso9660-filenames -joliet-long -D -r -R -J -V "CentOS 5.1 (CentOS) Disk1" -A "CentOS 5.1 (CentOS) Disk1" -p "Cinq" bashlinux-server
 
</nowiki></pre>
 

Latest revision as of 17:37, 9 June 2015

Redirect to: