Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To over-write the existing hard-drive with the backup image, we first have to identify the name of the hard-drive, usually it is "/dev/sdXsdx", with the 'Xx' being 'a', 'b' or 'c', etc.

...

Code Block
languagebash
themeRDark
gzip -dc /path/to/image.gz | sudo dd status=progress of=/dev/sdXsdx

Make sure to select the whole drive, such as "/dev/sda" or "/dev/sdb", and not an individual partition such as "/dev/sda1" or "/dev/sdb1".

Warning

The above command will over-write any existing data on the target device "/dev/sdXsdx", ie. the entire hard-disk and all it's partitions! Make sure to select the correct hard-drive and backup any data which is still needed.

...

Code Block
languagebash
themeRDark
linenumberstrue
sudo apt install cloud-guest-utils
sudo growpart /dev/sdXsdx 2		# assuming /dev/sdX2sdx2 is the home partition
sudo resize2fs /dev/sdX2sdx2