ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
About live backup of complete hard drive including OS, data, etc. direct on CD/DVD.
Can I apply tar command plus bunzip creating a compressed tarball, pipe the output direct on mkisofs/growisofs creating ISO image and finally pipe to output to cdrecord/growisofs to burn CD/DVD. If possible please advise how to start.
If you prefer a shell based approach, what you describe should work. I would tar with 'cjf' to provide bzip2 compression along with a new file, then create the ISO and pass it to cdrecord (most likely with a pipe to avoid too many temporary files).
If you prefer a shell based approach, what you describe should work.
Yes, I prefer shell based solution piping the commands. I have been running compressed tar to backup data for sometimes and burn the compressed tarballs on CD/DVD. It is simple and straightforwards for backup and easy to restore. But I never tested it on backup the whole HD before.
Now I'm considering piping the commands avoiding building too many temporary files. However is there anyway not to use RAM otherwise it needs at least >3G capacity. I have been considering writing a short script running tar compression, burning the tarballs and finaly deleting them after burning. But if I can overcome the RAM problem the solution will be much easier. Backup/Restore can be done without 3rd party software.
I would dump the .tar.bz2 to disk, then mkisofs and pipe that straight to cdrecord. This will need only one temporary file and (relatively) little RAM.
If you don't want to backup files using kdar, and want to backup an image of the partition, I would recommend backing up to an external drive instead of dvd. Your partition is probably larger than 4.4 GB, so an image wouldn't fit without splitting the file. Remember that the T in TAR stands for tape, so restoring multiple volumes from DVD rather than tape may be a chore. The DAR command is written to work with DISCs.
To backup the image to an external drive, you can use the "dd" command, pipe it through "tar" and pipe the output of tar to "split". If the external drive uses one of the FAT file systems, it has a 2 GB limit, so that is why you may need to use split. Another advantage is that the file sizes will be more reasonable, and you can use par2 to produce parity files to recover files if they later become corrupted or deleted by mistake.
I backed up the contents of files on my home directory this way before a fresh install of SuSE 10.1 on my laptop. I was able to cat the backed up files, and pipe that to tar to recover the files, or even listing the contents. All this without ever producing a temporary file.
When I tested the above post on my /boot partition, I tried both the -z and -j options. I was expecting the -j option (bzip2) to compress better then the -x option (gzip), however the filesize of the gzip'ed version was smaller.
Last edited by jschiwal; 07-24-2006 at 10:28 AM.
Reason: added gzip vs bzip info.
If you don't want to backup files using kdar, and want to backup an image of the partition, I would recommend backing up to an external drive instead of dvd.
I'll learn kdar later which is new to me.
an external drive?
Whether HD mounted on an USB enclosure can work for me. I can dump the compress partition image on it. But I haven't figured out how to restore on running rescue disk.
The par2 command produces parity files, so if one or two of the split files are bad, you can run "par2repair" and get them back. If producing the parity files, one of the arguments is either the number of parity files to produce or the percentage of redundancy.
I think that if you have the package it will be called par2cmdline.
If your distro is RPM based, then a search on http://rpm.pbone.net for par2cmdline may find a version for your distro. Since it is a commandline tool, you should be able to use a package for a different distro, provided you don't have any library version conflict issues.
What I'm most concerned is whether running rescue CD can detect the USB enclosure. I'll buy an USB enclosure to make this test next time when I visit the computer shop. Its price is quite cheap. I have 6G, 9G, 10G, ATA/33/66, etc. old HDs here.
"yum seach par2cmdline" found this package and I have "par2cmdline.x86_64" installed on my PC. There is no "man par2"
Quote:
The par2 command produces parity files, so if one or two of the split files are bad, you can run "par2repair" and get them back. If producing the parity files, one of the arguments is either the number of parity files to produce or the percentage of redundancy.
What I'm most concerned is whether running rescue CD can detect the USB enclosure. I'll buy an USB enclosure to make this test next time when I visit the computer shop. Its price is quite cheap. I have 6G, 9G, 10G, ATA/33/66, etc. old HDs here.
Tks.
B.R.
satimis
I don't know about specific rescue cds, but most of them should have no trouble seeing your USB drive.
When I tested the above post on my /boot partition, I tried both the -z and -j options. I was expecting the -j option (bzip2) to compress better then the -x option (gzip), however the filesize of the gzip'ed version was smaller.
I just tested both;
$ tar jcpf Documents_2060725.tar.bz2 Documents_2060725
$ tar zcpf Documents_20060725.tar.gz Documents_20060725
File size;
$ du -m Documents_20060725.tar.bz2
Code:
713 Documents_20060725.tar.bz2
$ du -m Documents_20060725.tar.gz
Code:
730 Documents_20060725.tar.gz
Not much difference. But to my surprize the compressing time for "Gzipped Tar Archive" was much faster.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.