UEFI-and-BIOS

Preparation

It might help to prepare by reading the following link

https://help.ubuntu.com/community/Installation/FromUSBStick

The following link gives more background information about partitioning

https://help.ubuntu.com/community/DiskSpace

Original attempt

/original-attempt

Not stable enough to survive certain updates

I expected that it could be installed into a USB pendrive as a good alternative to a persistent live system, possible to update and upgrade without limits. But unfortunately a current update involving a new kernel and updating grub will make it fail to boot. So this system is not stable enough to survive certain updates. It is good only as an illustration of a method to make a bootable drive in UEFI as well as BIOS mode.

Stable alternatives

If you want a stable portable system, that boots in UEFI mode as well as BIOS/CSM mode, and in 64-bit as well as 32-bit computers, you can try One pendrive for all PC (Intel/AMD) computers. If you want a pendrive with a live and an installed system, you can try A new and so far successful attempt to create a stable portable system, that works in UEFI and BIOS mode.

Detailed instructions

There are links to instructions how to make an installed system (typically in a USB pendrive) that works with UEFI and BIOS, and is small enough to work in an undersized 16 GB pendrive. This system is created from Ubuntu Xenial amd64 ('gamma' because it is beyond beta), and was simplified compared to the previous methods to make a stable installed system for UEFI and BIOS mode.

See this link to the sub-page: /stable-alternative

This link shows the post in an Ubuntu Forums tutorial, where the method was published:

Another new, simpler and so far successful attempt to create a stable portable system, that works in UEFI and BIOS mode

with a description how to make it 'from scratch' plus a link to uploaded compressed image files plus a small script to fix the GPT after cloning.

Installation from a compressed image file

It is straight-forward to install from a compressed image file from http://phillw.net/isos/linux-tools/uefi-n-bios/ with mkusb or mkusb-nox. Some tools may not work with compressed images of such large files. I tried in Lubuntu Xenial daily to restore disk image with gnome-disks alias Disks, but it considered the size to be 3.5 GB, when it was 12 GB, so the image was truncated, Bug #1571255

After this cloning operation you should run gpt-fix in order to match the gpt data to the current drive size.

Description of the short-cut to make an installed system (typically in a USB pendrive) that works with UEFI and BIOS from a compressed image file:

Download the compressed image file dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-4-pendrive-12GB.img.xz from

http://phillw.net/isos/linux-tools/uefi-n-bios

Remember to check with md5sum, that the download of the compressed image file was successful.

The same procedure applies to

the version for solid state and hard disk drives dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-12GB.img.xz

and the mini system with a text user interface dd_text_16.04-UEFI-n-BIOS_2016-05-27_4-pendrive-7.8GB.img.xz

and the mini system with a text user interface dd_text_16.04-UEFI-n-BIOS_2016-05-27_intel-4-pendrive-7.8GB.img.xz for Intel graphics

in Linux

The target drive will be overwritten. Double-check which is the target drive, the drive you want to install into!

Use mkusb to install the system from the compressed image file.

See https://help.ubuntu.com/community/mkusb

gpt_fix in mkusb

The GUID partition table, GPT, is fixed automatically, if you use mkusb 10.6.6 or a newer version to install from these compressed image files. The functions gpt_zap and gpt_fix are built into mkusb.

If you use other tools, you need gpt-fix or to fix the GPT manually with gdisk.

in Windows

Check the download and clone the image in Windows

Download the following help programs

http://www.md5summer.org

http://www.7-zip.org

http://sourceforge.net/projects/win32diskimager

First check that the download was successful with md5summer according to the file md5sums.txt.asc.

Next extract the image file with 7-zip (It is also possible with winzip)

from dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-4-pendrive-12GB.img.xz

to dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-4-pendrive-12GB.img

The target drive will be overwritten. Double-check which is the target drive, the drive you want to install into!

Then write the extracted image file (without the ending gz) with win32diskimager

Win32diskimager looks for img files.

gpt-fix

After this cloning operation you should run gpt-fix in order to match the gpt data to the current drive size (unless you are using mkusb version 10.6.6 or newer versions of mkusb).

See more details at /stable-alternative#gpt-fix

Final system tweaks

Decrease wear for a pendrive

Add the mount option noatime in /etc/fstab

# / was on /dev/sdb3 during installation
UUID=4c518694-d97c-4910-bb7b-eeb6a6b73874  /  ext4  noatime,errors=remount-ro 0  1

Do not copy this line. Use your own data, only add noatime,

Turn off journaling

sudo tune2fs -O ^has_journal /dev/sdxy

where x is the drive letter and y is the partition number of the root partition, for example /dev/sda3.

Maybe remove swap

It is also possible to remove the swap partition and the swap entry in /etc/fstab in order to avoid wear due to swapping.

Move swap and grow root partitions

Move the swap partition and grow the root partition to use the whole drive. See this link

http://phillw.net/isos/linux-tools/uefi-n-bios/GrowIt.pdf

Login and password for the system to download

The systems that are installed from the compressed image files

http://phillw.net/isos/linux-tools/uefi-n-bios/dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-12GB.img.xz

http://phillw.net/isos/linux-tools/uefi-n-bios/dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-4-pendrive-12GB.img.xz

http://phillw.net/isos/linux-tools/uefi-n-bios/dd_text_16.04-UEFI-n-BIOS_2016-05-27_4-pendrive-7.8GB.img.xz

http://phillw.net/isos/linux-tools/uefi-n-bios/dd_text_16.04-UEFI-n-BIOS_2016-05-27_intel-4-pendrive-7.8GB.img.xz

have the following user and password

user:     guru
password: changeme


Links

If you want a stable portable system, that boots in UEFI mode as well as BIOS/CSM mode, and in 64-bit as well as 32-bit computers, you can try One pendrive for all PC (Intel/AMD) computers. If you want a pendrive with a live and an installed system, you can try A new and so far successful attempt to create a stable portable system, that works in UEFI and BIOS mode

It might be a good idea to try various systems and methods before deciding what to install. Try Ubuntu (Kubuntu, Lubuntu, Xubuntu, ...) before installing it

The following links contain general information

https://help.ubuntu.com/community/Installation/FromUSBStick

https://help.ubuntu.com/community/DiskSpace

Win32DiskImager/iso2usb/temp/UEFI-and-BIOS (last edited 2016-05-27 09:30:08 by nio-wiklund)