How to install CentOS7 on a USB flash disk

Source: Internet
Author: User

How to install CentOS7 on a USB flash disk

Before CentOS7 is installed, my PC is a dual system of win7 and CentOS6.5 and started with GRUB boot. I installed a lot of application software and server software in CentOS6.5, and re-compiled the kernel of the higher version. However, in the process of creating a linux system as needed, many unsolved errors have been made, leading to unsatisfactory configuration in some areas of the system. As a perfectionist mild patient, after learning about the release of CentOS7, he began to consider upgrading.

1. First try the online upgrade method. Refer to Region.

2. Then try to install it through the hard disk. This is also the method used when I install the CentOS6.5 dual system. In the win7 system environment, the specific steps are as follows.

(1) Use the ext2Fsd software to read linux partitions

(2) then copy the CentOS-7.0-1406-x86_64-DVD.iso file to the root directory of the linux partition

(3) decompress the CentOS-7.0-1406-x86_64-DVD.iso, copy the isolinux and images in the decompressed folder to the linux partition root directory

(4) use EasyBCD to configure the linux Startup portal and then restart the computer

(5) Select "win7" in the GRUB boot guide to go to the windows Startup interface, and then select "CentOS" to start.

After the above steps, you should have entered the CentOS7 installation interface. But in fact, the installation interface of CentOS7 is not displayed, but the following error occurs.

Dracut-initqueue [624]: Warning: cocould not boot.

Dracut-initqueue [624]: Warning:/dev/root does not exist.

Starting Dracut EmergencyShell...

Warning:/dev/root does not exist

After searching, it is found that the same error may occur during the installation of the boot disk created in the windows environment. This may be because files are lost when you copy and install the image CentOS-7.0-1406-x86_64-DVD.iso in windows.

3. For more information, see http://wiki.centos.org/howtos/installfromusbkeyto create a USB boot disk installation in linuxenvironment. The procedure is as follows.

(1) connect the USB flash drive (with a capacity of 8 GB) to your computer and use

Fdisk-l

Command to view the device Number of the USB flash disk. Note that the device Number of the USB flash drive (e.g./dev/sdb) is used instead of the partition (e.g./dev/sdb1 ). In addition, the USB boot disk will be formatted and backed up before use.

(2) with root permission, go to the directory where the CentOS7 image file is located and use the following command to create a USB boot disk.

Ddbs = 4 M if = CentOS-7.0-1406-x86_64-DVD.iso of =/dev/sdb

The bs parameter is optional, which only affects the disk creation speed. The if parameter specifies the output file. The of parameter specifies the input device. The value is the USB device number that has been confirmed in the previous step. Before executing this command, make sure that the USB flash drive is in the unmount state. Depending on the computer hardware level, this process may take 10 minutes or more.

In addition, it should be noted that after the boot disk becomes a boot disk, the size of the USB flash disk will be much smaller and cannot be restored by formatting. This is because the boot disk cannot be formatted and released. After the installation is complete and the USB boot disk is no longer used, you can use diskpart to restore the capacity in command line mode in win7.

(3) maintain the connection status of the usb boot disk, restart the computer, go to the motherboard settings page, set the BOOT priority to the highest value for the mobile device, and then save and restart the computer to enter the following CentOS7 installation interface. Select Install CentOS 7 to go to the next step.

(4) Perform necessary settings on the initialization settings page. Click the corresponding icon, such as DATE & TIME, KEYBOARD, and language support, to set the TIME, and the KEYBOARD and system language support to be used.


WhereThe default Auto-detected installation media remains unchanged in INSTALLATIONSOURCE.

WhereIn SOFTWARESELECTION, select the work environment to be installed as needed. If you need a desktop environment, you can choose GNOME or KDE. The former is more suitable for beginners, and the latter is relatively gorgeous, close to the windows desktop. Select the Add-ons software as needed. These software and server environments can be installed in the future, so you do not have to consider them too much.

WhereINSTALLATIONDESTINATION: select the hard disk on which the CentOS7 system will be installed. Select the hard disk and select I willconfigure partitioning in the partition Settings area, and click the Done button in the upper left corner. Generally, you only need to set/partition and swap partition.

Finally, you can set the network connection mode of the computer.

After the above steps, the CentOS7 installation can be completed normally. Restart, set the motherboard to boot first from the hard disk, and then enter the CentOS 7 operating system.

4. After the installation is complete and restarted, the original grub boot program becomes invalid, and the system enters CentOS by default, but does not boot into win7. In addition, CentOS7 uses GRUB2 management to start the boot program. Therefore, the original method of modifying/etc/grub. conf cannot restore the Windows 7 boot entry.

When starting, you can use the grub command line to manually boot the Windows 7 system. When the system starts to enter the following screen, press the c key on the disk to enter the grub command line. Run the ls command to view all hard drive devices. The result is as follows:

(Hd0) (hd0, msdos6) (hd0, msdos5)... (hd0, msdos1) (hd1) (hd1, msdos1)

Then input and execute the following command in the grub command line to enter the win7 system.

Setroot = (hd0, msdos1)

Chainloader + 1

Boot

In the preceding three commands, the set command specifies the partition of the system to be started. My win7 system is installed in msdos1 (the first partition) of the first hard disk hd0 ). Note that there must be spaces between chainloader and parameters in the second command. The third command starts the system.

However, I still need to use grub to automatically provide an entry for the win7 system. Refer to the solution for http://superuser.com/questions/781300/searching-for-grub-configuration-file-in-centos-7Adam C, the path to the grub boot configuration file for CentOS 7 is/boot/grub2/grub. cfg. However, you do not need to modify the above file to change the boot guide. You can modify the/etc/grub. d/40_custom file and add the following content to it:

Menuentry "Windows 7 "{

Set root = '(hd0, msdos1 )'

Chainloader + 1

}

Run the following command.

Grub2-mkconfig-output =/boot/grub2/grub. cfg

Reflect the custom system startup file to the startup configuration. When you restart your computer again, you will be able to find the Windows 7 System Portal and enter the Windows 7 system normally.

In addition, you can modify the/etc/default/grub file to set the default startup system (GRUB_DEFAULT parameter), or modify the waiting time (GRUB_TIMEOUT parameter ).

Zookeeper

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.