{"id":407,"date":"2009-06-28T17:00:02","date_gmt":"2009-06-28T15:00:02","guid":{"rendered":"http:\/\/raftaman.net\/?p=407"},"modified":"2021-05-15T11:46:41","modified_gmt":"2021-05-15T09:46:41","slug":"working-with-lzma-tarballs","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=407","title":{"rendered":"Working with lzma tarballs"},"content":{"rendered":"<p>The <a href=\"http:\/\/en.wikipedia.org\/wiki\/Lzma\">Lempel-Ziv-Markov chain algorithm<\/a> is a (at least in the Linux-world) relatively new compression method. It features a very high compression ratio that is generally much higher than bzip2<A NAME=\"fn001t\" HREF=\"#fn001f\"><SUP>1<\/SUP><\/A>. Unfortunately there a quite a few different implementations. So creating and extracting lzma archives on different Linux distrubutions will vary.<\/p>\n<p>While the latest Fedora comes with GNU tar 1.22, which has a built-in flag for lzma compression, CentOS still uses GNU tar 1.15.1; So you will have to pipe your tarball manually to the lzma binary. Here is an example:<\/p>\n<p>On Fedora 11, creating an lzma compressed tarball is rather simple:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\ntar cfv backup.tar.lzma a\/dir --lzma\r\n<\/pre>\n<p>Just like decompressing it<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\ntar xfv backup.tar.lzma --lzma\r\n<\/pre>\n<p>You may want to skip the verbose flag <code>v<\/code> in a script.<\/p>\n<p>On CentOS 5.3 you first have to pull lzma from a 3rd party repository like <a href=\"http:\/\/rpmfusion.org\/\">RPMFusion<\/a><\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\nyum install lzma\r\n<\/pre>\n<p>before you can create you archive with:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\ntar cv a\/dir | lzma -c -z &gt; backup.tar.lzma\r\n<\/pre>\n<p>For decompression, just pipe the hole file into <code>lzma -d<\/code> and un-tar the output:<\/p>\n<pre class=\"brush: plain; light: true; title: ; notranslate\" title=\"\">\r\ncat backup.tar.lzma | lzma -d | tar xv\r\n<\/pre>\n<p>Again: You may want to skip the verbose flag <code>v<\/code> in a script.<\/p>\n<p><!-- fn001 begin --><br \/>\n<P><br \/>\n<A NAME=\"fn001f\" HREF=\"#fn001t\">[1] <\/A><a href=\"http:\/\/www.linuxjournal.com\/node\/8051\/print\">http:\/\/www.linuxjournal.com\/node\/8051\/print<\/a><br \/>\n<\/P><br \/>\n<!-- fn001 end --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Lempel-Ziv-Markov chain algorithm is a (at least in the Linux-world) relatively new compression method. It features a very high compression ratio that is generally much higher than bzip21. Unfortunately there a quite a few different implementations. So creating and extracting lzma archives on different Linux distrubutions will vary. While the latest Fedora comes with GNU tar 1.22, which has&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=407\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[28,13,7],"class_list":["post-407","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-bash","tag-centos","tag-fedora"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=407"}],"version-history":[{"count":10,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/407\/revisions"}],"predecessor-version":[{"id":2698,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/407\/revisions\/2698"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}