Gentoo Archives: gentoo-user

From: Peter Humphrey <peter@××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to compress lots of tarballs
Date: Sun, 26 Sep 2021 15:38:57
Message-Id: 5511640.DvuYhMxLoT@wstn
In Reply to: Re: [gentoo-user] How to compress lots of tarballs by Ramon Fischer
1 On Sunday, 26 September 2021 13:25:24 BST Ramon Fischer wrote:
2 > Addendum:
3 >
4 > To complete the list. Here the parallel implementation of "lzip":
5 >
6 > "plzip": https://www.nongnu.org/lzip/plzip.html
7 >
8 > -Ramon
9 >
10 > On 26/09/2021 14:23, Ramon Fischer wrote:
11 > > In addition to this, you may want to use the parallel implementations
12 > > of "gzip", "xz", "bzip2" or the new "zstd" (zstandard), which are
13 > > "pigz"[1], "pixz"[2], "pbzip2"[3], or "zstmt" (within package
14 > > "app-arch/zstd")[4] in order to increase performance:
15 > >
16 > > $ cd <path_to_mounted_backup_partition>
17 > > $ for tar_archive in *.tar; do pixz "${tar_archive}"; done
18 > >
19 > > -Ramon
20 > >
21 > > [1]
22 > > * https://www.zlib.net/pigz/
23 > >
24 > > [2]
25 > > * https://github.com/vasi/pixz
26 > >
27 > > [3]
28 > > * https://launchpad.net/pbzip2
29 > > * http://compression.ca/pbzip2/
30 > >
31 > > [4]
32 > > * https://facebook.github.io/zstd/
33 > >
34 > > On 26/09/2021 13:36, Simon Thelen wrote:
35 > >> [2021-09-26 11:57] Peter Humphrey <peter@××××××××××××.uk>
36 > >>
37 > >>> part text/plain 382
38 > >>> Hello list,
39 > >>
40 > >> Hi,
41 > >>
42 > >>> I have an external USB-3 drive with various system backups. There
43 > >>> are 350 .tar
44 > >>> files (not .tar.gz etc.), amounting to 2.5TB. I was sure I wouldn't
45 > >>> need to
46 > >>> compress them, so I didn't, but now I think I'm going to have to. Is
47 > >>> there a
48 > >>> reasonably efficient way to do this? I have 500GB spare space on
49 > >>> /dev/sda, and
50 > >>> the machine runs constantly.
51 > >>
52 > >> Pick your favorite of gzip, bzip2, xz or lzip (I recommend lzip) and
53 > >> then:
54 > >> mount USB-3 /mnt; cd /mnt; lzip *
55 > >>
56 > >> The archiver you chose will compress the file and add the appropriate
57 > >> extension all on its own and tar will use that (and the file magic) to
58 > >> find the appropriate decompresser when you want to extract files later
59 > >> (you can use `tar tf' to test if you want).
60
61 Thank you both. Now, as it's a single USB-3 drive, what advantage would a
62 parallel implementation confer? I assume I'd be better compressing from
63 external to SATA, then writing back, or is that wrong?
64
65 Or, I could connect a second USB-3 drive to a different interface, then read
66 from one and write to the other, with or without the SATA between.
67
68 --
69 Regards,
70 Peter.

Replies

Subject Author
Re: [gentoo-user] How to compress lots of tarballs antlists <antlists@××××××××××××.uk>