I encountered an issue while attempting to install Ubuntu via live USB. The graphical installer did not offer the option to choose manual partitioning. Even when I selected the empty partition, the installer showed an empty partition list. I also faced a similar situation while selecting the hard drive to install the bootloader. As a result, I had to install Ubuntu 24 alongside another previously installed version of Ubuntu.
Can Ubuntu 24 be installed on an empty partition using minimal.squashfs through the terminal?
In this guide, we'll install a fully functional and bootable Ubuntu 24 on an empty partition using
minimal.squashfs
file via the terminal. You can use either the current Ubuntu/Linux or Ubuntu Live USB disk.However, before proceeding, please make sure to create a backup of your data. Also, if you're not familiar with commands like
mkfs, mount, umount, and /dev/XXX
, I advise you not to read this answer.1- Formatting the partition
2- Mount that empty partition
3- Extract the files to the empty partition
If you haven't done so already, it's recommended that you install
squashfs-tools
.if you are not using live Ubuntu from a USB flash drive, go to the step no.4
If you're using live Ubuntu from a USB flash drive, you'll need to mount another partition to copy the
minimal.squashfs
file to it. You can find theminimal.squashfs
in the ISO file or the Ubuntu live USB in the/casper
directory.to mount another partition:
copy the
minimal.squashfs
file to this partition, and put the path in the previous step.Please make sure that you have entered the correct path in the previous step before proceeding further.
To complete the installation process without any errors:
4- Configure external mount points:
5- Access chroot environment
6- Define chroot environment
7- Configure machine-id and divert
8- Upgrade packages
9- Install packages needed for the System (Install Grub and Linux Kernel)
In this step, you will see recommended grub and kernel packages for your device. If they are not listed in my commands, please install them.
In case, you are unable to access the internet, you can locate all these packages in the Ubuntu ISO file, or buntu Live USB disk under the
/pool
directory. You can then copy all these packages to the/ubuntu
directory and execute the following command:dpkg -i *.deb
, or make new folder/deb
as an example, and execute the following command:dpkg -i /ubuntu/deb/*.deb
It's possible to install drivers and custom apps using the terminal either online or by placing them in the
/deb
directory and executing the commanddpkg -i /deb/*.deb
.10- Grub (update the boot menu in the new OS)
11- Create fstab
A simple example of
fstab
is12- Cleanup the chroot environment
13- Unbind mount points
14- update the boot menu in the current OS
This step when you use Ubuntu/Linux from your device
If you use Ubuntu Live from a USB drive, cancel this command, install the
grub
bootloader on the Hard disk, or use theboot-repair
package.15- Reboot
After rebooting your computer, you can set up your account, local, and language settings. Everything should work properly on the first try after the splash screen ends.
These pages helped me in these steps:
How to create a bootable fully functional Ubuntu from debootstrap ?
Installation/FromLinux
How to create a custom Ubuntu live from scratch
Create USB drive contains multi Ubuntu versions