Install linux with uefi

Official Ubuntu Server compressed image boots in UEFI and BIOS mode

When you have installed these systems from a compressed image file, and you reboot, you log in with the following user and password:

user: ubuntu

password: ubuntu (and you are prompted to change it directly after the first login)

Preparation

It might help to prepare by reading the following link

The following link gives more background information about partitioning

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

Stable alternative 1

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 16.04 LTS ‘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.

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

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.

Stable alternative 2

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

Installation from a compressed image file

  • if you want to learn how to do it, or
  • if you want to be sure of the content (and don’t rely on me), or
  • if you want hibernation, or
  • if you want an encrypted disk (LVM with LUKS encryption),
Читайте также:  Общая папка для kali linux

then you must do it yourself. (In the encrypted disk case, you must create the passphrase yourself during the installation.)

Compressed image file

It is straight-forward to install from a compressed image file using mkusb or mkusb-nox. Some tools may not work with compressed images of such large files. I tried in Lubuntu Xenial 32-bit 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 source 1

Download the following compressed image files from

where you also find a gpg-signed file with md5sums, md5sum.txt.asc.

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

Источник

Easy way to get installed Ubuntu 20.04 LTS that boots in UEFI and BIOS

This is an update, basically using the method described below, but making things a bit easier.

Template file

There is a compressed image file, that can be used to set up the boot structure to boot in both UEFI and BIOS mode. It is easy to extract and clone to a USB pendrive or other drive (SSD or HDD), and after that it can be used directly to boot into an iso file, and indirectly (after some tweaks) into an installed system.

Method

