How to backup whole drive including partitions, contents, encryption etc using DD

2 risposte [Ultimo contenuto]
hi-from-mike
Offline
Iscritto: 12/10/2020

Hi,

I have been trying to make a backup of my hard disk contain my encryptions, partitions, apps, contents eveything and save it as an img through the magic of 'dd' within the terminal. After typing 'df' in the command line I got this:

User@theircomputer:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 3911420 0 3911420 0% /dev
tmpfs 788520 1696 786824 1% /run
/dev/mapper/vgtrisquel-root 19047080 13564056 4490156 76% /
tmpfs 3942596 0 3942596 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 3942596 0 3942596 0% /sys/fs/cgroup
/dev/mapper/vgtrisquel-home 953472132 792164880 161307252 84% /home
/dev/sda3 719936 303248 364224 46% /boot
/dev/sda2 524272 296 523976 1% /boot/efi
tmpfs 788516 24 788492 1% /run/user/1000
/dev/sdb1 122321528 30535708 85526060 27% /media

I had assumed it would've been '/dev/mapper/vgtrisquel-root' mainly because of the '/' thing, but that only saved an image up 20Gbs, which couldn't have been the whole disk since it was 1Tb. '/dev/mapper/vgtrisquel-home' is obviously my home and contents (not sure about apps and software though), but I don't think it covers everything on my hard disk. basically, I want to clone the the whole hdd as an image without having to say do so without another computer and whatnot. It will not work within the disk utilities of it's on hard drive without being unmounted, that's for sure

So I was wondering which the above I would have to use as the 'if=' if I were to copy everything and save it as a disk image. Can this be achieved?

Any advice, tips, answers and directions would be very well appreciated.

Thank you, and sorry I'm still new to using 'dd'

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

which the above I would have to use as the 'if=' if I were to copy everything and save it as a disk image

/dev/sda probably. To make sure, you'd need to check "lsblk" that shows whether the logical volumes for home and root are on /dev/sda (based on what df says, I guess it is on a partition listed as /dev/sda4). That said, for a 1 TB disk, dd might take a long time. Besides, I don't know much about HDDs but if you plan to run this regularly, I hope your HDD won't suffer too much from this.

I would guess that having a Trisquel live USB, saving /etc and /home with a tool like BackInTime, as well as the list of installed packages (from synaptic), might be greatly sufficient to restore your system in case of disk failure, while being much faster to run and bother your HDD much less. But I am not an expert, others may have more advice.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I would guess that having a Trisquel live USB, saving /etc and /home with a tool like BackInTime, as well as the list of installed packages (from synaptic), might be greatly sufficient to restore your system in case of disk failure, while being much faster to run and bother your HDD much less.

I would say the same. Even if, for some reason, one wants to backup the whole file hierarchy, backup tools are much more appropriate than dd. In particular, they do not resend file that have not been modified since the last backup. That is the most basic feature one asks for backups. dd does not provide it. It is not a backup tool.

Think of it: with regular backups (what everybody should do), more than 99% of the files are unmodified between two consecutive backups. Beside the time one saves at each backup, there is the size those backups take, saving over and over the exact same files. One can delete the older backups (and good backup tools automatically do that when the destination is running short of space), but there may be months/years between the time a file is mistakenly deleted/modified and the time one discovers the mistake!