0

I have just bought a new HP 290 G3 Small Form Factor pre-built Desktop. Instead of dual-booting, I would like to erase the disk to install Ubuntu as the hard disk is not that big and I would like to save the space for storing a Windows OS. Have used Ubuntu for a few years, from 14.04 to 20.04 and I have never needed to switch back to Windows although I have dual-boot settings in my previous PC.

The only concern is that with new hardware, I am not 100% sure if Ubuntu supports all the hardware and just in case if I need to switch back to windows, is there a way I can reinstall the windows that come with the pre-built PC? If yes, any preparation I will need to do before I install the Ubuntu?

cytsunny
  • 165
  • 1
    You could use an Ubuntu live installer USB, boot from it, and chose the option "Try Ubuntu without installing". That will leave your main disk and your Windows alone. Yet, if there would be some hardware compatibility issues, those could be identified in this Try Ubuntu session. Isn't that so? – Levente Feb 18 '21 at 14:29

1 Answers1

1

Backup Windows Disk for Later Re-install

1) Create Image file from existing operating system:

  • Boot Live Ubuntu USB in the computer with disk to be cloned.

  • Create an image file, on a data drive with adequate space, of the disk to be cloned, using Gnome-Disks.

enter image description here

enter image description here

2) Truncate image for distribution, remove unwanted space from end of image file. (optional)

Example: Removes NTFS Microsoft basic data partition or empty space from end of drive.

Input

ubuntu@ubuntu:~$ cd /media/ubuntu/DATA/
ubuntu@ubuntu:/media/ubuntu/DATA$ fdisk -l DiskImageofw10.img

Output

Disk DiskImageofw10.img: 28.66 GiB, 30752636928 bytes, 60063744 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 82741D01-6511-4A8A-8FDF-52D8C165C178

Device Start End Sectors Size Type DiskImageofw10.img1 1953 3906 1954 977K BIOS boot DiskImageofw10.img2 3907 503906 500000 244.1M EFI System DiskImageofw10.img3 505856 44578815 44072960 21G Linux filesystem DiskImageofw10.img4 44578816 60061695 15482880 7.4G Microsoft basic data

Input

ubuntu@ubuntu:/media/ubuntu/DATA$ truncate --size=$[(44578815+1)*512] DiskImageofW10.img

3) Compress image to save space:

  • For xz compression using 7Zip. Install 7Zip for Windows: https://www.7-zip.org/a/7z1900-x64.msi or for Ubuntu P7Zip Desktop from the Ubuntu store. Once 7Zip has been installed on Windows or Ubuntu, flashing tool should work without first decompressing xz file..

  • PKZip compression, may also be used but compression is not as tight.

4) Re-install Image File to original drive

Caution: The target drive will be overwritten.

  • Use the pancake icon in Disks or use Etcher, Rufus, dd or mkusb when you want to restore or clone the image to the original or to another drive.

  • Store the OS image file in the NTFS partition of a storage drive, where it can be flashed to the target drive when required.

Some people prefer using Clonezilla to using Gnome-Disks. I find the learning curve is steeper for Clonezilla.

C.S.Cameron
  • 19,519