Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Backup entire OS drive with tar

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
satimis
Posts: 536
Joined: 2004-09-11 11:50
Location: Hong Kong

Backup entire OS drive with tar

#1 Post by satimis »

Hi all,

I need to backup the entire OS drive running tar to another Storage drive.

$ sudo fdisk -l

Code: Select all

.....
Disk /dev/sda: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Sector size (logical/physical): 512 bytes / 4096 bytes
/dev/sda1   2048 7814035455 7814033408  3.7T Linux filesystem

....
....
Disk /dev/nvme0n1: 953.89 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: INTEL SSDPEKNW010T8 
....
....   
Disk /dev/nvme0n1 - OS drive
Disk /dev/sda - Storage drive, no OS running

Whether following command line could work for me ?

On Terminal:

$ cd /
$ sudo tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --one-file-system /dev/sda

Any precaution I need to pay attention ?

Please advise. Thanks

Regards

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Backup entire OS drive with tar

#2 Post by bester69 »

satimis wrote: 2021-11-24 20:39 Hi all,

I need to backup the entire OS drive running tar to another Storage drive.

$ sudo fdisk -l

Code: Select all

.....
Disk /dev/sda: 3.65 TiB, 4000787030016 bytes, 7814037168 sectors
Sector size (logical/physical): 512 bytes / 4096 bytes
/dev/sda1   2048 7814035455 7814033408  3.7T Linux filesystem

....
....
Disk /dev/nvme0n1: 953.89 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: INTEL SSDPEKNW010T8 
....
....   
Disk /dev/nvme0n1 - OS drive
Disk /dev/sda - Storage drive, no OS running

Whether following command line could work for me ?

On Terminal:

$ cd /
$ sudo tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --one-file-system /dev/sda

Any precaution I need to pay attention ?

Please advise. Thanks

Regards

You should use fsarchiver for that purpose.. I thing using tar you might lose things.. or get an inconsistent or broken restored system, im not sure you can preserver all atributes , timestamps, symlinks, etc by using tar- fsarchiver is safer to use, you wont get any trouble when restoring system backup
FSArchiver . Unlike tar/dar, FSArchiver also creates the file-system when it extracts the data to partitions. Everything is checksummed in the archive in order to protect the data. If the archive is corrupt, you just loose the current file, not the whole archive.

The purpose is to provide a safe and flexible file-system backup/deployment tool.

FSArchiver t will preserve all the standard file attributes (permissions, timestamps, symbolic-links, hard-links, extended-attributes, …), as long as the kernel has support for it enabled. It allows to preserve all the windows file attributes (ACL, standard attributes, …). It can be used with LVM snapshots in order to make consistent backups of all filesystems including the root filesystem.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

satimis
Posts: 536
Joined: 2004-09-11 11:50
Location: Hong Kong

Re: Backup entire OS drive with tar

#3 Post by satimis »

bester69 wrote: 2021-11-25 14:59 - snip -

You should use fsarchiver for that purpose.. I thing using tar you might lose things.. or get an inconsistent or broken restored system, im not sure you can preserver all atributes , timestamps, symlinks, etc by using tar- fsarchiver is safer to use, you wont get any trouble when restoring system backup
FSArchiver . Unlike tar/dar, FSArchiver also creates the file-system when it extracts the data to partitions. Everything is checksummed in the archive in order to protect the data. If the archive is corrupt, you just loose the current file, not the whole archive.

The purpose is to provide a safe and flexible file-system backup/deployment tool.

FSArchiver t will preserve all the standard file attributes (permissions, timestamps, symbolic-links, hard-links, extended-attributes, …), as long as the kernel has support for it enabled. It allows to preserve all the windows file attributes (ACL, standard attributes, …). It can be used with LVM snapshots in order to make consistent backups of all filesystems including the root filesystem.
Thanks for your advice.

I found following online document
FSArchiver - Live system backup
https://www.fsarchiver.org/live-backup/

Please advise where can I find the steps backing my living SSD to the storage WD hdd, both on the same PC.

Living SSD without partitions
WD hdd witout OS, solely for data storage and also without partitions

Thanks

Regards

Post Reply