Ade Malsasa Akbar contact
Senior author, Open Source enthusiast.
Thursday, March 24, 2016 at 22:40


At this March 2016, Ubuntu 16.04 Xenial Xerus has not in the final release yet. It is still in the development stage, so it's not stable yet for daily usage, but you are free to download that development version. This tutorial aimed for installing Ubuntu any version into external hard disk drive, not just 16.04. But because 16.04 is becoming a hot topic today, we use 16.04 as an example. Notice that installing any GNU/Linux in external hard disk drive is a little bit different because you must pay attention where to install the bootloader and be prepared to rescue sometimes when you can't boot normally.


System Summary


We use this computer to perform these installation procedures:

  • ASUS X44C Intel Celeron 2 GB RAM
  • One internal hard disk drive 320 GB
  • One external hard disk drive 320 GB
  • Internal hard disk contains one operating system with a GRUB bootloader
  • External hard disk is empty, contains no operating system and no bootloader

The Plan

 

We want to install Ubuntu 16.04 into the external hard disk drive, in the second partition (/dev/sdb2), and install the GRUB bootloader into that external hard disk drive (/dev/sdb). Pay attention to this device numbering scheme.

What we want with this plan is to make sure the external hard disk drive with the OS inside, can be booted in any other computer because it already has its own bootloader. We dont use our internal hard disk drive's bootloader, although we can, because we want every hard disk drive has its own bootloader.


ISO Preparation


Download Ubuntu 16.04 ISO from http://ubuntu.com. Alternatively, if you want to apply this tutorial while 16.04 has officially released later, you may download the ISO from an ISO mirror in your country. See the countries complete list here https://launchpad.net/ubuntu/+archivemirrors. If you want to apply this before the official release, download the ISO from http://cdimage.ubuntu.com/daily-live/current/.

Disk Preparation

 

We don't limit your freedom to partition your own drive. We just give you an example, one of the easiest partitions scheme (at least for us). We have an external hard disk drive at size 320 GB, we give it MBR partition table (not GPT), and we divide it into 10 partitions with the scheme:


External Hard Disk Drive (/dev/sdb)
partition
type
size
filesystem
/dev/sdb1
primary
20 GB
ext4
/dev/sdb2
primary
20 GB
ext4
/dev/sdb3
primary
20 GB
ext4
/dev/sdb4
extended




/dev/sdb5
logical
20 GB
ext4
/dev/sdb6
logical
20 GB
ext4
/dev/sdb7
logical
20 GB
ext4
/dev/sdb8
logical
20 GB
ext4
/dev/sdb9
logical
20 GB
ext4
/dev/sdb10
logical
140 GB
ext4


Info: as you may knew, MBR partition table only permits maximum 4 partitions if they are all primary. If we want to install more than 4 operating system (more than 4 partitions), we may create 3 primary and 1 extended. Then, we may create any number of logical partition inside the extended partition. That's why you see there are 1 extended and 6 logical partitions above. By using this scheme, we may have 10 partitions in MBR hard disk drive.


Installation Media Preparation


Installation media is any storage you would use to install the OS. This may be a CD, DVD, USB drive, HDD, or even a network. Today, the USB drive has become the common media to install any GNU/Linux distribution. It is cheaper than CD (because you may burn ISO in any number of time), easier, and faster. You must create installation media to install anything.

To burn the Ubuntu ISO into you USB flash drive, according to your current operating system:

  • In GNU/Linux: you may use Unetbootin program. But if your are currently using Ubuntu, it already has Startup Creator program to burn Ubuntu ISO into USB drive.
  • In Windows: you may use Universal USB Installer (GNU GPL 2) program.

1. Boot The Installation Media

 

We assume your media is USB drive. Insert the media > reboot > enter the BIOS > set BIOS to boot into USB drive > save > reboot. This will boot operating system inside your media. Ubuntu will boot from there, and finally give you user interface to choose between Install and Live. Choose Live.

2. Open Ubuntu Installation Program (Ubiquity)

 

