lost and found ( for me ? )

Showing posts with label unetbootin. Show all posts
Showing posts with label unetbootin. Show all posts

install CentOS6.4 64bit from an USB stick


Here’s an explanation of how to install CentOS 6.4 64bit minimal from an USB stick.


prepare a USB stick. I have prepared a 8GB USB stick.
I downloaded CentOS-6.4-x86_64-minimal.iso.

launch unetbootin to make an USB-based CentOS installer.
If you have not installed unetbootin , you can install it by just typing “apt-get install unetbootin”

choose CentOS-6.4-x86_64-minimal.iso as an ISO image and then click.






copy the ISO to the top directory in the USB stick
# cp CentOS-6.4-x86_64-minimal.iso /path-to-USB-stick/

The top directory in the USB stick would be like this:
# ls
CentOS-6.4-x86_64-minimal.iso  RELEASE-NOTES-en-US.html       images        ubnfilel.txt
CentOS_BuildTag                RPM-GPG-KEY-CentOS-6           isolinux      ubninit
EFI                            RPM-GPG-KEY-CentOS-Debug-6     ldlinux.sys   ubnkern
EULA                           RPM-GPG-KEY-CentOS-Security-6  menu.c32      ubnpathl.txt
GPL                            RPM-GPG-KEY-CentOS-Testing-6   repodata
Packages                       TRANS.TBL                      syslinux.cfg

If the ISO image isn’t in the USB stick , you would face the following error during the installation and fail to install the OS into HDDs.
Missing ISO 9660 Image
The installer has tried to mount image #1, but cannot find it on the hard drive.

In my experience , when using CentOS 6.4 normal DVD ISO image , 8GB USB stick does not have enough space to make an USB-based installer.
That’s why I use the minimal ISO image.

After preparing USB-based installer , insert the USB stick into your PCs and boot the USB first. You could install CentOS 6.4 from an USB stick.


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.

boot Fedora 15 Live via a USB stick

I built a bootable USB stick of Fedora 15 Live with unetbootin on Ubuntu 11.04

[ preparation ]

install unetbootin ( apt-get install unetbootin )
download Fedora 15 ISO image ( Fedora-15-i686-Live-Desktop.iso )
a USB stick ( I prepared 4GB USB stick )

[ procedure ]

on Ubuntu11.04 laptop machine:

insert a USB

launch unetbootin
root@hat1:~# unetbootin

choose Fedora ISO image and select USB drive in which you want to build bootable image.


click OK


Here’s an output of “ls” in the USB stick
root@hat1:.../12B5-186F# pwd
/media/12B5-186F
root@hat1:.../12B5-186F# ls
EFI  LiveOS    ldlinux.sys  syslinux.cfg  ubninit  ubnpathl.txt
GPL  isolinux  menu.c32     ubnfilel.txt  ubnkern

[ Let’s boot Fedora 15 live from the USB stick with my notebook ]

on my notebook:

enable boot from USB drive on BIOS setting
insert the USB stick
turn on my notebook

on Unet bootin boot menu , select “Fedora-15-i686-Live-Desktop.iso”

If your video card does not have a capability of GNOME3 , select BOOT ( Basic Video )

How to create bootable USB for ESXi 4.1 update1 with unetbootin on ubuntu 11.04


[ software info ]

ubuntu 11.04 server 64bit : 2.6.38-10-server
syslinux 4.02
unetbootin : 471-2ubuntu1
ESXi 4.1 update1 : VMware-VMvisor-Installer-4.1.0.update1-348481.x86_64.iso

[ logs ]

Step1

prepare USB stick ( I prepared 4GB USB stick. BUFFALO: model name YUF-4G-WH )
create a partition and format it by VFAT.

USB stick device name ( /dev/sdg )
create a partition ( /dev/sdg1 )
root@hat1:~# LANG=C fdisk  /dev/sdg

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
       switch off the mode (command 'c') and change display units to
       sectors (command 'u').

