tar backup stupidity and limited space
So, pretend you have:
- a new Mac laptop with a fast hard drive, but one that is smaller than all the data you need to backup
- A backup hard drive you’ve used on Windows and Linux, but is formatted NTFS, and is much larger than your new laptop’s HD
- You have files named on your system that needs to be backed up that aren’t kosher for NTFS
So, being a Linux geek, you realize “Ha! I’ll just tar my files up, copy it to the backup drive, over to the new system, and untar.”
Yes – you do just that, but then you need to use your laptop for work; so instead of waiting to untar the file, you copy the very large backup tar files from the external HD to your new laptop.
Now, here’s the problem: you can’t untar the entire tar flle w/o running out of space. What do you do? Un-tar a bit at a time; delete; continue.
Untar a bit of the archive you want, delete it from the tar, and continue until you have more space on your HD than the rest of the tar file.
# tar xf MYBACKUP.tar This/directory/I/want
# tar --delete --file=MYBACKUP.tar This/directory/I/want
This method works surprisingly well, considering the tar file crossed all three major operating systems.
If you are unsure of what is inside the archive, you can use:
# tar --list --file=MYBACKUP.tar