In the Live Session, you may see Install Ubuntu icon on the desktop. Double click it and Ubiquity (the OS installer program) should launch. The first page you will see is Welcome Screen asking you the language you prefer. We recommend you to use English.

3. Pre-partitioning

 

In the pre-partitiong stage, you will see some steps:
  1. Wireless: you will be asked for using any wireless network attached, whether it is WLAN or LAN or anything. We recommend you to not connect to anything, so select I don't want to connect. Next.
  2. Preparing to install Ubuntu: you will be asked for two things: download updates automatically and install third party software. We recommend you to not download anything, so select nothing. Next.
  3. Unmount partition: you will be asked to unmount (unattach) some partitions that is still mounted (attached) into your system. Because you must unmount the partition in case to format it. Select Yes. Next.
  4. Installation Type: you will be asked to select what partitioning type to do. Don't select anything except Something Else. Warning: selecting any else option could destroy all of your hard disk drives data. Don't believe any automatic partitioning. Next.

4. Partitioning

 

Warning: partitioning or formatting any hard disk drive is very dangerous. For doing this, you must not in a sleepy condition, you must pay attention and concentration, otherwise you may destroy all data in whole hard disk drives.

First thing to pay attention at, is, to locate where is your hard disk drive and where is your target partition. We have mentioned that our target is hard disk /dev/sdb and partition /dev/sdb2. But you must pay attention, sometimes, Ubiquity reads /dev/sdb as /dev/sda. Here, our /dev/sdb read as /dev/sda so our target here is the partition /dev/sda2. You must locate correctly where is your target partition.

Using label names, making the partitions' size different, making the partitions' filesystem different, or ideally provide all empty partitions (like we did) is very helpful to ensure we don't make any mistake here.


This stage has some following formatting steps:
  1. Select your target partition entry, for example /dev/sda2.
  2. Click Change… button.
  3. Don't change the partition size available, because you have already formatted it previously to have that size.
  4. Change the filesystem into ext4.
  5. Change the mount point into '/' (slash). This means the root filesystem, the highest point of your operating system partition.
  6. Check Format this partition (optional) to make it sure all data inside /dev/sda2 will be erased.
  7. Press OK.
  8. Wait while Ubiquity prepares the partition as you chose.



Then you better create a swap partition:
  1. Select an empty partition you've prepared. You will need about 2 until 4 GB only for swap.
  2. Click Change… button.
  3. Change the filesystem into swap.
  4. Or, select an empty partition, press Change…, then resize any amount larger than 4 GB into 4 GB only or just 2 GB. You don't need 8, 10, or even 40 GB swap.
Then you must enter bootloader installation steps:
  1. See the Device for boot loader installation: field. It is located at bottom of the Ubiquity partitioning screen.
  2. Select the hard disk drive name where the partition belong. In this case, because the partition is /dev/sda2, then you should choose /dev/sda (the hard disk drive). Installing bootloader in the hard disk (not the partition) help you to recognize all operating systems inside the hard disk, not only one in the partition.
Then if you have rechecked them again, and you are sure, press Install Now.

5. Post-partitioning


After pressing Install Now, installation begins and is running, while you enter this stage with some steps:
  1. Choose your country region of time. Next.
  2. Choose your keyboard layout. For most users, default choice is safe. Next.
  3. Choose your username, password, and computer's name. Next.
  4. Wait while Ubiquity is installing.
  5. Once finished, you will be asked whether to Continue Testing (LiveCD) or Restart Now.


Installation finished. Now you can enjoy your new operating system Ubuntu 16.04.

6. Recovery


In some cases, you won't get a normal bootloader while you can choose one operating system and simply press Enter to boot into. Sometimes, you can't. Because, sometimes GRUB failed to install itself into the external hard disk drive. If this happens, you will find only a GRUB prompt where you must type some commands to boot your operating system manually. It is difficult if you don't know what command to type, but it is pretty easy if you know how. We've prepared for such condition the article Booting GNU/Linux Manuallywith GRUB Prompt to enter your operating system in external hard disk drive.