Backing up entire system with tar
kerry at gotss.net
Mon Nov 12 02:43:26 EST 2001
Here is how it works.
Tar is smart enough to not add an archive to itself. This will work:
tar cvpf /tmp/foo.tar /
If you want the tar under /mnt then do something like this:
mount /dev/hdxx /mnt
tar cvplf backup.tar /
tar czvplf mnt.tar /
c means create. v be verbose. p save/restore permitions. l stay in local filesystem i.e. do not cross mountpoints
f write archive to a file not magnetic tape. z pipe the archive through gzip
Hope this helps.
On Mon, Nov 12, 2001 at 03:54:29AM -0000, Saqib Shaikh wrote:
> I keep on finding myself wanting to play with new things etc. Instead of having to reinstall my system ever time I end up breaking something (sorry, I'm a perfectionist who feels my system must be perfect!), can I just back up my entire system with tar.
> The first question is: what is the syntax for this?
> Secondly, where will the tar file go. What I mean is, if the command were:
> tar cf /* ./backup.tar
> then won't the program get into a loop since I'm backing up the current directory, but also continually writing data to this directory? Equally, if I mount a second partition under /mnt and save the tar file to /mnt/backup.tar won't it try and backup the mounted partition also?
> I'd be greatful if anyone has the answer to my question.
> Thanks, Saqib
Kerry Hoath: kerry at gotss.net kerry at gotss.eu.org or kerry at gotss.spice.net.au
ICQ UIN: 8226547
More information about the Speakup