The Ubuntu system is installed on a mobile solid-state hard drive, enabling plug-and-play on different computers

1. Preliminary preparation

  1. A USB flash drive for making a system boot disk
  2. UltraISO software: direct Baidu search, download the trial version
  3. DiskGenius software (for disk partitioning)
  4. Mobile solid-state hard disk SSD to be installed system

Second, make the system boot disk

2.1 Ubuntu20.04 system download

  • Go to the Ubuntu official website to find the version you want, such as version 20.04.5, and download the corresponding ubuntu-20.04.5-desktop-amd64.iso file.insert image description here

  • If the download is too slow, you can go to the Tsinghua mirror source website to download, the speed will be much fasterinsert image description here

  • After downloading the Ubuntu system files, start making a USB boot disk.

2.2 Make a USB boot disk

  1. Open the UltraISO software, click "File" in the upper left corner -> "Open..." -> find and select the Ubuntu image file (.iso file) you just downloadedinsert image description here
  2. After the image file is loaded, click "Start" in the upper left corner → "Write Hard Disk Image"insert image description here
  3. A prompt box will pop up, select your own U disk, and then click "Write" to start making a system boot disk, and wait for a while to prompt that the creation is complete.insert image description here

3. Disk partition (key)

  1. Open the DiskGenius software, select the disk you want to install the system on (according to the model), for example, SamsungPSSDT7 here.
  2. Select the disk, right mouse button and select "Convert Partition Table Type to GUID Mode" ( this step is critical, it determines that the Ubuntu system on the mobile hard disk can run on different computers )insert image description here
  3. Disk partitions can be divided into four areas:
    • ESP (0) partition : the file system type is FAT32, and the size I allocated is 1.0GB. This partition is used for the /boot boot partition of the Linux system . The boot files for subsequent startup of the Ubuntu system will be placed in the EFI directory under this partition, so this partition is very important .
    • Partition (1) : The file system type is Linux swap partition, and the size I allocated is 16.0GB. This partition is used for the swap space of the Linux system.
    • Partition (2) : The file system type is EXT4, and the size I allocated is 64GB. This partition is used for the "/" directory of the Linux system.
    • Partition (3) : The file system type is EXT4 and the size I allocated is 320 GB. This partition is used for the "/home" directory of the Linux system.
    • Here I installed the system on a 1T mobile solid-state hard disk. Except for the above 4 partitions, there are about 530G left, and the remaining part can be used as a normal storage hard disk.
  4. Special reminder : In my personal test, only if the partition table type is converted to GUID mode, and the initial location of the hard disk is the ESP partition (EFI format) , can the Ubuntu system installed on the mobile hard disk be plugged into different computers to run.

4. Ubuntu system installation (regular)

  1. Insert the U disk boot disk and the mobile solid-state hard disk to install the system into the computer at the same time;
  2. Restart the computer to enter the BIOS (my computer model is Lenovo Savior REN-7000K, press F2 to enter the BIOS)
  3. After entering the BIOS, set the boot priority to U disk boot priority
  4. The following process is relatively routine, install Ubuntu -> select language -> normal installation -> install type as "other options" -> install the boot device device (be sure to select the partition ESP0 corresponding to /boot, otherwise it will not start) - > Select Region -> Username, Password Settings -> Wait for the installation to complete

For the specific process of this part (detailed pictures and texts), you can refer to the following two tutorials:
- Tutorial on installing Ubuntu 20.04 on a mobile hard disk
- Tutorial on how to install Ubuntu operating system for beginners

Five, boot-repair (important)

After installing the system according to the above process, unplug the USB flash drive according to the prompt, and you can enter the Ubuntu system normally.

However, when the mobile solid-state drive is plugged into other computers, it cannot be used normally because there is no boot file in the ESP partition of the mobile hard drive. The solution is as follows:

  1. Plug in the U disk and mobile solid-state hard disk again, enter the BIOS and select the U disk to boot first, and after entering the Ubuntu system in the U disk, select Try Ubuntu without installing
  2. Connect to the network and install the boot-repair software:
sudo apt-add-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install boot-repair
  1. After the installation is complete, open the terminal to execute the software
# 打开一个终端
boot-repair
  1. Select "Recommended repair" and wait for the repair to complete
  2. How to confirm that the repair is complete:
  • If the repair is completed, a directory named EFI will appear in the ESP partition, which contains two subdirectories BOOT and ubuntu. The boot file used to start the Ubuntu system is the shimx64.efi file located in the ubuntu directory
  1. After confirming that the repair is complete, you can plug the mobile solid-state drive into a different computer to run the Ubuntu system.

This part of the process mainly refers to the following tutorials:

6. Summary of key points

  1. Portable solid-state drives need to use DiskGenius (or software with similar functions) to convert the disk type to GUID format.
  2. In order to avoid problems such as misaligned disk partitions and boot partitions not at the beginning of the disk when installing the system, it is best to create partitions on the disk in advance.
  3. When installing the system, select the device to install the bootloader, and be sure to select the created ESP(0) partition, otherwise it will not start, because the ESP(0) partition corresponds to the /boot boot partition of the system.
  4. In order to make the Ubuntu system installed on the mobile hard disk run on different computers, it is necessary to execute the boot-repair process to create the EFI directory of the ESP partition.

7. Reference Tutorial

  1. Install Ubuntu20.04 tutorial on the mobile hard disk
  2. Step-by-step tutorial for beginners to install Ubuntu operating system
  3. Install Ubuntu 18.04 in the mobile solid state drive and run it on other computers
  4. Some records of installing Ubuntu system (UEFI boot) on mobile hard disk

Guess you like

Origin blog.csdn.net/hypc9709/article/details/127941834