0

I installed ubuntu from a usb drive and it all went fine and is working well but i accidentally installed it ONTO the usb drive and now it needs to be plugged in all the time as that is where the os is actually located, how do i move it onto my computer's internal hard drive??

NAME FSTYPE LABEL UUID MOUNTPOINT  

sdb
├─sdb5 ext4 7c39212a-20e5-4e92-9d21-1714959c4b8e
└─sdb1
sda
├─sda2
├─sda5 ext4 6d2ddbb4-a126-4a80-aee6-1e7f6f6f73a1 /home
└─sda1 swap c6ac02d8-7986-420a-9374-129a3656b0c9 [SWAP]

NAME MOUNTPOINT LABEL SIZE FSTYPE UUID  

sdb 7.4G
├─sdb5 / 7.4G ext4 7c39212a-20e5-4e92-9d21-1714959c4b8e
└─sdb1 1K
sda 74.5G
├─sda2 1K
├─sda5 /home 18.6G ext4 6d2ddbb4-a126-4a80-aee6-1e7f6f6f73a1
└─sda1 [SWAP] 487M swap c6ac02d8-7986-420a-9374-129a3656b0c9

ubfan1
  • 19,049

1 Answers1

0

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.

L. D. James
  • 25,444