There are two ways to boot the system from a USB drive. The first is to install completely over the network. The second is to copy the CD image to the USB drive as the source of the package and can be combined with other images. The second way is more common.
For the first installation, you need to download the installation image from the netboot directory and copy the file to the U disk according to the "Flexible Method" described below.
The installation image of the second installation method is placed in the hd-media directory, which can be copied to the USB flash drive using the "Easy Method" or "Flexible Method". You will also need to download a CD image for this installation. The installation image and CD image should be the same debian-installer distribution. If it is different, an error will occur in the installation.
In order to prepare the USB flash drive, you need a running GNU/Linux system that supports USB. The current GNU/Linux system will automatically recognize when you insert a USB drive. If not, you should verify that the usb-storage kernel module has been loaded. Once the USB drive is inserted, it will be mapped to a device named /dev/sdX where “X” is the letter of a-z. You can confirm that it is mapped correctly by inserting a USB flash drive by running dmesg. To write a message, first turn on the write-protect switch on it.
Warnings
Using this method will destroy anything that is already on the device! Make sure you are using the correct U disk device name. If you make a mistake, such as writing a hard disk, all the information on the device will be lost.
Note that the USB flash drive must have at least 256MB capacity (a smaller size installation is also possible, see Section 2 “ Copying Files — Flexible Method”).
1 Copy files — Easy way
There is a file collection hd-media/boot.img.gz that contains all the installer files (including the kernel) and syslinux and corresponding configuration files .
It should be noted that although convenient, this method has one major drawback: Even if the USB flash drive is large, the logical size of the device is limited to 256 MB. If you want to use the U
disk for other purposes, you need to repartition it to create a new file system for the rest of the capacity. A minor disadvantage is that you cannot copy a full CD image to a USB drive, only a smaller
businesscard or netinst CD image.
To use this image, just unzip it directly to the USB flash drive:
# zcat boot.img.gz > /dev/sdX
Then mount U Disk (mount /dev/sdX /mnt), now has a FAT file system, copy the Debian netinst or businesscard ISO image into it. Uninstalling the U disk (umount /mnt) is complete.
2 Copying files — Flexible methods
If you need more flexibility, or just want to know what's going on, you should use the following method to put the file into the U disk. .
2.1 Partitioning a USB Disk
We will show how to use the first partition of a USB stick instead of the entire device.
Note
Since most USB sticks have a separate FAT16 partition set up, you may not need to repartition or format the USB stick. If you have to do it, use cfdisk or another partitioning tool to create a FAT16 partition and then create a file system:
# mkdosfs /dev/sdX1
Note, please use the correct U disk Device name. The mkdosfs command is included in Debian's dosfstools package.
In order to boot the kernel after the U disk is booted, we need to put a boot loader on the USB flash drive. Although any boot loader (like lilo) should work, it's more convenient to use syslinux. The main reason is that it can use the FAT16 partition and it can be configured by simply editing a text file. Any operating system that supports the FAT file system can be used to change the boot loader's configuration file.
To put syslinux on the FAT16 partition of the USB drive, install the syslinux and mtools packages on your system and execute:
# syslinux /dev/sdX1
Remind again, please confirm that you are using the correct device name. The partition cannot be mounted when syslinux is started, because the process writes data to the boot sector of the partition and creates an ldlinux.sys file containing the boot loader code.
2.2 Add the installer image
Mount the partition (mount /dev/sdX1 /mnt) and copy the following installer image file to the USB flash drive:
vmlinuz ( Kernel binary)
initrd.gz (initial ramdisk image)
You can choose to use the text interface or the graphical installation interface to install the program. The latter can be obtained from the gtk subdirectory. If you need to change the file name, please note that syslinux only follows the DOS (8.3) naming method.
Next, you need to create a syslinux.cfg configuration file with at least the following two lines:
default vmlinuz
append initrd=initrd.gz
For the graphical installer, you need to add video=vesa:ywrap, mtrr vga=788 to the end of the second line.
If you use the hd-media image, you should now copy the Debian ISO image (businesscard, netinst, or full CD image; confirm the appropriate one) to the USB drive. Then, unmount the U disk (umount /mnt).
3 Booting from a USB drive
Warning
If your system refuses to boot from a USB drive, it may be because it contains an invalid primary boot sector record (MBR) . You can fix this by using the install-mbr command from the mbr package:
# install-mbr /dev/sdX
The SELinux function is an implementation of mandatory access control, which can
1. Wait queue data structureThe wait queue is implemented by a doubly linked list whose elements inc
First talk about my environment: redhat5.4 system, IP address is 192.168.0.10 Debian is 6.0 system,
We have been doing a task in the usual way until we know there is a better way to handle it. As a fo
Linux View Disk IO Status Operation Guide
The correct way to restore EXT3 Superblock(bad superblock)
How to add a static route to Linux
USB image acquisition driver installation under Linux operating system
Firefox 3.6 RC1 released The official version will be launched next Monday
Multiple commands are executed continuously under Linux
Nginx configuration reverse proxy
Ubuntu Linux how to use the source files to install software
Linux Security: Step by Step Defense (1)
Retrieving deleted emails in Foxmail
How does Win7 disable ports 135 and 456 to avoid hacking? Tips for disabling 135 and 456 ports
Win10 system to view system error log method
Q. Why doesn't Win7 have a beautiful boot animation? [Photo]
The origin of Vista version 6000 explains that Win7 also complies with
Learn to use a script to recover user passwords for Windows XP systems
Win8 how to restore Win7 "confirm folder replacement" window