Detailed introduction to Linux USB flash drive boot installation (2) manual boot

Source: Internet
Author: User

We use the ubantu System for the boot and installation of Linux USB flash drives. Here we will continue to introduce the manual boot method except the self-boot method, this kind of Linux USB boot installation method requires a little more steps than self-boot installation, but it has its own. Repeat some items here.

1. Overview

There is no doubt that boot from a USB flash drive is very convenient, but the premise is that its capacity must be large enough to accommodate at least about MB of installed CD content), so we recommend that the minimum capacity is 1 GB. In addition, we also need to use a software, namely SYSLINUX. In versions earlier than 3.00, this software only supports FAT16 file systems. In versions earlier than 3.00, SYSLINUX also supports FAT32. However, we recommend that you use the FAT16 file system because of its better compatibility.

After the USB flash drive is inserted, you can run the dmesg command or sudofdisk command to view the device name assigned to it by the system. For more information, see
If you encounter/dev/sdX1 in the future, replace X with your specific device address.

3. manually create a boot USB flash drive

The manual installation process is to use SYSLINUX to create a boot USB flash drive, copy the content of the Ubuntu CD to the boot disk, remember to include all the hidden files/directories, and rename the isolinux directory as syslinux, and file isolinux. cfg is renamed to syslinux. cfg; set the computer to boot from the USB flash drive. After restarting, you can install the operating system from the USB flash drive.

First, we will introduce how to use SYSLINUX to create a boot USB flash drive. In fact, SYSLINUX is a bootstrap loader that runs on a MS-DOS/WindowsFAT file system. Most USB flash drives use the FAT file system, so we will introduce how to add SYSLINUX boot blocks to your USB flash drive:

1. Install syslinux. SYSLINUX supports both Linux and Microsoft Windows. The executable file of the software is located at \ win32 \ syslinux.exe ). For more information, visit the SYSLINUX homepage: http://www.syslinux.org /. The installation in the UbuntuLinux operating system is as follows:
Sudoapt-getinstallsyslinuxmtools

2. Insert and mount the USB flash drive. Generally, the mounting process is automated. If you use the Linux operating system to automatically mount the USB flash drive, you can use the command-tvfat/dev/sda1/mnt to mount it. Note that/mnt is a mount point. If you are using Windows, the system automatically assigns a drive letter to it, for example, F :.

3. Create a boot USB flash drive. If you are using Linux and have attached a USB flash drive according to the preceding method, run the syslinux-s/dev/sda1 command to start the USB flash drive. If you are using a Windows system and the drive letter of the USB flash drive is F:, use the syslinux-s-mF: Command to start the USB flash drive.

4. A new file named ldlinux. sys is generated in the root directory of the USB flash drive. Note that this is a hidden file, which may not be visible in Windows resource manager. However, you can enter the corresponding command at the command prompt to view it, such as dir/aF :. Now, we can boot the computer from our boot USB flash drive. If we see SYSLINUX message text and prompt "boot:", the boot is successful.

Note that for an IDE disk, the hard disk is displayed as sda after we start the boot system of the USB flash drive.

When using the Windows version of syslinux, be sure to use the-m option to ensure that the master startup record MBR of ISOLINUX is copied); otherwise, the original MBR will continue to be used, this will not point to your syslinux. cfg file.

The above section describes how to create a boot USB flash drive. Next we will introduce how to copy the content of the Ubuntu installation CD to the boot USB flash drive.

When we copy the content of the Ubuntu installation CD to our boot USB flash drive, make sure to copy all the files and directories on the CD. Note that the content of the CD is copied here, rather than the ISO image of the CD. Do not confuse this. In addition, if you want to copy the content of a CD, we do not have to download the ISO image to the CD. in Linux, you can mount the image as follows:
Mount-oloop/path/to/ubuntu. iso/path/to/mount/point

Be sure to copy all the hidden files and directories. In Gnome, press Ctrl-H to view hidden files. In MSWindows, you can use the following command to assume that D is the CD-ROM drive letter and F is the drive letter of the USB drive ):
Xcopy/e/h/kd: \ *. * f:

After copying the content on the installation CD to the boot USB flash drive, we will move the files to the root directory. This step is not required for boot disks created using syslinux3.35 or later versions. For a boot USB flash drive created before version 3.35, copy the files in the following directories to the root directory of the USB flash drive:
All files in isolinux)
Caspervmlinuzand initrd.gz)
Install all files)

Now, after the above work, we need to adjust SYSLINUX. CFG.

For the latest version of syslinux, you only need to rename the isolinux directory to syslinux, and rename the file isolinux. cfg in this directory to syslinux. cfg. For earlier versions of syslinux, you must change the file isolinux. cfg to syslinux. cfg. Edit the file and delete/casper/AND/install/from all paths. For example, the content of a line in the original file is as follows:
DEFAULT/casper/vmlinuz
Now you should change:

DEFAULTvmlinuz

Save the file and make sure it is named syslinux. cfg.

After adjusting the SYSLINUX. CFG file, we can boot the boot system from the USB flash drive. Set the BIOS so that the machine can boot from the USB flash drive and insert the prepared USB flash drive to install the Ubuntu system like a CD.

◆ After installation, edit/etc/fstab to direct/media/cdrom0 to the CD drive rather than the USB drive. If this is not done, you will receive an error message "Cannotmountvolume. Invalidmountoptionwhenattemptingtomountthevolume" when mounting the USB flash drive ". This is because the installer thinks it is being installed from the CD drive.

To edit/etc/fstab, you must first open it. The command is as follows:
Sudogedit/etc/fstab

Find the following content usually at the bottom of the file ):
/Dev/sdb1/media/cdrom0udf, iso9660user, noauto, exec, utf800

Add a # At the beginning of the line to comment it out, as shown below:
#/Dev/sdb1/media/cdrom0udf, iso9660user, noauto, exec, utf800

Of course, if you like, you can rename the actual cdrom mount point to/media/cdrom0.
Save the file to complete the manual boot installation of the Linux USB flash drive.

  1. Detailed introduction to Linux USB flash drive boot and installation I) self-guided mode
  2. Linux dynamic library and static library
  3. Detailed introduction to the use of Linux finger commands
  4. Comprehensive Analysis of Linux dynamic library features and Creation
  5. Set ip and mac binding in Linux route

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.