You are not logged in.

#1 2019-07-27 19:55:36

thkim1011
Member
Registered: 2019-04-03
Posts: 18

Backing up partitions?

I recently found out that it is possible to create a partition image of an existing one through gnome-disk-utility, but something doesn't seem to make sense to me? (I have not yet tried to use it yet because of these confusions.) First of all, I would assume that you would need to unmount the partition in order to create the partition image, but if one were to do that, then there is no way to access /usr/bin/mount to mount the partition back? Second, it seems like the image file that would be created would simply be too big to be saved on the partition itself, and to be honest, I'm not exactly sure how a file would exceed the size of RAM either because it seems otherwise useless? (This last part is mainly me not understanding how file i/o works.) If someone could clarify these things, that would be great!

Offline

#2 2019-07-27 20:03:57

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: Backing up partitions?

you would need to unmount the partition in order to create the partition image

Not strictly, but it's certainly a very good idea.

if one were to do that, then there is no way to access /usr/bin/mount to mount the partition back?

Why not? Except of course you'd attempt to do that w/ the root partition, what's not gonna work. You'd typically want to back-up that offline (ie. from a rescue shell or a live system like grml)

seems like the image file that would be created would simply be too big to be saved on the partition itself

Yeah, you cannot backup a partition on itself - that's recursive and therefore obviously nuts. You want to draw the backup onto another disk (for a backup ideally one of those neat cheap external USB drives that you can unplug and store in a save location)

Offline

#3 2019-07-27 20:11:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: Backing up partitions?

The above covers all your questions - but I'd just add, for most backup purposes, full disk/partition imaging is highly inefficient and generally not all that useful.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2019-07-27 20:53:59

thkim1011
Member
Registered: 2019-04-03
Posts: 18

Re: Backing up partitions?

Trilby wrote:

The above covers all your questions - but I'd just add, for most backup purposes, full disk/partition imaging is highly inefficient and generally not all that useful.

In that case, what's the best way to go about backing up a partition? In the case that my system breaks, I would rather not do a full install again as there were a lot of hiccups dealing with nvidia drivers and such.

Offline

#5 2019-07-27 21:00:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Offline

#6 2019-07-27 21:04:35

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: Backing up partitions?

most people are happy with `rsync -a` or other such file based backup solutions (tar, rdiff-backup, borg, ...). in some filesystems these are also built-in (zfs/btrfs send and the like, or xfsdump).

restore then works by creating partitions, installing bootloader and copy files back from backup. so it's not a full reinstall, just the initial steps. can't restore files if there's no partition/filesystem to restore them to, after all.

if you must make a 1:1 image at runtime, instead of umounting the root partition it's possible to re-mount it read-only. that way the mount and other utilities would still be available.

creating a 1:1 mirror at runtime without re-mounting read-only requires one layer beneath the filesystem that is capable of mirroring. LVM could do that, or mdadm RAID1.

I use this to mirror my SSD to HDD from time to time, and have it bootable directly in case the SSD ever dies. (SSD and HDD in RAID1, with HDD set to write-mostly, and only added to the array when I actually want to mirror it).

Unlike dd, the mirror/raid makes sure that while the mirror/resync process is going on, any changes are applied on both sides. So it will be in perfect sync at the end, and not corrupt like a dd copy would inevitably be.

Offline

#7 2019-07-27 21:06:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: Backing up partitions?

Also this:
https://wiki.archlinux.org/index.php/Rsync

Backing up the content of a partition is very different from backing up a full image of the partition.  If you have a 128GB partition and are only using 20GB of it, you can do *many* incrememental backups with rsync or a similar tool and use little more than 20GB on the backup device, and each subsequent incremental backup can be very fast.  If you do full images, you will need 120GB of space for every single backup, and each one will be painstakingly slow.

Last edited by Trilby (2019-07-27 21:07:55)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2019-07-29 23:26:13

Maniaxx
Member
Registered: 2014-05-14
Posts: 761

Re: Backing up partitions?

Isn't there something that backs up all the necessary parts to re-create the whole drive (tar/gpr/mbr/pbr)? That's what i would call a real backup.

Last edited by Maniaxx (2019-07-29 23:26:47)


sys2064

Offline

Board footer

Powered by FluxBB