4

So here I just installed Timeshift on my ubuntu 20.04 LTS. As I was trying to set up the backup of my entire system using timeshift, it shows that I can only save backup data on my primary partition. (Mind you that my system is dual-booted with windows 11)

I connected my external hard drive to my system to backup data on it using timeshift, but it shows that "The external hard drive does not have a linux partition" and hence I am unable to backup my data using timeshift.

Currently I have backed up my files normally using the "backups" option, on my external hard drive.

I am a newbie to linux, so I wanted to ask as to how can I create a Linux Partition on an external hard drive?

Also, is "Backup" enough to restore my files if my system somehow breaks down ?

The file system which my external hard drive shows is ExFat

2 Answers2

2

Another option, although maybe less friendly, is to use dd to perform any backups. It requires a HDD with enough space to store a partition/drive the same size as the one being backed up. dd creates an exact copy of your drive (including free space & deleted files) which makes it perfect for backups as you can literally just switch the hard drives out or copy it over to a new partition.

First you need to boot from live usb. Then run sudo fdisk -l which will list all connected drives and partitions. This will list all sorts of useful information. Take not of the /dev/nvme* or /dev/sd* as this is the drive/partition path. Take note of your block size. The output should look something like this:

Disk /dev/nvme0n1: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
    Disk model: Samsung SSD 980 1TB                     
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 16384 bytes / 131072 bytes
    Disklabel type: gpt

Device Start End Sectors Size Type /dev/nvme0n1p1 2048 206847 204800 100M EFI System /dev/nvme0n1p2 206848 239615 32768 16M Microsoft reserved /dev/nvme0n1p3 239616 773042175 772802560 368.5G Microsoft basic data

Then you can use gparted to make a partition on the external hard drive the appropriate size.

Once that is done open your terminal and type sudo fdisk -l. From the out put of this you should be able to tell which partition you have created (helps to compare the command before and after creating the partition to identify any differences although that is not entirely necessary).

Then use the following command

dd if=/dev/sdX of=/dev/sdX bs=XXXX conv=noerror,sync status=progress

It takes a bit of time to copy but because it creates an exact copy (including free space) it's perfect for backing up your hdd. Just make sure to do it regularly or backups will get outdated. For larger drives you may need to leave it running overnight - or automate it into a background task using cron. It can be sped up by increasing the blocksize to bs=16M or something similar but this can lead to error propagation if there are errors in your data.

This method is cumbersome can't be done as an automated backup but it is reliable and the drive that you backup can be immediately switched out.

theYnot
  • 733
  • 5
  • 14
2

Timeshift requires the external drive to be of type ext4.

Lets say /dev/sdb1 is the path to the external drive (adjust accordingly to your path with lsblk | grep sdb or check gparted)

You can use

sudo umount -lf /dev/sdb1 
mkfs.ext4 /dev/sdb1

to achieve that.

After this you are able to select your drive in Timeshift.