1

I set up a test system of Ubuntu 24.04 lts and Frappe/ERPNext. It all sits on a 128 GB USB-3 stick connected to my Acer (windows) laptop, which is configured to boot from the stick.

For possible future expansion I am wondering if it is possible to clone the stick onto the Acer hard drive and turn it into a full-on Linux machine ...

Any advice would be welcome. I really .. no .. really really ... Don't want to have to go through the headache of another installation of Frappe/ERPNext from scratch. It was a real PITA to do ...

Thanks in advance

2 Answers2

1

Yes, it is possible to clone from a USB stick to an internal drive, and in most PC computers it will work well. But it depends also on the UEFI-BIOS system of the computer, if the computer will accept it. (Maybe you must modify some setting in an UEFI-BIOS menu).

You can use mkusb to do the cloning in a safe way (mkusb helps you identify and select the correct target drive).

An alternative is to use Clonezilla to perform the cloning. See also this link about Clonezilla.


Edit: Thanks for the heads up, mpboden :-)

The partitions of the drives to be cloned should not be mounted, not the source (and not the target). If mounted, things might change (or be overwritten) during the cloning process and cause corruption of the file system.

It is easiest to clone when booted from a third drive, not the source and not the target. It is also possible to boot from a live drive with the boot option toram, which means that the live system is no longer depending on the boot drive (everything is read into RAM). Then you can check that no partition on the drive to be cloned is mounted and unmount and swapoff if necessary.

So, if you have an Ubuntu iso file, I would recommend to create a[nother] USB boot drive and install mkusb into it. The other alternative is to download a current Clonezilla iso file (for legacy BIOS boot) or zip file (for UEFI boot) and create a USB boot drive, that will boot into a dialogue to clone, create an image or restore an image.

sudodus
  • 47,684
0

Yes, you can do this.

  1. Identify the Source and Target Drives Open a terminal and identify the drives using lsblk or fdisk -l. The USB stick will be the source, and the hard drive will be the target.

lsblk

  1. Clone the USB Stick Using dd Now, clone the USB stick to the hard drive using the dd command. This command will copy the exact contents of the USB stick to the hard drive.

Warning: This will overwrite everything on the target hard drive (/dev/sda in this case). Make sure you’ve selected the correct devices.

sudo dd if=/dev/sdb of=/dev/sda bs=64K status=progress

  • if=/dev/sdb is the input file (your USB stick).
  • of=/dev/sda is the output file (your hard drive).
  • bs=64K sets the block size for faster copying.
  • status=progress shows you the progress of the operation.

This step can take some time depending on the size of the USB stick and the speed of the devices.

  1. Expand the Partition on the Hard Drive (Optional) After cloning, your hard drive will have the exact same partition layout as the USB stick, which might leave a lot of unallocated space if the hard drive is much larger. You can resize the partitions to make full use of the hard drive's space.

Use gparted or parted to resize the partitions.

Resize the partition to fill the entire disk (usually the root partition).

Apply the changes and wait for it to complete.

  1. Reboot and Verify After cloning and installing GRUB, reboot the system. Make sure to select the hard drive as the boot device in the BIOS/UEFI settings.

Once the system boots up, verify that the hard drive is functioning correctly as a fully operational Linux machine by checking system settings, available storage space, etc.

Edu4rdM
  • 1
  • 1