CentOS USB Install
Installing CentOS 5.5 from USB
A linux system is needed to prepare a USB flash drive, I used openSUSE:
1. Identify USB drive:
dmesg
… [sdb] Attached SCSI removable disk
This mean the USB drive is /dev/sdb
2. Erase USB drive:
dd if=/dev/zero of=/dev/sdb bs=65536 count=10000
3. Create a 10 MB W95 FAT32 partition and make it active:
fdisk /dev/sdb
Enter n to add a new partition
Command (m for help):n
p #for primary partition
1 #for partition one
<Enter> #default 1
+10M #for adding 10MB
t #to change the type
b #Windows 95 FAT32
#Create data partition
n #new partition
p #for primary partition
2 #for partition two
<Enter> #Starting cylinder – default
<Enter> #Last cylinder default
a #toggle bootable flag
1 #partition one
w #write to disk
4. Verify partitions:
fdisk -l
5. Make the filesystems for the two partitions:
mkfs.vfat -n BOOT /dev/sdb1
mkfs.ext2 -m 0 -b 4096 -L DATA /dev/sdb2
6. Mount by unplug/plug the USB drive:
sdb1 should be /media/BOOT
sdb2 should be /media/DATA
7. Create a folder centos on the DATA partition and copy the iso files:
mkdir /media/DATA/centos
cp -r /download/* /media/DATA/centos/; sync #Assuming the isos are in /download folder
8. Install syslinux on the BOOT partition:
syslinux -s /dev/sdb1
dd if=/usr/share/syslinux/mbr.bin of=/dev/sdb
9. Mount the first iso image and copy isolinux to the BOOT partition:
mkdir /mnt/cdimage
mount -ro loop /download/CentOS-5.5-x86_64-bin-1of8.iso /mnt/cdimage
cd /media/BOOT
cp -rv /mnt/cdimage/isolinux syslinux
10. Edit syslinux.cfg:
mv syslinux/isolinux.cfg syslinux/syslinux.cfg #isolinux.cfg to syslinux.cfg
rm -f syslinux/isolinux.bin #delete isolinux.bin
vi syslinux/syslinux.cfg #add “method=hd:sda2:/centos” to the “append”
Example:
kernel vmlinuz
append initrd=initrd.img method=hd:sda2:/centos
Done preparing USB flash drive.
Boot from the USB flash drive to install CentOS 5.5