[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problems with tar for backup (maximum tar file size?)



Jimmy Wu wrote:

[...]

So I was wondering: (1) Is it true that tar files can't be bigger than
8GB, and (2) If so, what should I use to backup directories bigger
than 8GB?  I wanted to stick with tar because I can open those on
other platforms.  If directory size isn't the problem, then what could
be going on?

I use tar to do backups, and have generated tarballs which span 26
DVDs (roughly 118 Gig). The problem is likely not tar, but the file
system. Tar does not have a central directory, it has a distributed
directory. Each file in the archive has a little header which describes
it. Another thing to watch for, if you are putting files onto DVDs,
as opposed to writing them raw, is that the largest single file which
the ISO file system (not UDF) for DVDs can support is just under
2 Gig. So you can't write a single huge 4.x Gig file to a DVD using
that file system. Here's a little piece of the script I use for
creating chunks which fit, four to a DVD.
[-----------------------------------------------]
#!/bin/bash


# Create backups of /etc, /home, /usr/local, and...
PATH=/bin:/usr/bin


DEST_DIR=/var/backups


#omitteddirs = "/srv /var/backups /var/games /mnt/usb/home/jmccarty/images
#    /home/jmccarty/linux_versions"
#    removed from list...


backupdirs="/boot /etc \
[...]
    /var/mail"

echo "System backup beginning" | wall


cd $DEST_DIR
mv -f backup.lst backupsave.lst

#                                   4482m works, but 2% left for rim damage
# This splits it up into pieces which can be written, four at a time, to
# a DVD.
tar c -O $backupdirs | split -d -b 1100m - backup.tar.
#   | ||                     || || ||||| | |||||||||||
#   | ||                     || || ||||| | +++++++++++-- prefix to use
#   | ||                     || || ||||| +-------------- use standard input
# | || || || +++++---------------- size in 1024*1024 bytes# | || || ++---------------------- size to use # | || ++------------------------- use numeric suffices
#   | ||
#   | ++-- to standard output
#   +------ create


echo "System backups complete, status: $?" | wall


echo "Now verifying system backups" | wall
cat backup.tar.* | tar tv 1> backup.lst && \
echo "Verified, please burn backup /mnt/var/backups/backup.tar to DVDRO$ | wall || \
        echo "BACKUP FAILED" | wall
[--------------------------------------------------------]

HTH. If the formatting gets lost, I can also send an attachment.

Mike
--
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I speak only for myself, and I am unanimous in that!


Reply to: