GRUB is successfully installed on the USB flash drive.

Source: Internet
Author: User
Successfully installed GRUB to the USB flash drive-Linux general technology-Linux technology and application information. The following is a detailed description. Author: us. cai

The slax on the USB flash drive has always been started by syslinux boot. In view of the strength of GRUB, GRUB has been trying to install GRUB on the USB flash drive for guidance. I am idle at home today, and the test is successful.

The USB flash drive uses the Sandisk cruzer micro 512 M (which cost more than 300 oceans at the beginning, and now the 4g usb flash drive is only a hundred yuan). The partition is in the FAT format. During syslinux boot, the USB flash drive does not need to be processed. However, to use GRUB boot, you must change the partition table. Otherwise, it becomes an unrecognized device ). In advance, all the information in the USB flash drive is taken to the hard disk for backup.

Since PartionMagic does not recognize removable disks, so here the use of USB boot1.7 on the disk for processing, choose to partition and format the hard disk in USB-HDD,

After that, you can view the active partition in disk management of windows.

This aims to create a partition table for the USB flash drive and mark the first partition as active ). Finally, copy the two folders slax and boot from the previously backed up slax6.07 to the USB flash drive, copy the GRUB folder under/boot in Fedora 9 installed on the hard disk to the boot folder of the USB flash drive.

Set the BIOS to enable the computer in the local hard disk first mode (the author has installed GRUB on the hard disk MBR, and the same is true for GRUB4DOS). Press C in the grub shell when the GRUB boot screen appears, enter "setup (hd1)" and you will be prompted that the installation is successful. Observe the running results and you will find that the actual execution is:

Install/grub/stage1 d (hd1) (hd1) 1 + 23 p (hd0, 5)/grub/stage2/grub. conf

Because the root location is not specified in advance, GRUB writes the boot information of the current hard disk to the USB flash drive. This will cause the stage2 and configuration files not found when the GRUB is started. Therefore, run GRUB installation again:

Install (hd1, 0)/boot/grub/stage1 d (hd1) (hd1) 1 + 23 p (hd1, 0)/boot/grub/stage2 (hd1, 0) /boot/grub. conf

The installation is successful.

Later, you can configure grub by editing grub. conf under the USB flash drive/boot/GRUB. The configuration file is as follows:

# Grub. conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a/boot partition. This means that
# All kernel and initrd paths are relative to/boot/, eg.
# Root (hd0, 5)
# Kernel/vmlinuz-version ro root =/dev/sda7
# Initrd-version.img/initrd
# Boot =/dev/sda
Default = 0
Timeout = 5
Splashimage = (hd1, 0)/boot/grub/splash.xpm.gz
Hiddenmenu
Title Slax 6.07
Root (hd0, 0)
Kernel/boot/vmlinuz load_ramdisk = 1 ramdisk_size = 128000 root =/dev/ram0 init = linuxrc max_loop = 255
Initrd/boot/initrd.gz
Title My Fedora 9
Root (hd1, 5)
Kernel/vmlinuz-2.6.25.3-18.fc9.i686 ro root = UUID = 5336f882-56cb-4d35-b125-b83dd2296e00 rhgb quiet
Initrd/initrd-2.6.25.3-18.fc9.i686.img
Title Windows
Rootnoverify (hd1, 0)
Makeactive
Chainloader + 1

After the installation is complete, the slax on the boot USB flash drive and the fedora 9 on the hard disk are all correct, but windows cannot be started. After reading some information, you can understand that you must exchange and map the hard disk. You can also use the map command to write it into grub. conf:

Map (hd0) (hd1)
Map (hd1) (hd0)
Root (hd1, 0)
Chainloader (hd1, 0) + 1

The installation is now complete.
Related Article

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.