Manual USB flash drive startup and basic principles for Linux

Source: Internet
Author: User

Manual USB flash drive startup and basic principles for Linux
Basic simplest directory file graph after successful creation


I. basic guiding process of the system:

First, the system should guide isolinux. bin executable program, which is used for guidance on mobile media, isolinux. after the bin runs successfully, its configuration file syslinux will be loaded. cfg, which defines vmlinuz and initrd. img call method. Vmlinuz is a compressed version of vmlinux, both of which are linux kernels. Isolinux. bin transmits the initrd. img parameters defined in the configuration method to vmlinuz, that is, the Linux kernel is loaded and then the Linux kernel calls initrd. img according to the obtained initrd. img call parameters. The basic function of initrd. img is the root path loader, which saves the re-Compilation of vmlinuz kernel in different root path hardware. Initrd. img finds the system startup program in the parameter path based on the call parameters (the iso installation image is used here), and the system starts up.

Ii. Basic boot disk creation process:

Step 1: extract the files required to create a boot image. These files are in the isolinux directory of the Linux installation disk. This directory is a micro-Linux system.


Step 2: edit the original file isolinux. cfg of the execution configuration file syslinux. cfg of isolinux. bin.

default vesamenu.c32timeout 600
The default value defined here is vesamenu. c32c. This vesamenu.32c is used to start the menu appearance extension tool. The timeout defined below refers to the upper limit of user selection time.

label linux  menu label ^Install CentOS 7  kernel vmlinuz  append initrd=initrd.img inst.stage2=hd:LABEL=CENTOS quietlabel check  menu label Test this ^media & install CentOS 7  menu default  kernel vmlinuz  append initrd=initrd.img inst.stage2=hd:LABEL=CENTOS rd.live.check quietmenu separator # insert an empty line# utilities submenumenu begin ^Troubleshooting  menu title Troubleshootinglabel vesa  menu indent count 5  menu label Install CentOS 7 in ^basic graphics mode  text helpTry this option out if you're having trouble installingCentOS 7.  endtext  kernel vmlinuz  append initrd=initrd.img inst.stage2=hd:LABEL=CENTOS xdriver=vesa nomodeset quietlabel rescue  menu indent count 5  menu label ^Rescue a CentOS system  text helpIf the system will not boot, this lets you access filesand edit config files to try to get it booting again.  endtext  kernel vmlinuz  append initrd=initrd.img inst.stage2=hd:LABEL=CENTOS rescue quietlabel memtest  menu label Run a ^memory test  text helpIf your system is having issues, a problem with yoursystem's memory may be the cause. Use this utility tosee if the memory is working correctly.  endtext  kernel memtestmenu separator # insert an empty linelabel local  menu label Boot from ^local drive  localboot 0xffffmenu separator # insert an empty linemenu separator # insert an empty linelabel returntomain  menu label Return to ^main menu  menu exitmenu end
These are the specific definitions of each menu, that is, the method for calling vmlinuz and initrd. img for each menu.

label linux  menu label ^Install CentOS 7  kernel vmlinuz  append initrd=initrd.img inst.stage2=hd:LABEL=CENTOS quiet
Label is a label, similar to the title of grub. The kernel item indicates the kernel to be loaded, and the append parameter is a suffix parameter, which is equivalent to a line feed. Initrd = initrd. img is the initrd hang that defines the kernel. img, followed by the inst parameter. stage2 = hd: LABEL = CENTOS quiet is the loaded root path, inst. stage2 refers to the path for loading the installer file. hd: LABEL = CENTOS refers to the root path in the storage device marked as CENTOS, that is, the USB flash drive, therefore, the boot image name and USB flash drive must be CENTOS.

If you do not want to display the installation file in the menu mode, you can save vesamenu.32c and change default vesamenu.32c to default linux, which means the label linux definition is loaded by default.

Step 3: Create a boot image file CENTOS. iso


Modify the image file name to be consistent with the root path volume label in syslinux. cfg. Set isolinux. bin to a boot file, and select generate the boot information table, which is the ldlinux. sys startup information file in the last directory.

Step 4: Save the image and write it to the USB flash drive by starting. At this time, UItral So will automatically set syslinux. cfg file box ldlinux. the sys file is generated on the USB flash drive, and other files are copied to the USB flash drive. cfg can be deleted and copied to the root directory.

Note: The files not introduced in the USB flash drive are some background or linux detection tools called in other installation options.


How to Create a linux usb boot disk

Preparation: Configure yum on the real machine
[Root @ localhost/] # ls/mnt/Server/This is the directory of the software package
[Root @ localhost/] # cd/etc/yum. repos. d/
[Root @ localhost yum. repos. d] # ls
Rhel-debuginfo.repo
[Root @ localhost yum. repos. d] # cp rhel-debuginfo.repo pg. repo
[Root @ localhost yum. repos. d] # vim pg. repo
[Root @ localhost yum. repos. d] # cat pg. repo
[Rhel-server]
Name = Red Hat Enterprise Linux
Baseurl = file: // mnt/Server
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

1. Prepare a USB flash drive, partition it, and format it into ext3 (optional)
[Root @ localhost pg] # fdisk-l
Disk/dev/sda: 4003 MB, 4003463168 bytes
84 heads, 20 sectors/track, 4654 cylinders
Units = cylinders of 1680*512 = 860160 bytes

Device Boot Start End Blocks Id System
/Dev/sda1*5 4655 3905600 c W95 FAT32 (LBA)

[Root @ localhost pg] # fdisk/dev/sda

The number of cylinders for this disk is set to 4654.
There is nothing wrong with that, but this is larger than 1024,
And coshould in certain setups cause problems:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(E.g., dos fdisk, OS/2 FDISK)

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk/dev/sda: 4003 MB, 4003463168 bytes
84 heads, 20 sectors/track, 4654 cylinders
Units = cylinders of 1680*512 = 860160 bytes

Device Boot Start End... the remaining full text>
 
How to Create a ubuntu linux USB flash drive

If a USB flash drive is enabled in Windows, use UltraISO to open the Ubuntu image, click the "Boot disc" menu of UltraISO, and click "Write hard disk image ", select your USB flash drive from the "disk drive" drop-down menu, and click "write" to boot the USB flash drive.
Note that if you run UltraISO as an administrator in Vista.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.