this post was submitted on 28 Jun 2023
14 points (100.0% liked)

datahoarder

6272 readers
1 users here now

Who are we?

We are digital librarians. Among us are represented the various reasons to keep data -- legal requirements, competitive requirements, uncertainty of permanence of cloud services, distaste for transmitting your data externally (e.g. government or corporate espionage), cultural and familial archivists, internet collapse preppers, and people who do it themselves so they're sure it's done right. Everyone has their reasons for curating the data they have decided to keep (either forever or For A Damn Long Time). Along the way we have sought out like-minded individuals to exchange strategies, war stories, and cautionary tales of failures.

We are one. We are legion. And we're trying really hard not to forget.

-- 5-4-3-2-1-bang from this thread

founded 4 years ago
MODERATORS
 

Whenever I wipe my PC, I use tar to make an archive of the whole system. This works, but having to decompress the whole archive to pull files out is very annoying. Is there another archive format that:

  • Preserves permissions (i.e., is Unix-y)
  • Supports strong compression (I use either zstd or xz depending on how long I can be bothered to wait)
  • Supports pulling out individual files quickly
top 13 comments
sorted by: hot top controversial new old
[–] [email protected] 8 points 1 year ago (1 children)

Maybe Borg is a possibility. However, I have not yet backed up an entire system with it, but only certain files.

  • The file permissions have always been correct when restoring files in my case.
  • Which compression (LZ4, zlib, LZMA or zstd) and which compression level is used can be specified when creating a backup.
  • Backups can be mounted via FUSE, so that you can restore individual files with an file manager or a terminal emulator, for example.
[–] dbrand666 1 points 1 year ago

Look at Restic too. Similar feature set. Really simple to set up (I think Borg is too but I haven't tried it).

[–] [email protected] 6 points 1 year ago

At least on the Mac (bsdtar) you can extract single files out of a tar file.

E.g.,

Create the tar file:

tar cvzf pseudo.tgz pseudo/

Move to another directory

cd /tmp/tt

Extract a single file:

tar -xf ../pseudo.tgz pseudo/10481_2017.1069.png

You say PC, so might want to check the tar version you are using and see if there are extra parameters to do the file extraction.

[–] [email protected] 5 points 1 year ago (1 children)

You don't need to extract the whole thing if you use tar. The reason you have to here is because you use zstd/xz on top of it.

Use tar as is. It's what it's made for.

[–] dbrand666 2 points 1 year ago* (last edited 1 year ago)

Tar has to scan the whole archive to find the file you want to extract. That's why it's slow. Compression doesn't really change that.

As for what tar is made for, that would be archiving directly to tape.

[–] [email protected] 5 points 1 year ago

Take a look at squashfs. This creates a compressed archive that can be mounted as a read-only filesystem to pull out individual files. It is very fast and likely already installed on your system.

[–] Libertus 4 points 1 year ago

Take a look at DAR: http://dar.linux.free.fr/

It has many advanced functions and is actively developed (for over a decade).

[–] [email protected] 1 points 1 year ago

Borg or restic since they do deduplication.

My biggest data regret is rsync-ing or tar-ing up my systems to my fileserver as a backup mechanism. So much wasted space. Extremely difficult to find anything. Impossible to properly organize. These backup solutions improve the situation tremendously.

[–] cow 1 points 11 months ago

I use bupstash.io

[–] [email protected] 1 points 1 year ago
  • mksquashfs - result can be mounted as a read only fs. Auto deduplication (Files with the same exact content occupy the same data block). Uses smaller block sizes for compression so ratios might not be as good
  • fsarchiver - kind of like tar but indexes and stores fs info, and I'm pretty sure it allows picking specific files out
[–] [email protected] 1 points 1 year ago

When I wipe my PC I always use Clonezilla. I have a separate /home partition and I usually copy /etc inside my user's home directory just before the cloning. I'd say you should give it a try.

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

fsarchiver is very nice. Not fast on pulling out files, but, I mean, it's infinitely faster than tar.

Only quit using it so much because zfs-send is the real big hammer.

Best part is it can regenerate partitions, or whatever, or you can restore a larger partition to a smaller one, all the cool permutations assuming the files actually fit. Can re-write users and permissions if you like, all the bells.

https://www.fsarchiver.org/

Support for basic file attributes (permissions, ownership, …)
Support for basic file-system attributes (label, uuid, block-size) for all linux file-systems
Support for multiple file-systems per archive
Support for extended file attributes (they are used by SELinux)
Support for all major Linux filesystems (extfs, xfs, btrfs, reiserfs, etc)
Support for FAT filesystems (in order to backup/restore EFI System Partitions)
Experimental support for cloning ntfs filesystems
Checksumming of everything which is written in the archive (headers, data blocks, whole files)
Ability to restore an archive which is corrupt (it will just skip the current file)
Multi-threaded lzo, gzip, bzip2, lzma/xz compression: if you have a dual-core / quad-core it will use all the power of your cpu
Lzma/xz compression (slow but very efficient algorithm) to make your archive smaller.
Support for splitting large archives into several files with a fixed maximum size
Encryption of the archive using a password. Based on blowfish from libgcrypt.

Oh, also you can always copy it over to an iso image and mount it, or a qcow or raw image of some kind for loop mount.

Hey, didn't know about this: https://www.linux.com/news/mounting-archives-fuse-and-archivemount/

[–] [email protected] 1 points 1 year ago

Dar

Tar = Tape ARchive

DAR = Disk Archive

It is supposed to replace tar when storing on random access media as tar isn't random access. Compression and encryption options.

load more comments
view more: next ›