Command (m for help): p   <- no partitions

Disk /dev/sdg: 4007 MB, 4007657472 bytes
124 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7688 * 512 = 3936256 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4911f7a1

 Device Boot      Start         End      Blocks   Id  System

Command (m for help): n   <- create a primary partition. # is 1
Command action
 e   extended
 p   primary partition (1-4)
p
Partition number (1-4): 1 <- partition 1
First cylinder (1-1018, default 1): 1  <- size
Last cylinder, +cylinders or +size{K,M,G} (1-1018, default 1018): +450M

Command (m for help): a  <- toggle bootable flag
Partition number (1-4): 1 <- partition number 1

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

Command (m for help): w  <- save configuration
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.

root@hat1:~# LANG=C fdisk -l /dev/sdg

Disk /dev/sdg: 4007 MB, 4007657472 bytes
124 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7688 * 512 = 3936256 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4911f7a1

 Device Boot      Start         End      Blocks   Id  System
/dev/sdg1   *           1         121      465093    b  W95 FAT32


Step2

format it
root@hat1:~# mkfs.vfat -n BOOT -F 32 /dev/sdg1
mkfs.vfat 3.0.9 (31 Jan 2010)


Step3

install unetbootin to  create a bootable USB.
root@hat1:~# apt-cache search unetbootin
unetbootin - installer of Linux/BSD distributions to a partition or USB drive

root@hat1:~# apt-get install unetbootin

root@hat1:~# dpkg -l unetbootin | tail -1
ii  unetbootin                            471-2ubuntu1                                 installer of Linux/BSD distributions to a partition or USB drive


connect USB stick and mount a partition you created.
then start unetbootin.
# mount /dev/sdg1 /media/USB/
# unetbootin


seletct ISO image and press OK.


creating



overwrite menu.c32 ( click yes )

done. click exit.

change directory
root@hat1:~# cd /media/USB/

root@hat1:/media/USB# ls
README.txt  cisco_n1k     isolinux.bin  open_source_licenses.txt  ubnpathl.txt
a.z         ienviron.vgz  isolinux.cfg  sys.vgz                   vmkboot.gz
boot.cat    imagedd.bz2   ldlinux.sys   syslinux.cfg              vmkernel.gz
cim.vgz     imagedd.md5   mboot.c32     tboot.gz
cimstg.tgz  install.vgz   menu.c32      ubnfilel.txt


Step4

modify syslinux.cfg. add “ks=usb:/ks.cfg”
root@hat1:/media/USB# cat syslinux.cfg
default menu.c32
menu title VMware VMvisor Boot Menu
timeout 80

label ESXi Installer
menu label ^ESXi Installer
kernel mboot.c32
append vmkboot.gz ks=usb:/ks.cfg --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz

label ^Boot from local disk
menu label ^Boot from local disk
localboot 0x80


Step5

make ks.cfg file.
root@hat1:/media/USB# cat ks.cfg
vmaccepteula
rootpw welcome
autopart --firstdisk --overwritevmfs
install usb
network --bootproto=static --ip=192.168.11.200 --gateway=192.168.11.1 --hostname=sumavihv --device=vmnic0 --nameserver=192.168.11.1 --netmask=255.255.255.0


Step6

copy /usr/lib/syslinux/mboot.c32 and /usr/lib/syslinux/menu.c32 to the USB stick’s partition.
root@hat1:/media/USB# cp /usr/lib/syslinux/mboot.c32 .
root@hat1:/media/USB# cp /usr/lib/syslinux/menu.c32 .


unmont a partition.
root@hat1:~# umount /dev/sdg1


that’s it !

I could install ESXi 4.1 U1 using this USB stick on HP ML110 G6 :)

procedures are:

connect USB stick and boot from USB stick
install ESXi in DL110’s HDD
after finishing the installation , press reboot
disconnect USB stick