LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Backup Entire OS (https://www.linuxquestions.org/questions/linux-newbie-8/backup-entire-os-4175437578/)

sunveer 11-17-2012 09:42 AM

Backup Entire OS
 
I have installed linux on a machine. Now I want to take a complete backup of all linux using tar or rsync tool.

Then, I want to create ext4 partitions on another system with parted magic and transfer the backup contents to that new partitions instead of re-installing the complete linux again.

Is it possible?

malekmustaq 11-17-2012 11:11 AM

Quote:

Is it possible?
Possible.

But there is no need to move into ext4 yet, unless maybe you are trying to overcome size limitation or fsck speed :) The potential loss of data is higher if you are exposed to sudden power outage without power backup due to its delayed allocation mechanism. Unless you are running a mega structure, or that your storage is measured in exabytes I think ext4 is not yet a matter of need.

Lennie 11-17-2012 03:25 PM

I just wrote about it here.
I have used ext4 the last 2 years and I wouldn't even consider using anything else...

TB0ne 11-17-2012 04:48 PM

Quote:

Originally Posted by sunveer (Post 4831383)
I have installed linux on a machine. Now I want to take a complete backup of all linux using tar or rsync tool.

Then, I want to create ext4 partitions on another system with parted magic and transfer the backup contents to that new partitions instead of re-installing the complete linux again.

Is it possible?

Possible, and pointless.

Use mondoarchive, systemimager, or mkcdrec. Mondoarchive, especially...since you can 'snapshot' a running system, and have an image you can boot from over the network, which will recover the entire system, from partitions on up. Those are just three bare-metal system recovery tools. There are some commercial options as well.

catkin 11-17-2012 10:51 PM

Why only tar or rsync? They are for file level backups. If you want to copy a whole file system, including anything in it's boot record, the simplest way is to use dd on the partition's device file (example /dev/sda6) when the file system is not mounted.

To minimise the size of the backup, while the file system is mounted run, for example
Code:

dd if=/dev/zero of=/delete_this_file; rm /delete_this_file
For file systems other than / the /delete_this_file must be replace with a path on the file system. If /var is a file system mount point it could be /var/delete_this_file

That fills all the unused space with zeroes which are easily compressed. Then, with the file system unmounted (for example by booting another Linux), run, for example
Code:

dd if=/dev/sda6 conv=sync,noerror | gzip > /<path to where you want it>/sda6.dd.gz
Change sda6 as required.


All times are GMT -5. The time now is 03:40 AM.