Difference: SystemInstallation (4 vs. 5)

Revision 52017-01-03 - uli

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Installing an Ubuntu System on an external USB drive and making it bootable

Changed:
<
<

As a first step when preparing a development environment for Android tablet systems one must prepare an operating system on which all the development software will be running. For the course at UCC we will use the latest Ubuntu Linux system, which we install on a bootable external USB hard drive. Before starting system installation the 64bit version of the Ubuntu desktop system (ubuntu-14.04.1-desktop-amd64.iso at the time of writing) is downloaded from ubuntu.com/download and transferred to a DVD or installed on a USB memory stick. If you have a running Ubuntu system then this can easily be accomplished with the usb-creator-gtk program.

The DVD or memory stick contains a live Ubuntu system which can be used to get acquainted with Ubuntu without touching the operating system currently running on the computer. Once we get to grips with the new system we install it onto an external USB hard drive.

Clicking the “install Ubuntu” button on the desktop or rebooting the DVD or memory stick and selecting “Installation” instead of “Live system” starts the installation.

>
>

As a first step when preparing a development environment for the Raspberry Pi one must prepare an operating system on which all the development software will be running. For the course at UCC we will use the latest Ubuntu Linux system, which we install on a bootable external USB hard drive. Before starting system installation the 64bit version of the Ubuntu desktop system (ubuntu-16.04.1-desktop-amd64.iso at the time of writing) is downloaded from ubuntu.com/download and transferred to a DVD or installed on a USB memory stick. If you have a running Ubuntu system then this can easily be accomplished with the usb-creator-gtk program.

The DVD or memory stick contains a live Ubuntu system which can be used to get acquainted with Ubuntu without touching the operating system currently running on the computer. Once we get to grips with the new system we install it onto an external USB hard drive.

Before installing the system I prepared the partition layout on the USB drive using gparted a GUI style partition editor available on the installation DVD or memory stick.Alternatively you may user the command line program gdisk. Be sure that you are using the correct disk! Otherwise you may overwrite your existing OS! I check in /dev before:

disks.png

As you can see, I have /dev/sda, which is the internal drive, /dev/sdb which is the installation USB memory stick and finally /dev/sdc, the USB hard disk, onto which I want to install my new Ubuntu system.

Today there are 2 different ways to boot the system

  • the old style BIOS boot
  • the new UEFI (Unified Extensible Firmware Interface) boot
In addition there are 2 different partitioning versions for the hard disk:
  • the old style MBR partition table where you can have a maximum of 4 primary partitions. Here the partitions are created with fdisk
  • the new GPT partitions which allow up to 128 primary partitions.
This is the partition layout I use created with gdisk and using a GPT partitioning:

gparted.png

When looking at the same thing with gdisk, this is what we get:

gdisk.png

Apart from the Linux file system partitions, which will be dedicated to

  • "/", the root file system, containing the system proper,
  • /opt, the file system that will contain everything we will need to develop our programs for the course,
  • /home the file system reserved for user files and Linux
  • swap, the swap area used by the system to save memory contents when we run out of memory
there are 2 additional partitions used exclusively for booting, one for UEFI boot ( 300 MBytes), the other one BIOS boot (2 MBytes).

This partition layout has all it needs to boot the USB drive from either an UEFI or a BIOS system. However since these systems need grub, the grand unified boot loader installed in different ways you will have to install re-install grub when booting from the other system type. This needs to be done only once. After installation of both boot versions you can boot from either system.

Clicking the “install Ubuntu” button on the desktop or rebooting the DVD or memory stick and selecting “Installation” instead of “Live system” starts the installation.

  preparation.png
Line: 13 to 37
  partition.png
Changed:
<
<
This is the partition layout:
  • / the root partition 200 Gbytes
    On the partition the Ubuntu system is installed. /, /usr, /boot … go here.

  • /home the user partition 200 Gbytes
    Here all user data and programs will be stored.

  • /opt optional system software 580 Gbytes
    On this partition all our development software, cross compiler … and all course material are stored.

  • swap the swap area 20 GBytes

Make sure that all partitions (except the swap partition) are newly formatted as ext4 file systems.
>
>
Use the partition layout created earlier and just tell the installer which file system you want to install on which partition. Make sure that all partitions (except the swap partition) are newly formatted as ext4 file systems.
  partitionType.png

