lost and found ( for me ? )

how to install CentOS 6 via USB stick


At first , I made an installation USB stick for CentOS6 with unetbootin tool on Linux Mint 12 machine , however I can’t install CentOS6 via that USB stick created by unetbootin
unetbootin does not seem to support CentOS 6 as of now…

I could install CentOS 6 via USB stick by following instructions.
many tnx !

there are two ways to make an installation USB stick
- use CentOS iso
- use CentOS Live iso

the latter is easier. ( IMO )

[ use CentOS iso ]

download iso
# tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Linux Mint 12 Lisa"

# uname -ri
3.0.0-16-generic x86_64

# ls *.iso
CentOS-6.2-x86_64-bin-DVD1.iso  CentOS-6.2-x86_64-bin-DVD2.iso


make two partitions.
200MB for vfat and the other is for ext3.
# LANG=C fdisk /dev/sdd

Command (m for help): n
Command action
  e   extended
  p   primary partition (1-4)
p
Partition number (1-4, default 1): 1
First sector (2048-15826943, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15826943, default 15826943): +200M

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): n
Command action
  e   extended
  p   primary partition (1-4)
p
Partition number (1-4, default 2): 2
First sector (411648-15826943, default 411648):
Using default value 411648
Last sector, +sectors or +size{K,M,G} (411648-15826943, default 15826943):
Using default value 15826943

Command (m for help): a
Partition number (1-4): 1

Command (m for help): p

Disk /dev/sdd: 8103 MB, 8103395328 bytes
250 heads, 62 sectors/track, 1021 cylinders, total 15826944 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6b8b4567

  Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *        2048      411647      204800    b  W95 FAT32
/dev/sdd2          411648    15826943     7707648   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.


make filesystem
# mkfs.vfat -n boot /dev/sdd1
# mkfs.ext3 -m 0 -b 4096 -L data /dev/sdd2


make directores and mount iso
# mkdir /mnt/USB
# mkdir /mnt/DVD
# mount -t iso9660 -o loop CentOS-6.2-x86_64-bin-DVD1.iso /mnt/DVD/
# mount /dev/sdd2 /mnt/USB/

# cp -r /mnt/DVD/images /mnt/USB
`# cp -r CentOS-6.2-x86_64-bin-DVD*.iso /mnt/USB
# umount /mnt/USB


install MBR , syslinux etc
# apt-get install syslinux –y

# locate mbr.bin
/usr/lib/syslinux/altmbr.bin
/usr/lib/syslinux/gptmbr.bin
/usr/lib/syslinux/mbr.bin

# dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdd
# syslinux -sddv/sdd1
# mkdir /mnt/BOOT
# mount /dev/sdd1 /mnt/BOOT/

# cp /mnt/DVD/isolinux/isolinux.bin /mnt/BOOT/syslinux.bin
# cp /mnt/DVD/isolinux/isolinux.cfg /mnt/BOOT/syslinux.cfg

# cp /mnt/DVD/isolinux/vmlinuz /mnt/BOOT/
# cp /mnt/DVD/isolinux/initrd.img /mnt/BOOT/



edit syslinux.cfg like this
# cat /mnt/BOOT/syslinux.cfg
default CentOS
prompt 0

label CentOS
       kernel vmlinuz
       append initrd=initrd.img method=hd:sdc2:/

the line “method=hd … “ dpends on your environment. ( sda2 or sdd2 or sdc2 )
In my case , I could install CentOs6 when specifying sdc2.
( there are two HDDs have been installed in my PC )
# umount /mnt/BOOT
# umount /mnt/DVD


get things done.
install CentOS6 by using that USB stick.

[ use CentOS Live iso ]

You can install CentOS6 using CentOS Live version.

download CentOS live CD and do the following command.
# LANG=C fdisk /dev/sdd

Command (m for help): n
Command action
  e   extended
  p   primary partition (1-4)
p
Partition number (1-4, default 1): 1
First sector (2048-15826943, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15826943, default 15826943):
Using default value 15826943

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

# dd if=CentOS-6.2-x86_64-LiveCD.iso of=/dev/sdd bs=1M


Boot CentOS6 Live via the USB stick and then select “install” from the boot menu to install CentOS6 on your HDD.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.