Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: tar command to backup Ubuntu system ?

  1. #11
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: tar command to backup Ubuntu system ?

    Quote Originally Posted by Coder88 View Post
    Excellent point. I am curious though, how much of a problem would it be to use a tarball created from a running linux system (very convenient of course, as one could stay productive), how reliable would such a tarball be for a restore? I don't know the answer to that question, just wondering.

    I am running a tar backup now, scrolling by in a terminal. But once it completes I will do one from a live boot linux distro so my main linux system is not running during the tar backup.

    I was unable to run the tar using the bzip compression option, got an error about block sizes; so i am running a tar using gzip. I would like to figure out though how to do a higher compression. My goal is to get tarballs under 8GB (excluding /home) so they could easily be burned to a dual layer DVD for optical storage.
    I have no exact answer, but I recommend to backup from live boot so that your linux system is not running.

    bzip2 is not included in tar, but you can pipe the output from tar to bzip2 and get the tarball you want.

    Code:
    sudo tar -cbv source | bzip2 > ball.tar.bz2

  2. #12
    Join Date
    Jun 2013
    Beans
    126

    Re: tar command to backup Ubuntu system ?

    I made a tarball of my running ubuntu (ArtistX) system with this command:
    Code:
    sudo tar -czvf /Datadrive/ArtistX/artistx-system.gz --one-file-system  /
    and it went well, resulting tarball was 5GB, small enough to easily burn to a dual layer DVD for optical storage backup.
    Entire tar took 30 minutes.

    I think I will try it again now with the piping ("|") to bzip2 to see if that will work, and to see the tarball filesize difference.

    I love this aspect of linux-- an entire operating system and a gazillion apps, all able to be archived to a DVD optical disk! Mind you I am excluding /home but that is data, easy enough to backup separately and in more of a generic manner.

    I just want to get smart on rescuing Grub2 for if and when that goes bad. But I can create some grub2 rescue instructions from reading posts here and on the web, be prepared, burn a SuperGrub2 dvd, etc.

  3. #13
    Join Date
    Jun 2013
    Beans
    126

    Re: tar command to backup Ubuntu system ?

    Quote Originally Posted by sudodus View Post
    ... you can pipe the output from tar to bzip2 and get the tarball you want.

    Code:
    sudo tar -cbv source | bzip2 > ball.tar.bz2
    1. So it is okay to leave off the f from -cbvf and just use -cbv ?
    2. Is the b needed in -cbv given it is being piped to bzip, could i just use -cv without the b ?
    2. Can that command use the --one-file-system option?

    So how would I modify my tar command to make use of bzip, e.g. what am i likely doing wrong with this command line?
    sudo tar -cv --one-file-system / | bzip2 > /Datadrive/artistx-system.bz2
    EDIT: I am running the above command now, looks to be working.
    (I actually have a folder /Datadrive/ArtistX/ as the target)

    Last edited by Coder88; September 8th, 2013 at 04:35 PM.

  4. #14
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: tar command to backup Ubuntu system ?

    -f means to interact with the file specified after the -f. But if you pipe the output to bzip2, you should not send the output to a file directly. Let bzip2 redirect its output to the target file.

    -b is not needed, but it may be efficient to copy block size chunks. The choice of options does not depend on your choice of output: to a file or piping to bzip2 (except -f of course).

    -o-

    NTFS and ex4 can manage huge files, hundreds of GB is no problem. But the file system of CD/DVD used to limit the file size to 2GB or 4GB. I'm not sure what file system you are using now. FAT32 limits the file size to 4GB. This is why Clonezilla strips the backup into 2GB files.

    By the way, I think Clonezilla is as reliable as tar for complete backups. And the same basic rule holds for Clonezilla: boot from another drive to get a reliable backup. I use Clonezilla. But tar is good to make a system portable, because it can be installed/restored to a smaller partition.

    Assuming you mount the partition to be backed up on /mnt

    Code:
    cd /mnt
    sudo tar -cv --one-file-system . | bzip2 > /Datadrive/ArtistX/artistx-system.bz2
    to get a relative address (the dot instead of the slash).

    This is implemented in the One Button Installer (but I'm using gzip compression which is faster).

  5. #15
    Join Date
    Apr 2008
    Location
    Southern California, USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: tar command to backup Ubuntu system ?

    Quote Originally Posted by Coder88 View Post
    .... I have used Clonezilla to do some partition cloning, but sometimes that does not work....
    I
    I only use tar to backup my "/home" partitions, because I often re-install using the current iso. I use regex to only backup pertinent files/directories.:
    Code:
    tar cfpz /tmp/tarzan.tgz --exclude=home/user/.[^bv]* --exclude=home/user/Des* --exclude=home/user/Mus* --exclude=home/user/P[i,u]* --exclude=home/user/Tem* --exclude=home/user/Vid* ~user
    I'm very curious about the above statement. Clonezilla has never failed to clone/restore any OS I've use. What problems to do you have with it?

  6. #16
    Join Date
    Jun 2013
    Beans
    126

    Re: tar command to backup Ubuntu system ?

    Quote Originally Posted by VMC View Post
    ...Clonezilla has never failed to clone/restore any OS I've use. What problems to do you have with it?
    I have used Clonezilla many times, regular image clones of my C: windows system. And did a few partition to image backups. But when I tried to do an image clone of an SSD drive, got fail error from zilla. Also was able to do partition to image backup of / of my ubuntu system, once, but then when i tried it again it failed. So I am going the tarball route for now. might get on Clonezilla forum and ask about this more.

  7. #17
    Join Date
    Jun 2013
    Beans
    126

    Re: tar command to backup Ubuntu system ?

    Quote Originally Posted by sudodus View Post
    ...the file system of CD/DVD used to limit the file size to 2GB or 4GB. I'm not sure what file system you are using now. FAT32 limits the file size to 4GB. This is why Clonezilla strips the backup into 2GB files....
    Another layer of tech to archive tarballs optically (DVD), hmm. Maybe something like peazip to take a large tarball and split it up into RAR files? I do have an external USB network drive I put data backups on, but I just think burning a tarball periodically to a DVD could be comforting, given the tarball size is under 8GB and that it could be burned to a DVD. Certainly can not archive my Windows 7 drive to a DVD!

  8. #18
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: tar command to backup Ubuntu system ?

    Quote Originally Posted by Coder88 View Post
    I have used Clonezilla many times, regular image clones of my C: windows system. And did a few partition to image backups. But when I tried to do an image clone of an SSD drive, got fail error from zilla. Also was able to do partition to image backup of / of my ubuntu system, once, but then when i tried it again it failed. So I am going the tarball route for now. might get on Clonezilla forum and ask about this more.
    My experience is to repair the file system of the SSD before or during running Clonezilla.

    Maybe the problem was that you tried to backup a running system with Clonezilla.

  9. #19
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: tar command to backup Ubuntu system ?

    Quote Originally Posted by Coder88 View Post
    Another layer of tech to archive tarballs optically (DVD), hmm. Maybe something like peazip to take a large tarball and split it up into RAR files? I do have an external USB network drive I put data backups on, but I just think burning a tarball periodically to a DVD could be comforting, given the tarball size is under 8GB and that it could be burned to a DVD. Certainly can not archive my Windows 7 drive to a DVD!
    There are several drawbacks. Optical media are not really reliable. I suggest you use an external hard disk drive (eSATA or USB 3) instead of DVD disks. Or maybe two of them, to have two versions of backup, one of which in another house, if you want to be really sure to have a working backup also in case of fire or theft.

    An alternative is to backup via the network (use for example rsync).

  10. #20
    Join Date
    Jun 2013
    Beans
    126

    Re: tar command to backup Ubuntu system ?

    Quote Originally Posted by sudodus View Post
    ...Maybe the problem was that you tried to backup a running system with Clonezilla.
    No, I was using Clonezilla Live CD (most current version as of yesterday). No other operating systems were operational.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •