Use a USB flash drive to automatically install CentOS

Source: Internet
Author: User


We can also modify the iso image, burn it to the cd, and install it automatically from the cd. This is very simple.
(1) Use ultralISO to open the image, extract isolinux/isolinux. cfg, modify the image as follows, and replace the original one after modification.
.....
Label ks
Kernel vmlinuz
Append ks = cdrom:/anaconda-ks.cfg initrd = initrd. img # Tell it which ks to use
.....
(2) Upload the ks file to/under the cd to www.2cto.com.
Do not forget to save the iso file, test it on the VM, and then burn it to the CD.
--------------------------------------------------------

I used to use cd to install CentOS. Today, when I installed the system, I couldn't go through it. It seems that the cd disk is down, so I just made a USB flash disk and installed it automatically. The steps are not difficult. The installation speed is faster than that of cd, and there is no need to interact. Haha, I feel very high. Come together!
My environment: Host Machine xp sp3, virtual machine vmware 9.0
Preparation:
1. CentOS-5.8-x86_64-bin-DVD-1of2.iso # the second one does not need
2. syslinux.exe #: http://www.kernel.org/pub/linux/utils/boot/syslinux/ I download is the latest syslinux-5.00.zip, windows
3. USB flash disk> = 8 GB # The CentOS image has exceeded 4 GB
4. An installed Linux (I am in a virtual machine)
1. Create partitions in the USB flash drive
Insert the USB flash disk to the Linux machine <use in the lower right corner of vmware, or enable removeable device in the menu VM> to partition it. If you only have one hard disk recognized as sdb, the partition is sdb1: Size: 500 M format: msdos or vfat purpose: Start partition sdb2: Size 5G format: ext2 purpose: storage and installation image sdb3: Size: all remaining formats: fat32 usage: This part can be used to store other things
This step is not detailed.
Ii. Mount the image and create a start Partition
2.1 create/mnt/boot,/mnt/data,/mnt/cdrommkdir/mnt/{boot, data, cdrom} 2.2 mount the ISO image, sdb1, sdb2mount/dev/cdrom/mnt/cdrom mount/dev/sdb1/mnt/boot mount/dev/sdb2/mnt/data 2.3 copy the boot directory from the CD to/mnt/bootcp- /mnt/cdrom/isolinux // mnt/boot/syslinux # the old centos version may not be in this location, copy the isolinux directory to 2.4 copy a kickstart configuration file to/mnt/boot for Automatic Installation cp/root/anaconda-ks.cfg/mnt/boot 2.5 modify the configuration file cd/mnt/boot under the syslinux directory /syslinux/mv isolinux. cfg syslinux. cfg vi syslinux. cfg ## force save default ks # modify ks to the default value without entering ks and then <Enter> prompt 1 timeout 600 display boot. msg F1 boot. msg F2 options. msg F3 general. msg F4 param. msg F5 rescue. msg label linux # label indicates that if you enter linux, run kernel vmlinuz append initrdinitrd = initrd with the following configuration. img label text kernel vmlinuz append initrdinitrd = initrd. img text label ks kernel vmlinuz append ks = hd: sdb1:/anaconda-ks.cfg initrdinitrd = initrd. img # modify the ks file used, we are the anaconda-ks.cfg under sdb1, the other is the default label local localboot 1 label memtest86 kernel memtest append-2.6 modify the ks configuration file, to meet your automated installation requirements cd .. vi anaconda-ks.cfg install harddrive -- partition = sdb2 -- dir = # This is the most need to change, other use of the default can also, as needed, -- dir = represents from the image in sdb2, if the directory name lang en_US.UTF-8 keyboard us text network -- device eth0 -- bootproto dhcp rootpw -- iscrypted $1 $ p6PtASuF $ tm6Wf6o/htTLC27hxW5Ua/firewall -- enabled -- port = 22: tcp authconfig -- enableshadow -- enablemd5 selinux -- enforcing timezone -- utc Asia/Shanghai bootloader -- location = mbr -- driveorder = sda # optimistic sda, partition clearpart -- linux -- drives = sda part/boot -- fstype ext3 -- size = 100 -- ondisk = sda part pv.2 -- size = 0 -- grow -- ondisk = sda volgroup VolGroup00 -- pesize = 32768 pv.2 logvol/-- fstype ext3 -- name = LogVol00 -- vgname = VolGroup00 -- size = 1024 -- grow logvol swap -- fstype swap -- name = LogVol01 -- vgname = VolGroup00 -- size = 1008 -- grow -- maxsize = 2016% packages # The following is the installed software, @ is the group @ base @ core @ dialup @ editors @ text-internet keyutils
2.7 install mbr on sdb
In ipvs, extract syslinux-5.00.zip to drive D.
Start -- run -- cmd enter dosd: # enter D disk cd syslinux-5.00 # dir is Linux ls cd win32 D: \ syslinux-5.00 \ win32> syslinux.exe-a-m I: # create an mbr boot disk after installation. copy CentOS-5.8-x86_64-bin-DVD-1of2.iso to sdb2
My ISO is on xp. After I share it, I mount and copy it on linux. You can also use ftp, just copy it to sdb2.
4. Uninstall sdb1 sdb2 and test and install www.2cto.com on the VM.
4.1 unmount mount/dev/sdb1 # If the file cannot be unmounted, perform the fuser-km/dev/sdb1 and unmount mount/dev/sdb2 4.2 test. You can use a real machine to test whether the file can be started, this condition may not be available for installation. We tested it in vmware.
4.2.1 create a new virtual machine without system installation.
4.2.2 modify the virtual machine configuration and add a usb flash disk as a harddisk. For example, # If PhysicalDrive1 is not found, disconnect usb from vmare and disable vmare to re-open 4.2.3. Adjust the Virtual Machine bios startup sequence www.2cto.com.
Open the Virtual Machine -- F2--BOOT -- + Hard Drive () Press +-to tune to the above, such as, F10 save, exit, this time the virtual machine restarts, see the installation interface, press Enter or Enter ks <Enter> to automatically install the USB flash drive.

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.