Four methods for creating a Linux boot disk
Linux boot floppy disks include boot disks and boot/root disks. The so-called boot disks can only be used to start Linux systems installed on hard disks, the boot/root disk itself is a mini Linux system. Linux boot floppy disk is an essential tool for system restoration. Therefore, it is very useful to master how to create a boot floppy disk. Below I will introduce four different boot disk creation methods:
1. Use the mkbootdisk tool to create a boot disk for the current system
Mkbootdisk -- device/dev/fd0 invalid uname-r encrypted
Parameter description: -- device/dev/fd0 is used to create a boot floppy disk, which is also the default option. Therefore, you can omit it. The following parameter is the kernel version number, such as 2.2.16, here we use the unzip uname-r kernel command to obtain the kernel version number of the system. For more parameters, see man mkbootdisk.
This method creates a boot floppy disk for the current system. Therefore, you must have run the Linux system and install the mkbootdisk package in the system (if not, install the package ). The created boot disk is the same as the boot floppy disk prompted during Linux installation.
2. Install lilo in the boot sector of the floppy disk.
Lilo-B/dev/fd0
Parameter description:-B/dev/fd0 installs lilo on a floppy disk, because lilo is installed on the hard disk by default, so it cannot be omitted; the-C config_file parameter allows you to use/etc/lilo. configuration file other than conf. For more parameters, see man lilo.
This method also creates a boot disk for the current system.
3. Find a bootable kernel, point its root device to the correct root partition, and then "instantly" it into the floppy disk.
Rdev vmlinuz/dev/hda ﹖
Dd if = vmlinuz of =/dev/fd0
Note: Use the rdev command to direct the root device in the kernel vmlinuz to/dev/hda?, replace hda with your own root partition, run the DD command to write the kernel to a floppy disk.
This method can be created using any bootable kernel, so it can be completed using other Linux systems, which is particularly useful when you cannot start your Linux system through a hard disk. However, if you use a different kernel than your system, some functions may be lost after startup, for example, some modules cannot be loaded, chinese characters cannot be correctly displayed (when the foreign language kernel is used to guide Chinese Linux). If you want to create a dedicated boot disk for your system, you can use method 1 or method 2 after startup.
4. Use the loader on a floppy disk and a bootable kernel to start the system.
First, create a DOS boot disk (format A/s), copy the loader loadlin.exe and the bootable kernel vmlinuz to a floppy disk, and then create an automatic batch processing file autoexec. bat. The content is as follows:
Loadlin vmlinuz root =/dev/hda? Ro
This method is very simple, because loadlin.exe and a bootable kernel vmlinuz can be found on the Linux installation optical disks of each region, and can be easily copied in DOS or Windows 9X. Similar to method 3, you can use any bootable kernel to guide the system.
The above four methods have been verified in the release kits including RedHat, blue dot, xteam Linux, Turbo Linux, and Hongqi.
In addition to the above several methods, you can also use sxslinux to create a Linux boot disk. Since various Linux release kits do not contain it, I will not talk about it here.