Installing CentOS 6.4 Using USB

One would think that installing CentOS using USB is fairly easy, however Linux often requires additional steps that go beyond ‘it just works’. I purchased a Dell PowerEdge T110 II server and decided on to run KVM on it. CentOS is built from RedHat sources so if you don’t want to pay RedHat, then CentOS is a good option.

1. Download CentOS from http://www.centos.org/modules/tinycontent/index.php?id=30. I used the 6.4 server image which is two DVD images, one is 4.1GB and the other is  1.4GB. For me Stanford mirror was the closest http://mirror.stanford.edu/yum/pub/centos/6.4/isos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso. I used wget and also tried curl. After downloading for a few minutes, both would just stop downloading.  I used the verbose option to both to see if I could see some error messages, however that did not help.  Wget supports –continue option which will continue to download from where it left off if you kill wget or if the previous wget hangs, I found this option useful to download the file.

2. Next step was to create a USB bootable stick, I downloaded http://unetbootin.sourceforge.net/ which allows you to create bootable USB disks. I pointed Unetbootin to the ISO using my 8GB memory stick, and within 15 minutes I had a bootable USB drive.

3. I booted my Dell server and from the boot menu picked USB, which started CentOS. When CentOS came to the disk partition page it asked me for the CentOS ISO. Of course I did not have the ISO on the same USB stick, so I removed the stick and tried to copy the ISO on it, which did not work, since the file is 4.1GB and the USB was formatted with vfat which does not support files larger than 4GB. I then reformmated the USB with ext2, ran Unetbootin, copied the ISO, and tried to boot, but my Dell server would not boot from the ext2 partition of the USB. So I went back and got a 16GB USB stick, and made 2 partitions, one vfat size 4GB and another ext2 size 8GB. On the 8GB I copied the ISO image, and the 4GB vfat I made a bootable partition using Unetbootin. Using this I was able to boot the Dell and start the install. After that you should use Ctrl-Alt-F2 to switch to a shell prompt, and then try the following: ‘umount /mnt/isodir’, followed by ‘mount -t ext2 /dev/sda2 /mnt/isodir’.  Partition 2 of my USB had the ISO and it was /dev/sda2.  Then I switched back to the installer using Ctrl-Alt-F6 and choose Retry which caused the installed to continue.

4. CentOS default partition is not ideal, since it does not separate /var or /tmp. I created my own partition with /tmp, /var, swap, /boot, /boot/efi, /, /vm1, /vm2, /home. I used LVM for all of them except for /boot and /boot/efi. Since I had set my server to be in UEFI boot mode instead of BIOS, CentOS created /boot/efi partition as well.

5. A minimal server installation is what I picked when asked during the install, since I wanted to complete the installation quickly. I had used a USB 2.0 stick, my previous USB stick was 1.0 which was slow. It would have been nice to see USB 3.0 support on the Dell.

6. Once the installation completed, I was able to login with the account I had created earlier during the install.

A few links that you may find useful are:

  1. http://wiki.centos.org/HowTos/InstallFromUSBkey
  2. https://www.centos.org/modules/newbb/viewtopic.php?topic_id=32286
  3. http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-diskpartitioning-x86.html

How was your experience with installing CentOS using USB? Do share your comments below.

14 thoughts on “Installing CentOS 6.4 Using USB

  1. Manu Goel

    Hello Sayed Ali,

    Thanks for such a great blog explanning about installing CentOS 6.4 from the usb drive.
    I see such a difficulty they have introduced in the installation process with requirement of ISO.

    Can you please tell me in detail how may Different LVM’s like /boot, /etc, /home, /tmp, swap etc. Can be created and how much space to allocate to each one of them.

    Bye the way i am planning ti make this installation a wb server, but that shouldn’ t effect the installation.

    Thanks & Regards,
    Manu Goel

    Reply
    1. syedaali Post author

      My partition scheme is as follows:
      /boot 500MB
      /boot/efi 500MB
      I created one VG or volume group called vg001, size is of 2TB and in that I created the following logical volumes or LV:
      swap 8192MB (I have 16GB RAM)
      /tmp 5GB
      /var 5GB
      / 20GB
      /usr/local 20GB
      /home 20GB

      You should take into consideration log file size when creating the above partition scheme, especially for /var, since all logs generally go to /var.
      Also, keep in mind how much space you want to allocate for /home, that would depends on how many users accounts you need and if you plan on using quotas for end users. Since you are planning on installing a web server you can probably have a much smaller /home, say 5GB. I would recommend that your /usr/local be dependent on the size of custom software that you plan on installing. I always install custom software which I built and compiled in /usr/local.

      In terms of file-system types I have /usr/local as XFS and the rest as ext4 since I needed some of the features of xfs.
      Hope this helps!

      Reply
  2. Xiaojie Duan

    Hi, syedaali,
    I found your blog here via google with centos and poweredge t110 ii. I purchased the same machine as yours, and got it this morning. but I tried many times with centos, but all failed. I tried with x86_64 minimal first, however, at the menu, there is three options, Centos6.4, Install with basic video drive, and rescue; no matter what I chose, it just gave me a black screen, and after a long time wait if I press space, it returned to the three options menu again, basically, it did not work.
    Then, I tried with LiveCD, it stopped with “Kernel Panic – Not Syncing: Attempted To Kill Init!” So, I never even seen centos installation screen. I only need a basic installation. Please help! PS. I tried both from USB or from DVD, same result.

    Reply
    1. syedaali Post author

      Have you tried linux=text as a option to the kernel boot parameters? You can do so at the menu where you can choose the installation type. You basically have to edit the boot line at that point.

      Reply
      1. Xiaojie Duan

        if there was this option, I would definitely have a go. but I only had those three, which is strange. as I said, no matter which one I chose from that three options, it did not go through, just stopped there.

        But I can edit the options, sadly, just don’t know what should I type. do you know the command line if i want to go with text mode?

  3. Doug

    I normally don’t complain, but after several frustrating boots I found it easier to dig in the hardware pile for a cdrom than try to get a working usb key install. I can’t believe the convoluted effort to install from usb stick. Almost reminds me of my gentoo days…a decade ago. Oh how far we’ve come. Or not.

    Reply
  4. Ruben Trancoso

    Thanks,

    a few reminders to occasional (not so experienced) adventurers (like me) would be:

    - Try a vFat of 5GB. I got out of space in my experience.
    - unetbootin needs p7zip-full – it mean #yum install p7zip p7zip-plugins
    - while making the bootable pen with unetbootin select /dev/sb1 as the bootable vFat partition and then point to the iso on the ext partition. At first was not clean for me and I guessed wrongly that the first iso was meant to be on the vFat. unetbootin will decompress it to the vFat.

    Happy Installings

    Reply
  5. Cornelius

    Do not waste your time with unetbootin. Use instead iso2usb. It is based on unetbootin, but is a utility specially built for CentOS/RedHat 5.x/6.x installation disk or corresponding ISO image. I tested this one on CentOS 6.3 and 6.4.

    Reply
  6. Pingback: Trouble installing CENTOS from USB | Open Source Web Hosting

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s