Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Appendix A. Boot Devices
Automated installation (or kickstart) is an essential part of efficient system provisioning. This appendix describes how to prepare different types of boot media for use with kickstarting clients.
The Red Hat Enterprise Linux CD boot image
boot.iso is a required prerequisite for creating boot devices. Make sure that this is available somewhere on the system and take note of its location.
Important
Install the
syslinux and syslinux-extlinux packages to use the following procedures.
yum install syslinux syslinux-extlinux
# yum install syslinux syslinux-extlinux
The
syslinux package installs files in /usr/share/syslinux/ for Red Hat Enterprise Linux 6. If using Red Hat Enterprise Linux 5, substitute this directory with /usr/lib/syslinux/.
The
syslinux-extlinux package installs tools for USB boot media creation.
Procedure A.1. CD and DVD Boot Media
Note
The backslash "
\" is used below to represent a continuation of one line at the shell prompt.
- Create a working directory for the boot image:
mkdir -p temp cd/isolinux
# mkdir -p temp cd/isolinuxCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Mount the boot image to the
tempdirectory:mount -o loop boot.iso temp
# mount -o loop boot.iso tempCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the required files for a Boot Media device to the previously created directory:
cp -aP temp/isolinux/* cd/isolinux/
# cp -aP temp/isolinux/* cd/isolinux/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Unmount the
tempdirectory and change the permissions on thecddirectory to be readable and writable to the user:umount temp chmod -R u+rw cd
# umount temp # chmod -R u+rw cdCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Change to the
./cddirectory:cd ./cd
# cd ./cdCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the
/usr/share/syslinux/menu.c32file to the./cddirectory:cp -p /usr/share/syslinux/menu.c32 isolinux
# cp -p /usr/share/syslinux/menu.c32 isolinuxCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Customize any boot parameters and targets in
isolinux.cfgas needed for CD booting. - Use the
mkisofsto create an ISO to burn to a CD or DVD.mkisofs -o ./custom-boot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \ -boot-load-size 4 -boot-info-table -J -l -r -T -v -V "Custom Red Hat Enterprise Linux Boot" . -boot-load-size 4 -boot-info-table -J -l -r -T -v -V "Custom Red Hat Enterprise Linux Boot" .# mkisofs -o ./custom-boot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \ -boot-load-size 4 -boot-info-table -J -l -r -T -v -V "Custom Red Hat Enterprise Linux Boot" .Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Burn the directory to a CD or DVD to complete the procedure.
Procedure A.2. PXE Boot
- Create a working directory for the boot image:
mkdir -p temp pxe/pxelinux.cfg
# mkdir -p temp pxe/pxelinux.cfgCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Mount the boot image to the
tempdirectory:mount -o loop boot.iso temp
# mount -o loop boot.iso tempCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the required files for a PXE Boot device to the previously created directory:
cp -aP temp/isolinux/* pxe/
# cp -aP temp/isolinux/* pxe/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Unmount the
tempdirectory and change the permissions on thecddirectory to be readable and writable to the user:umount temp chmod -R u+rw pxe
# umount temp # chmod -R u+rw pxeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Change to the
/pxedirectory:cd ./pxe
# cd ./pxeCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the
/usr/share/syslinux/menu.c32file to the/pxedirectory:cp -p /usr/share/syslinux/menu.c32 .
# cp -p /usr/share/syslinux/menu.c32 .Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Move the
isolinux.cfgfile topxelinux.cfg/default:mv isolinux.cfg pxelinux.cfg/default
# mv isolinux.cfg pxelinux.cfg/defaultCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the temporary files:
rm -f isolinux.bin TRANS.TBL
# rm -f isolinux.bin TRANS.TBLCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the
/usr/share/syslinux/pxelinux.0file to the/pxedirectory:cp -p /usr/share/syslinux/pxelinux.0 .
# cp -p /usr/share/syslinux/pxelinux.0 .Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Open the
pxelinux.cfg/defaultfile in your preferred text editor, and customize any boot parameters and targets as needed for PXE booting.
Procedure A.3. USB Boot Media
Warning
Be extremely careful when carrying out these command as root (required for most critical parts). These commands access device files and using them incorrectly could irrecoverably damage your system. The example below uses
/dev/loop0 for mounting, make sure you use the correct device for your system. You can check which is the correct device using the losetup -f command.
- Create a working directory for the boot image:
mkdir -p temp usb/extlinux
# mkdir -p temp usb/extlinuxCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Mount the boot image to the
tempdirectory:mount -o loop boot.iso temp
# mount -o loop boot.iso tempCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the required files for a USB Media Boot device to the previously created directory:
cp -aP temp/isolinux/* usb/extlinux/
# cp -aP temp/isolinux/* usb/extlinux/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Unmount the
tempdirectory and change the permissions on thecddirectory to be readable and writable to the user:umount temp chmod -R u+rw usb
# umount temp # chmod -R u+rw usbCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the
/usr/share/syslinux/menu.c32file to the./usb/extlinux/directory:cp -p /usr/share/syslinux/menu.c32 ./usb/extlinux/
# cp -p /usr/share/syslinux/menu.c32 ./usb/extlinux/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Move the
usb/extlinux/isolinux.cfgfile tousb/extlinux/extlinux.conf:mv usb/extlinux/isolinux.cfg usb/extlinux/extlinux.conf
# mv usb/extlinux/isolinux.cfg usb/extlinux/extlinux.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Remove the temporary files:
rm -f usb/extlinux/isolinux.bin usb/extlinux/TRANS.TBL
# rm -f usb/extlinux/isolinux.bin usb/extlinux/TRANS.TBLCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Convert the
custom-boot.imgfile and copy it:dd if=/dev/zero of=./custom-boot.img bs=1024 count=300000
# dd if=/dev/zero of=./custom-boot.img bs=1024 count=300000Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Discover the correct mounting location for the loopback device:
losetup -f
# losetup -f /dev/loop0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set up the loopback device with the boot image:losetup /dev/loop0 ./custom-boot.img
# losetup /dev/loop0 ./custom-boot.imgCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Open the
fdiskutility:fdisk /dev/loop0
# fdisk /dev/loop0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create one primary bootable partition on the device. This can be done by using the following key press combination: n p 1 Enter Enter a 1 p w - Copy the master boot record (MBR) to the loopback device:
dd if=/usr/share/syslinux/mbr.bin of=/dev/loop0
# dd if=/usr/share/syslinux/mbr.bin of=/dev/loop0Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add partition maps to the loopback device:
kpartx -av /dev/loop0
# kpartx -av /dev/loop0Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create the file system:
mkfs.ext2 -m 0 -L "Custom Red Hat Enterprise Linux Boot" /dev/mapper/loop0p1
# mkfs.ext2 -m 0 -L "Custom Red Hat Enterprise Linux Boot" /dev/mapper/loop0p1Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Mount the device:
mount /dev/mapper/loop0p1 temp
# mount /dev/mapper/loop0p1 tempCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Delete temporary files:
rm -rf temp/lost+found
# rm -rf temp/lost+foundCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the
usb/extlinux/directory to a temporary location:cp -a usb/extlinux/* temp/
# cp -a usb/extlinux/* temp/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Install the bootloader in the temporary location:
extlinux -i temp
# extlinux -i tempCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Unmount the temporary location:
umount temp
# umount tempCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Delete the partition maps on the loopback device:
kpartx -dv /dev/loop0
# kpartx -dv /dev/loop0Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Delete the loopback device:
losetup -d /dev/loop0
# losetup -d /dev/loop0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Synchronize the file system changes:sync
# syncCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Open the
extlinux.conffile in your preferred text editor, and customize any boot parameters and targets as needed for USB booting. - Transfer the image to a USB device to complete the procedure. Insert the device, and run the
dmesgcommand to check the mounting location. In this example, it is/dev/sdb.Unmount the USB device:umount /dev/sdb
# umount /dev/sdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the image to the USB device:dd if=./custom-boot.img of=/dev/sdb
# dd if=./custom-boot.img of=/dev/sdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow