I am teaching a class for novice computer users to learn how to use linux. I want to have them all create a bootable USB from the live Xubuntu USB so that they will be able to save software and files they create during the course, and to have the experience of installing an operating system. I am told that the Ubuntu installation live disc has a bug that actually installs the bootloader to the hardrive even though one specifies the correct location in the installation program. What is a good recipie for such an installation?
1 Answers
Instructions for Burning Xubuntu to USB
The following instructions were cultivated from the following three webpages and represent a blend of their techniques:
The first one is the most comprehensive, but there are useful ideas in both of the others. One thing to note is that if you are using a BIOS computer (that is a computer that is still booting with a true BIOS), then you can just use the Xubuntu USB without special fiddling. The only special things you need to do are to make sure you pick the usb for both the location for installing the OS and the location for the boot program.
However, if you are using a UEFI system (and most of us are at this point) then a bug in the Ubuntu installation disk (which seems to have been around for ages) will not install the boot program to the USB you indicated, but rather will install it on to your home directory. That can make life difficult for all, and scary for the novice.
I tried pretty much all the routines in the linux mint description, and not all of them worked reliably for me. They would usually work on the computer I used to generate them, but not on random other computers I tried to boot from. For that reason, I went with this hybrid method that seemed reliable for UEFI systems.
Detailed Installation Instructions for Installing Xubuntu (and probably other -buntus) to a USB from a USB.
- You need at least two usbs to be able to be plugged in.
- Boot the live Xubuntu disk. To do this you will first have to figure out what special magic is needed to make your computer allow usb booting. Each manufacturer and OS system has their own combination of keys and boot start-up settings that are required. You have to figure that out first, before starting here.
- Make sure to open up the power management settings and make sure nothing turns off or goes to sleep while you are doing this. Pay attention to the Display tab. Even on power this will put your screen to sleep, which can cause you to lose all your work. Set them to "never" by dragging all the way to the left of the sliders.
- After the live USB is booted (you selected Try Ubuntu) open a terminal and launch
gparted. Gparted is a program for partitioning drives. - Make sure the device selected on gparted is the USB you want to install the system to. You can use the size to help. The usb you booted from will probably have type ISO 9600. If in doubt, plug in the new USB after starting gparted and noting all the devices, and then refresh devices and see which one is the new one.
- Make a new
GPTpartition table for the USB. This will wipe out all the data you have on that USB (or any other disc you incorrectly set). - Make a 200 MB FAT32 partition.
- Make the rest EXT4 for simplicity.
- Apply those partitions so that you can ...
- Set the
efiandbootflags for the 200 MB FAT32 parition. Use the manage flags menu. - Right click on that partition and click on the info tab. Write down the UUID. It will probably be two four digit numbers separated by a hyphen.
- Close gparted.
- Back in your terminal, run
ubiquity -b. This will start the installation program, but will not require you to install a boot loader. You will do this manually later. - Follow the screens until you get to where to install things. You want something else.
- Chose the EXT4 partition of the USB you formatted for change. Select it as an EXT4 and mount to "root" which is
/. Do not format (you already did that). - Install the system.
- When it is done continue with "continue testing."
- For the rest of this I am assuming that your USB is /dev/sda and your FAT32 partition is /dev/sda1. You need to replace those names with the correct names of your partition for you system. If in doubt, open up gparted again to verify what it is.
- Log on to your wifi and make sure you have network connectivity. Ethernet is fine to if you have been using that.
- Open up your terminal. And enter the following commands:
sudo mount /dev/sda2 /mnt
mkdir /mnt/boot/efi
sudo mount /dev/sda1 /mnt/boot/efi
nano /mnt/etc/fstab
- What you are doing here is "mounting" your USB at a particular mount point on the booted live system. You will now be able to see those partitions and write to them. First, you mount the root at the top, and then you boot your boot system in its proper place in the hierarchy. You may or may not need to create the directories.
The editing of fstab is to make sure that your system knows the correct location for booting in the future. By using a universal identifier your system should update properly.
Edit the fstab to point to your usb's boot location thus: In the file
fstabcomment out (with a#) any line forboot/efiand replace the UUID part with the UUID you wrote down earlier making a new line. This way you keep the old one to refer to if necessary while making a new one. Your new one should look something like:UUID=0123-ABCD /boot/efi vfat defaults 0 1Then you exit out of nano and resume in your terminal.
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt/$i; done
sudo cp /etc/resolv.conf /mnt/etc/
modprobe efivars
sudo chroot /mnt
What you are doing here is giving your new usb access to functionings of the current running system that it will need later when we trick it into thinking that it is the root.
Now we install the program we will use for booting
grub2. We will do this from a /chroot/ environment. Where we ch ange the root so that we can put grub on /dev/sda and not on our hard diskapt install grub-efi
If that did not work you may have to
apt updatefirst to populate your list of softwaregrub-install -d /usr/lib/grub/x86_64-efi --efi-directory=/boot/efi/ --removable /dev/sdaThe removable bit is to help with the proper updating
It may not be necessary to do a
update-grubat this point, but I was getting fatigued and did not thoroughly check. I just did one, and it seemed to work.Need to exit chroot and then umount all the mounted directories. You do this by
umountin order all the things youmounted before and in the opposite order. Especially your/mnt/boot/efiwhich you do not want to corrupt after all this.Then you should be able to boot your system on a uefi computer
The recipie is detailed here with a general outline for the course: https://github.com/brittAnderson/psych363/blob/master/course.org#51-instructions-for-burning-xubuntu-to-usb
- 205