-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday, 2018-01-12 at 21:32 +0100, Carlos E. R. wrote:
Years ago I wrote a backup script that would first create a new directory tree without files, replicating the directory tree that I was going to backup. Then the files were copied to that tree, but using "mkzftree", which compressed the files (I'm reading from the script, I tried several variants). Finally I would create an ISO image using "mkisofs -z ...", ie, resulting in a compressed DVD, which is transparently readable on Linux.
AFAIK k3b does not support this. No way I know of to create such an ISO in one go, nor to estimate the size before starting.
I have been asked offlist about this. I will translate a small howto I wrote in Spanish back on 2004 about the procedure I used to create compressed DVDs (well, I used CDs at the time, but it is the same thing). Notice that these DVDs are readable directly and normally in Linux: the kernel expands the files transparently for us. (translation made by <https://www.deepl.com/translator>, then revised by me) +++----------------- The fact that we can create compressed CDs does not seem to be well known. They are normal CDs, ISO9660 + Rock Ridge format, but with a small extension, Zisofs. The result is a CD with a capacity of approximately one gigabyte (depending on the compressibility of the files), and that the kernel allows you to mount and read as is, with the same tools we use to mount and read any CD, but on Linux - no, it doesn't work on other's systems. - ISO9660 CDs: readable on any operating system. - CDs ...Joliet: with extensions for Windows. - CDs ...RockRidge: with extensions for Linux or Unix (permissions), owners, etc.) - HFS: Same for Macs. (More: in "man mkisofs") Requirements: - Program zisofs and a patched mkisofs (SuSE does it from version 8.0 or 8.1). - 2.4.x kernel with zisofs support (SuSE has had it since version 7.3 or so). Compressed CDs use a non-standard RockRidge extension: they can only be used well on Linux, starting with kernel 2.4.14. In windows they are legible, but the files must be unpacked manually. In linux, if the kernel was compiled with zisofs support (all SuSE kernels bring it from version 8 or above, but even in 7.3 you can use it) these CDs can be used transparently, without us noticing. The advantage is obvious: we write more files on a CD. Compared to tar.gz, it is more robust (a write/read error in a tgz can render the entire archive useless), and it's faster to use, since you don't have to decompress the files to use them: simply mount the CD and read, copy, explore, etc., the files with any tool we want: console, midnight comander, konkeror, mozilla... And as it is RockRidge format, files and directories keep the original permission information. Inconveniences? There are. The main one is that it is tedious to create: while reading is transparent, generation is not. Plus, requires plenty of free disk space, such as gigabyte and half per CD (double the size of each CD). It is done in three steps - the first two need to be done in console: 1) Create a compressed copy of the tree of directories and files that if we want to backup; if we want to keep the permission information, owners, and dates, it is necessary to do it as root: mkzftree /source_tree /destination_compressed_tree Where "/destination_compressed_tree" must not exist previously, otherwise the command will give error and will not start. The "mkzftree" command has some possible options, but I use it like this. To mention a few, with "--parallelism 3" runs three simultaneous processes, for those lucky enough with several processors. We can generate several compressed directories to prepare our backup: /backup/cmp/etc, /backup/cmp/home, /backup/cmp/usr/local... etc, whichever you want. It can be seen that the files created are identical to the originals, but smaller, and illegible: they are compressed. 1.5) Group our directories into blocks of approximately 700 megabytes (slightly less) in size, which will fit each group on a CD. I usually play with mc (midnight commander) to get it. In the end, I end up with several directories: /backup/cmp-1, /backup/cmp-2, /backup/cmp-3... each one the right size. 2) Generate the ISO image to burn the CD. The basic command is: mkisofs -z -R -o image. iso /compressed_tree You can also make things better: mkisofs -z -R -quiet -graft-points \ -P "Unpublished, private backup" \ -p "Made by someone" \ -V "Disc label" \ -o image.iso /compressed_tree \ download/=/home/cer/download/ \ patches/=/var/lib/YaST/patches/i386/update/7.3/ The word "-graft-points" is used to change the directory name on the fly, like "patches/=" up there. In addition, I take advantage of this opportunity to fill in some labelling fields. The" -R" is for RockRidge, and the "-z" for zisofs - if you forget that one, the CD won't be readable. 2.5) Once the image is generated, you can test it: mount -t iso9660 -o ro, loop=/dev/loop1 image.iso /mnt and then check that "/mnt" contains exactly what you wanted to have. End with "umount /mnt" (mutandis mutandi). 3) Finally, burn the image - with the program you want, we can leave the console. I use xcdroast for that. You simply tell it to burn the image.iso image to a CD. If the image is oversized, it woll protest: listen to it. And that's it! You can read the resulting CD by mounting it as usual: mount /cdrom, for example. Don't forget to delete the intermediate files: the compressed tree, and the iso image. What about the DVDs? I don't know, I don't have a DVD burner. I think they can be created, but I can't say how. I suspect growsofs admits "-z", but I don't know. What, you find it tedious to generate? True, it is, and inflexible. Convince xcdroast or k3b developers to support zisofs; simply by admitting the "-z" option you already earn enough. Ideally we would need a system to create them directly, without going through "mkzftree", but directly into "mkisofs": the problem would then be to calculate the size. P.S: The DVDs. I have tried to create DVDs by this procedure in SuSE 9.1, and it works perfectly (record and then read it, in the same machine and in another one with 8.2); it is done with the same commands as if it were a CD, that is, with mkisofs. I haven't tried growsofs. - -----------------++- Please remember that I wrote the above on 2004, but I was using the procedure since at least 2002. Things have changed. I have not updated the writeup because I haven't used it recently. cer@Telcontar:~> zgrep -i zisofs /proc/config.gz CONFIG_ZISOFS=y So the kernel still supports the feature. DVDs should work. I have not tried Bluerays. - -- Cheers, Carlos E. R. (from openSUSE 42.2 x86_64 "Malachite" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlpaLBAACgkQtTMYHG2NR9WocACfT/nWFKpBd8+rfEK27U3KjDpb vNUAmgItMNlz33HxblKRiVoijBASxrn5 =UMiW -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org