I will describe the method that I used to create the system in the compressed image file

  • From the template file you extract, clone and fix a boot system in the target drive. It is easy, (one simgle step) with mkusb, but you can perform each step with other tools in Linux or Windows.
    • There is an alternative to create a grub-n-iso drive described at . /isoboot, but here we use this template for an installed system, that will be portable if installed in an external drive.
    • A useful thing to do in the menuentries is to point to the links in the root partition for vmlinuz and initrd to make the boot system independent of upgrades of the kernel, because they have the same name but will be upgraded and point to the two most current kernels.

    The future will show if this boot system can resist upgrades of Windows and Ubuntu.

    So, if there are problems, please send a mail to: nio dot wiklund at gmail dot com.

    Simple and stable portable system for UEFI and BIOS

    Current system, seems very stable so far

    • Standard Ubuntu
      • dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-12GB.img.xz (old)
      • dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-4-pendrive-12GB.img.xz
      • dd_Ubuntu_16.04.1_2017-01-17_UEFI-n-BIOS-12GB.img.xz (961MiB)
      • dd_text_16.04-UEFI-n-BIOS_2017-01-15_intel-4-pendrive-7.8GB.img.xz
      • dd_text_16.04-UEFI-n-BIOS_2017-05-07_intel-4-pendrive-7.8GB.img.xz (349MiB)
      • dd_dus-lxde_16.04-UEFI-n-BIOS_2017-05-07_intel-4-pendrive-7.8GB.img.xz (544 MiB)

      were created according to the following description (written from memory, I may have forgotten some detail).

      Origins

      • The Ubuntu image files were made starting from an Ubuntu Xenial 64-bit daily iso file (shortly before the release, more than beta, ‘gamma’).
      • The image file of the mini system with text screen was made starting from the Ubuntu Server 16.04 64-bit iso file. A minimal system was created as a starting point for any of the Ubuntu flavours including Ubuntu Server.
      • The image file with light-weight desktop LXDE and mkusb-dus pre-installed was made from the from the Ubuntu Server 16.04 64-bit iso file via the the mini system with text screen.

      Remove or replace the internal drive of the computer you intend to use

      This is because it wants to use /dev/sda for the EFI partition.

      Boot into the live system

      Boot into the live system, but if the target is also a USB pendrive, plug it in before continuing from the grub menu.

      Install this Ubuntu system into a drive with at least 16 GB (pendrive, other external drive, or internal drive). Install this text system into a drive with at least 8 GB. If you install to a pendrive it should be a fast pendrive.

      Create a partition table

      Create a partition table with mkusb/wipe using mkusb-11 ‘classic mode’,

      Advanced: create GUID partition table (skeleton for installing an OS)

      After that, use gparted to get a partition table with partitions for EFI, root and swap.

      09-gparted.png

      Install

      Boot into Ubuntu live alias ‘Try Ubuntu’ from an amd64 iso file in UEFI mode. (It might work in BIOS mode, but I did not try that.)

      Start the installer. At the partitioning window, select Something else and install into the root partition 3 and swap partition 4.

      Create boot-loading systems for external drives

      While running the live system in UEFI mode

      sudo mkdir /mnt/efi sudo mount /dev/sdx1 /mnt/efi sudo mkdir /mnt/root sudo mount /dev/sdx3 /mnt/root sudo grub-install --force --removable --no-floppy \ --boot-directory=/mnt/root/boot --efi-directory=/mnt/efi /dev/sdx

      It is best if you manage to make the computer see the target drive as /dev/sda (that x is a).

      Reboot the live system into BIOS mode, install grub-pc and install the bootloader for BIOS mode

      sudo apt-get install grub-pc sudo mkdir /mnt/root sudo mount /dev/sdx3 /mnt/root sudo grub-install --force --removable --no-floppy --boot-directory=/mnt/root/boot /dev/sdx

      If some minor detail goes wrong, you may need to repeat the installation of the bootloaders (trial and error).

      gpt-fix

      If you clone the compressed iso files, you need to fix the GUID partition table, GPT, because in most cases you clone to another drive size, and GPT is sensitive to that (which is different from the old MSDOS partition table). I made a shellscript file, gpt-fix, that does the work for you. It works for the cases that I have tested. gpt-fix uses gdisk under the hood, and you may need to install it. Run gpt-fix in the directory, where you downloaded it (or install it into a directory in $PATH).

      sudo apt-get install gdisk # install if necessary sudo bash gpt-fix /dev/sdx # in the directory, where you downloaded gpt-fix

      where x is the drive letter.

      Comments and screenshots

      The method described above seems to create a stable system when used in a USB pendrive and also in an SSD connected via eSATA and USB. It is tested in three different laptops, a Toshiba Satellite and an HP Elitebook and a Lenovo X131e and in an ultra-small desktop computer, Intel NUC 6i3SYH, and it has survived such adventures in UEFI and BIOS mode.

      It might or might not work to flash the pendrive image directly from a compressed image file to an SSD or HDD drive depending on the sector sizes. The sector size according to parted, 512b/512b, is shown in screenshot #2, in the output from parted.

      Ubuntu

      Screenshot of ‘Ubuntu 20.04 LTS — installed’

      ../25-dd_unb_ubuntu-20.04_15GB_2020-06-26.png

      Pendrive version

      11-booted-in-bios-mode.png

      10-dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-4-pendrive-12GB.png

      In the HP computer it boots via eSATA, where it also works when installed according to the description above. It is possible to boot from USB via chainloading. (This HP computer does not want to boot directly from USB if there is a GPT partition table).

      HDD/SSD version

      12-dd_Ubuntu_16.04-gamma-UEFI-n-BIOS-4-HDD-SSD-12GB.png

      Mini system with ‘text’ screen user interface

      When Fluxbox is installed, it can be started from here.

      13-text-mode-menu-64.png

      15-font-submenu-64.png

      Prompt to update and dist-upgrade the system before installing meta-packages:

      16-prompt-to-update.png

      17-installer-submenu-with-tasksel-64.png

      Move the cursor with the arrow keys and select (the item at the cursor) with the space bar.

      18-tasksel-menu.png

      Tasksel menu example with selected items marked with asterisks:

      18-tasksel-menu-selected.png

      These screenshots of the text menus are no real screenshots from the console. They were actually made after installing openssh-server and logging in remotely, they are screenshots from ‘xterm -fa default -fs 13’.

      The partitions and file systems are listed by parted and lsblk in the following code block:

      guru@uefi-n-bios:~$ sudo parted /dev/sda print [sudo] password for guru: Model: ATA Samsung SSD 850 (scsi) Disk /dev/sda: 250GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 316MB 315MB fat32 boot, esp 2 316MB 317MB 1049kB bios_grub 3 317MB 7262MB 6946MB ext2 root 4 7262MB 7799MB 537MB linux-swap(v1) [1]+ Done xterm -fa default -fs 13 guru@uefi-n-bios:~$ lsblk -o MODEL,NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE /dev/sda MODEL NAME FSTYPE LABEL MOUNTPOINT SIZE Samsung SSD 850 sda 232.9G |-sda1 vfat EFI /boot/efi 300M |-sda2 1M |-sda3 ext4 root / 6.5G `-sda4 swap [SWAP] 512M guru@uefi-n-bios:~$

      Tweak the system

      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. Add noatime to your own line.

      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.

      Remove journaling

      sudo tune2fs -O ^has_journal /dev/sdxy

      where x is the drive letter and y is the partition number of the root partition, in my case /dev/sda3

      Move swap and grow root partition

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

      Login and password for the system to download

      The systems in the compressed image files described at ../#Installation_from_a_compressed_image_file have the following user and password

      user: guru password: changeme

      Install from compressed image file

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

      It is straight-forward to install from a compressed image file with mkusb or mkusb-nox.

      After this cloning operation you should run gpt-fix in order to match the gpt data to the current drive size (unless you are running mkusb version 10.6.6 or newer versions of mkusb, where gpt_zap and gpt_fix are built-in).

      See the detailed description at this link: ../#Installation_from_a_compressed_image_file

      Installation/UEFI-and-BIOS/stable-alternative (последним исправлял пользователь nio-wiklund 2020-06-27 11:48:49)

      The material on this wiki is available under a free license, see Copyright / License for details
      You can contribute to this wiki, see Wiki Guide for details

      Источник

Оцените статью
Adblock
detector