In the Installation Type window, selecting a partition (in my case e.g. /dev/sdc1 because the USB drive is seen as /dev/sdc) and clicking Change brings up the window above on which you can select the mount point (/dev/sdc1 is the root partition), the file system type and if the partition must be formatted or not. Be sure to select your USB hard drive as disk on which the boot loader will be installed (/dev/sdc in my case).

Changed:
<
<
Before clicking install be absolutely sure that the disk you are partitioning is the fresh USB hard disk. Check also that the MBR (Master Boot Record) goes onto the USB drive and NOT onto /dev/sda. If you get it wrong, you might kill your Windows system that might be installed e.g. on your internal hard disk. If the MBR goes onto the wrong drive your Windows system may not boot any more.
>
>
Before clicking install be absolutely sure that the disk you are installing to is the fresh USB hard disk. Check also that the boot loader goes onto the USB drive and NOT onto /dev/sda. If you get it wrong, you might kill your Windows system that might be installed e.g. on your internal hard disk. If the boot loader goes onto the wrong drive your Windows system may not boot any more.
  !!!!!!!!!!!!!!!!!!! So... be careful! !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Clicking Install now starts the installation.

Changed:
<
<
Once the system and the boot loader are installed on the external USB disk, we can restart the machine and boot from that disk into Ubuntu.
>
>
Once the system and the boot loader are installed on the external USB disk, we can restart the machine and boot from that disk into Ubuntu. If you only want to boot a single type of system (either BIOS or UEFI), then you are done and you can start playing and improving the system, e.g. install other Ubuntu packages.If you wnat to be able to use the drive on both types of systems then you have to do the following:

I first installed the system on a BIOS machine, which installs the BIOS version of grub. In order to be able to boot the disk from a UEFI system, we must create a vfat file system on the UEFI (300 MByte) partition (see the partitioning description at the beginning of this document).

mkfs -vfat /dev/sdc5

did this in my case. Again: Be sure that you use the correct partition

Then boot the computer with the installation media and go to "try system" with the USB hard drive attached. Make sure the USB drive is mounted e.g.

mkdir /media/sdc1
mount /dev/sdc1 /media/sdc1

Then we have to re-mount /dev, /dev/pts, /sys and /proc on the USB hard drive:

mount --bind /dev /media/sdc1/devmount --bind /dev/pts /media/sdc1/dev/pts
mount --bind /sys /media/sdc1/sys
mount --bind /proc /media/sdc1/proc

and finally we change the root directory to be the one installed on the USB hard drive. Now we have set up the system as it would be after booting the hard drive directly.

To install grub we first have to mount the UEFI partition:
mkdir /boot/efimount /dev/sdc5 /boot/efi

Now we have to install the uefi version of grub-install:

apt install grub-efi-amd64
and finally we can install the boot loader:

grub-install /dev/sdc (again make sure /dev/sdc is the correct disk!)

 
Changed:
<
<
Finally we want to customize our system with a nice SplashScreen.
>
>
In oder to make boot even nicer we want to customize our system with a nice SplashScreen.
  Once the system boots nicely as we expect we can start to install AdditionalSoftware.
Line: 40 to 81
 
META FILEATTACHMENT attachment="preparation.png" attr="h" comment="" date="1458664991" name="preparation.png" path="preparation.png" size="56480" user="uli" version="1"
META FILEATTACHMENT attachment="partition.png" attr="h" comment="" date="1458664992" name="partition.png" path="partition.png" size="73303" user="uli" version="1"
META FILEATTACHMENT attachment="partitionType.png" attr="h" comment="" date="1458664993" name="partitionType.png" path="partitionType.png" size="20120" user="uli" version="1"
Added:
>
>
META FILEATTACHMENT attachment="gparted.png" attr="" comment="partition layout" date="1483461070" name="gparted.png" path="gparted.png" size="74578" user="uli" version="1"
META FILEATTACHMENT attachment="disks.png" attr="" comment="attached disks" date="1483462116" name="disks.png" path="disks.png" size="11932" user="uli" version="1"
META FILEATTACHMENT attachment="gdisk.png" attr="" comment="partition layout ass seen with gdisk" date="1483462453" name="gdisk.png" path="gdisk.png" size="83205" user="uli" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback