Choose the partition on your hard drive where you want to copy your Ubuntu partition. If you don't have a partition, the use Gparted to create one.
You might best consider reserving two partitions. One for the Ubuntu OS and one for swap. Specify as type ext4
for the Ubuntu partition. Specify as type swap
for the swap partition. I would make the one for Ubuntu sufficient large. The swap partition should be about 1 1/2 times the size of the amount of ram you have in the computer.
Use this command to copy the Ubuntu partition from the USB to the hard drive. In this example I'll use /dev/sdb2
for the hard drive I'm using /dev/sda3
. The dd command is a critical and non-forgiving operation, so you have to be very careful when using it. Writing to the wrong partition can cause all data to be removed from that partition.
$ sudo dd if=/dev/sdb2 of=/dev/sda3 bs=32M status=progress
The parameters are:
- if= Read from this device (in your case it should be the USB Ubuntu partition)
- of= Write to this device (in your case it should be the destination partition on your hard drive)
- status= Display progress
Once you have the OS partition copied, install the Grub boot manager on your Hard Drive. While there are many ways to do it. I find the manual steps in this link fairly seamless:
Manually adding or fixing Grub
It works both with UEFI and bio boot.
Note:
The Destination partition must be equal or larger than the source when cloning the partition. Use Gparted to resize the new copied partition to match the size difference so that you will have full use of the space you allocated for Ubuntu.
sudo lsblk -f
and post the output into your original question. – sudodus Apr 20 '18 at 16:16