Saving root filesystem with tar
Hello guys! I am planning to tar my root partition to temporarily move it to another HDD and later back on the old one and untar, so while it's on a new drive I can do some things with the old one. And I wanted to make sure I won't screw it up. Is this set of option (from LiveCD, in a mounted root directory) enough for tar to save and restore all OS files correctly:
Code:
tar cpf sda1.tar * |
I think you will need to exclude all temporary file systems (/tmp, /sys, /proc ...)
If you do exclude the above I would suggest placing the tar file on one of them as including within the area being tarred can throw errors (just warnings I think). As doing the main system you would need to be root, hence -p is already the default you may also wish to consider compressing it depending on the size of the data and the room on the drive |
Quote:
|
Quote:
|
I use a shell script for backups - even when on line.
Code:
#!/bin/sh Using the "--one-file-system" eliminates the need to specifically exclude /proc, /sys, and any mounted filesystem as tar will only create an entry for the mountpoint, but not backup any of the files within. |
All times are GMT -5. The time now is 06:18 AM. |