Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Installing an Ubuntu System on an external USB drive and making it bootableAs 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: 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. | ||||||||
Line: 63 to 63 | ||||||||
Then we have to re-mount /dev, /dev/pts, /sys and /proc on the USB hard drive: | ||||||||
Changed: | ||||||||
< < | 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. | |||||||
> > | 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: chroot /media/sdc1 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 | ||||||||
Line: 71 to 75 | ||||||||
apt install grub-efi-amd64 and finally we can install the boot loader: | ||||||||
Changed: | ||||||||
< < | grub-install /dev/sdc (again make sure /dev/sdc is the correct disk!) | |||||||
> > | grub-install --target=x86_64-efi /dev/sdc (again make sure /dev/sdc is the correct disk!) When I did not manage to install grub-efi-amd64 I got the efi boot to work by copying the directory /usr/lib/grub/x86_64-efi from a working efi disk to the new one. The directory name on the new system was slightly different (x86-64-efi instead of x86_64-efi) which I solved through a symbolic link. | |||||||
In oder to make boot even nicer we want to customize our system with a nice SplashScreen. |