Home > Linux > Ubuntu Network Installation Using PenDrive

Ubuntu Network Installation Using PenDrive

January 25th, 2009 Leave a comment Go to comments


With the new version of Ubuntu Hardy Heron 8.04, the ms-sys package no longer exists (due to copyright violations). For that download the ms-sys package here ms-sys-2.1.3.tar.gz and also install gettext using apt-get.

Value Addition:

We can setup a linux machine in a matter of minutes without requiring some special infrastructure. Also, if we have customized an operating system (in case of say, a streaming server, or VMS slave servers), we can make an image of it and make it installable. That installation can be started via the network, so the end user would just need to plugin the USB Pen Drive, and automatically the server would be setup, configured and available for use.

The softwares that you may need to download are syslinux, mtools, ms-sys, gettext

Following are the steps:

Step 1: Make a Bootable USB Pen Drive

  • Partition the USB Drive and make the partition bootable using fdisk. Make sure the partition that you’d make bootable is a Win95Fat16 one (Mode e in fdisk)
  • Now put Win95 MBR in the drive by using ms-sys -9 /dev/sda (ms-sys is not available 8.04/Hardy Heron onwards. Use the Gutsy Deb for the same. ms-sys_2.1.0-1_i386.deb )
  • Format that partition using mkdosfs /dev/sda1
  • Make it bootable using syslinux by typing syslinux /dev/sda1
  • Mount the USB Drive’s Parition through mount /dev/sda1 /media/usbdisk. Copy the initrd.gz and linux onto the partition
  • Create a file called syslinux.cfg inside the parition and add the following values into it
DEFAULT insall

LABEL install
 menu label ^Start Ubuntu via Netboot
 kernel linux
 append initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --

Make the chages to append line as below if you want to perform a kicksrtart installation.

DEFAULT insall

LABEL install
 menu label ^Start Ubuntu via Netboot
 kernel linux
 append ks=http://ipadd/ofserver/ks.cfg initrd=initrd.gz rw quiet splash --

So essentially there’d be only 4 files inside the USB Drive, viz. initrd.gz , ldlinux.sys , linux , syslinux.cfg

STEP 2: On your Web Server, mount the ISO and make it available

# cd /var/www
# mkdir ubuntu
# mount -o loop /path/to/ubuntu-8.10-alternate.iso /var/www/ubuntu

STEP3: Boot using the USB and start the installation Now there are two problems.
(a) If you start the Edgy Installation using the netboot kernel, it’ll search for archive.ubuntu.com and get the Release files from there. If the Release file that is available at archive.ubuntu.com is later than what’s available on the CD, then you’ll face problems while downloading packages. So, the network installation will fail if you use the CD as the repository.
(b) The linux-image-kernel which is available in the CD, probably does not have correct GPG key/md5sum. Due to which later in the installation it gives an error that it could not be authenticated and the installation fails. The solution to both the problems above is covered below

  • Boot using the USB. You should be able to see the installation screen where it asks for the Language. If not, try the Ubuntu Wiki where booting using the USB is explained alongwith the Netboot Kernel Image.
  • Proceed through the normal installation steps. Once the Network Configuration step comes, if you’ve a DHCP server, it’ll automatically pickup the IP Address. Don’t let that happen (Press Cancel). If the DHCP Config is done and it asks for the system’s name, click Go Back and configure the network manually.
  • If you have the details about the IP Address, well and good, else on the VT2, type ifconfig and route -n to know about the IP Address, Subnet Mask and the Gateway
  • Don’t Provide the DNS Entry as it will allow the system to go through internet and get connected to archive.ubuntu.com which we do not want.
  • While asked for mirror from which to do the installation, go to the Top and add the information manually.
  • Once the Base Installation is in progress, switch to Virtual Terminal 2, by pressing ALT+F2. Press ENTER and add the following
  • echo 'APT::Get::AllowUnauthenticated "true";' >>/target/etc/apt/apt.conf (All Credit goes to dixonp who suggested the same here -> http://ubuntuforums.org/showthread.php?t=332343)
    This will ensure that no GPG Related issues pop-up and installation happens smoothly.

That’s it. This will help you in a scenario where

  • Bandwidth is limited and you don’t want to connect to Internet everytime you need to do the installation
  • You were able to get an Alternate Install ISO (or a CD), but there are no CD Drives on the machines you wish to install Ubuntu
  • You wish to do fast Ubuntu Installations but they should be interactive (Otherwise you can look into Kickstart Installs)
  • The DHCP network is not in your control to setup a PXE Install

Note: All the credit goes to Marquivon who posts the same here http://ubuntuforums.org/showthread.php?p=2086827

Categories: Linux Tags:
  1. No comments yet.
  1. No trackbacks yet.