Lesson 2

Date: 1/29/2009
Linux installation and upgrade
Linux for Engineering and IT Applications


Exercises

I. Create a bootable installation CD.

  • Download files to put on the CD:
    wget http://192.168.5.240/netboot/ubuntu-installer/i386/linux 
    wget http://192.168.5.240/netboot/ubuntu-installer/i386/initrd.gz
    wget http://192.168.5.240/netboot/ubuntu-installer/i386/menu.lst
    wget http://192.168.5.240/netboot/ubuntu-installer/i386/preseed.cfg
    

  • Create a directory for CD image and copy installer files there.
    mkdir -p iso/boot/grub
    cp /usr/lib/grub/i386-pc/stage2_eltorito  iso/boot/grub
    cp linux iso/boot 
    cp initrd.gz iso/boot 
    cp menu.lst  iso/boot/grub 
    

  • Rebuild the initrd file to include preseed.cfg in it. The new file should be called initrdpr.gz
    mkdir initrdpr
    cp preseed.cfg initrdpr
    cd initrdpr
    gzip -d < ../initrd.gz | cpio --extract --verbose --make-directories --no-absolute-filenames
    find . | cpio -H newc --create --verbose | gzip -9 > ../initrdpr.gz
    

  • Copy initrdpr.gz into iso/boot directory:
    cd ..
    cp initrdpr.gz iso/boot
    
    Now you have everything in iso/boot directory to create a bootable CD with Ubuntu network installer.

  • Create a new directory, iso/Backup, and save some configurations files into it.
    mkdir iso/Backup
    cp /etc/hosts iso/Backup
    cp /etc/hostname iso/Backup 
    cp /etc/apt/sources.list iso/Backup
    

    Finally, make a ISO9660 image file like this:
    mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso iso
    
    This produces a file named grub.iso, which then can be burned into a CD (or a DVD).

  • Ask the TA for a blank CD-R and run k3b to burn grub.iso onto the CD-R. Choose speed #2 for the burning.

    II. Run interactive Linux installation.
  • Note, during the system re-installation, you won't be able to run the browser so you'd better to print out this page. If you like, you can setup CUPS utility on your desktop to print on the Unisys lab printer - follow the printing HOWTO
  • Reboot the desktop. Press F12 key and choose to boot from a CD device. Choose the first option, "Install in Text Mode", in the GRUB prompt and follow the installer instructions. When prompted for the "Ubuntu archive mirror country", scroll all the way to the top of the list by pressing Page-Up key and choose
    Enter information manually
    for the host, type in: 192.168.5.240; for directory: /ubuntu/
    It is obvious to choose the nearest Ubuntu mirror. In our case, it is a server in our lab. If you are at home and want to install Ubuntu on your computer there, choose one of the official Ubuntu mirrors.
    For partitioning, you can choose the following layout, or stay close to it:
      IDE1 master (hda)
            #1 primary    256 MB     ext3       /
            #2 primary    512 MB     swap       swap
            #5 logical    512 MB     ext3       /var
            #6 logical    3.0 GB     ext3       /usr
            #7 logical    1.0 GB     ext3       /tmp
            #8 logical    leftover   ext3       /home
    

    In this exercise, you don't care about installing various software since the system is going to be reinstalled again in the next exercise. To save time, install only the base system, skip s oftware installation and APT configuration. After reboot, you should be able to login into the newly installed system.

    III. Automatic installation with preseed.cfg.

  • Reboot the desktop. Press F12 key and choose to boot from a CD device. Choose the second option, "Automatic Install with preseed in Text Mode", in the GRUB prompt and wait until the installer finishes the installation. It will prompt you for a new user login name and password.
  • After the installation is completed, restore the files from the installation CD.
    mount /dev/cdrom /media/cdrom
    cp /media/cdrom/Backup/hosts /etc/hosts
    cp /media/cdrom/Backup/hostname /etc/hostname
    cp /media/cdrom/Backup/sources.list /etc/apt/sources.list
    umount /media/cdrom
    



  • Take me to the Course Website