On the test, I installed a clean Ubuntu Server 18.04, during the installation, the system automatically split the disk into one main /dev/sda1, which already had /boot files.
Since I did not have a system with /boot on a separate partition, I transferred it to a separate one and described the process in this article – Transfer /boot from a main partition to a separate partition
Now let’s move the /boot partition to the main /.
Let’s look at the information about the disks:
sudo fdisk -l df -h
Mount the boot partition in the /mnt/ directory:
sudo mount /dev/sda1 /mnt/
Unmount /boot/:
sudo umount /boot/
We copy the files from the partition with the loader to the main:
sudo cp -p -r /mnt/* /boot sudo umount /dev/sda1
Let’s comment the line with the boot partition in the /etc/fstab file (in the nano editor for CTRL+X, y/n for saving or canceling the changes):
sudo nano /etc/fstab
Update the loader:
sudo update-grub
We can restart the system and make sure that it starts:
reboot
On this, the transfer of the /boot partition to the main partition is completed.
The partition /dev/ sda1 is not deleted, there is a bootloader.
See also my articles:
Recovering GRUB Linux
Configuring Software RAID1 on a Running Ubuntu System
Transferring a running Ubuntu system to another disk