LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Backing up the whole system... (https://www.linuxquestions.org/questions/linux-general-1/backing-up-the-whole-system-99225/)

koyi 10-01-2003 09:17 PM

Backing up the whole system...
 
Hello, I would like to backup the whole filesystem of linux(Slackware 9.1) which is in /dev/hda3 to a partition on another hard drive, /dev/hdb1 which has plenty of free space. What is the best way to do this? I would like to preserve the user and permission information of the files. And if possible can be restored easily without much trouble. I have a plan in mind but I am not sure whether it works or not. The plan is like this:

1. Use tar or cpio(I dunno how to use cpio) to backup everything on /dev/hda3 to a big file on /dev/hdb1.
2. If anything happens, I will just have to format /dev/hda3 and restore the backup.

Please correct me if I missed out something. And please warn me if there is anything important I should take care of. And please redirect me if you know of any good material on the web where I can read up.

Thanks.
:newbie:

DavidPhillips 10-01-2003 09:32 PM

if you do this when the system being backed up is running or from the system being backed up then you want to omit /proc

jailbait 10-01-2003 09:38 PM

I have been backing everything up to a spare partition like you want to do for over two years using cpbk. I highly recommend cpbk:

http://www.icewalkers.com/Linux/Soft...ckup-Copy.html


___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

koyi 10-01-2003 10:08 PM

Thanks for your fast replies. :)

I am interested in this cpbk but when I try to download the source from the above link, it shows me a page with some korean language on it... and definitely I don't know korean.... There is this similar project in SourceForge.net but there are no files released, too. Is this project already dead?

Looking for other programs...

DavidPhillips 10-01-2003 10:12 PM

I've been using tar for years

jailbait 10-01-2003 10:19 PM

"Is this project already dead?"

No. Here is another link where you can get the source tarball.

http://packages.debian.org/stable/utils/cpbk.html

Also there is a copy of cpbk in LifeBoat.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

koyi 10-02-2003 03:22 AM

Thanks jailbait! Now I have got the tar ball and a diff file. Just want to make sure if this is the correct way to use the diff file.

In the directory of cpbk-4.1.0, run "$ gunzip cpbk_4.1.0-3.1.diff.gz | patch -p1".

Is the above the correct step to patch the source?

jailbait 10-02-2003 09:59 AM

"Is the above the correct step to patch the source?"

I am not sure about the -p1. That may need to be -p0.

In any case I obtained cp-4.1.0 before the patch was available and I have been running it with no problems without the patch.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

koyi 10-02-2003 10:58 AM

Anyway I applied the patch with the -p1 option and the patching process seemed successful to me. And I installed cpbk without any problems, too.

However, when I run cpbk, it worked normally for the first time, copying all the files from the root directory to the destination directory. But when I ran it for the second time right after the first backup, it tried to re-copy all the files instead of updating new files(which aren't supposed to exist at all) and it gave me the following message:
-----------------------------------------------------------------------------------
root@localhost:/mnt/linux/BACKUP# cpbk -t TRASH/ -e "/mnt/,/proc/" / BACKUP/
Searching source files and building lists... Done
Searching destination files and building lists... Done
Comparing files and generating order lists... Done

0/202507 files ( 0KB/2515911KB) 0% [--------------------] Making
mkdir: File exists
Cannot make directory `/mnt/linux/BACKUP/BACKUP/bin'.
------------------------------------------------------------------------------------
One problem that I can think of is that the timestamp changed during the first backup. This is the result of ls -l on both the root and the destination directory right after the first backup.

root:
-------------------------------------------------------------------------------------
root@localhost:/mnt/linux/BACKUP# ls -l /
total 82
drwxr-xr-x 2 root bin 2416 Oct 2 07:00 bin
drwxr-xr-x 2 root root 336 Oct 1 22:46 boot
drwxr-xr-x 15 root root 62328 Oct 3 00:24 dev
drwxr-xr-x 46 root root 4688 Oct 3 00:24 etc
drwxr-xr-x 4 root root 96 Oct 1 22:29 home
drwxr-xr-x 4 root root 2592 Oct 2 06:59 lib
drwxr-xr-x 9 root root 216 Oct 1 23:46 mnt
drwxr-xr-x 4 root root 96 Dec 14 2002 opt
dr-xr-xr-x 64 root root 0 Oct 3 2003 proc
drwx--x--- 3 root root 168 Oct 1 22:48 root
drwxr-xr-x 2 root bin 5704 Sep 2 07:29 sbin
drwxrwxrwt 9 root root 296 Oct 3 00:51 tmp
drwxr-xr-x 18 root root 544 Sep 15 07:25 usr
drwxr-xr-x 16 root root 456 Aug 15 12:17 var
------------------------------------------------------------------------------------
destination:
------------------------------------------------------------------------------------
root@localhost:/mnt/linux/BACKUP# ls -l BACKUP/
total 82
drwxr-xr-x 2 root bin 2416 Oct 3 00:29 bin
drwxr-xr-x 2 root root 336 Oct 3 00:29 boot
drwxr-xr-x 15 root root 62328 Oct 3 00:29 dev
drwxr-xr-x 46 root root 4688 Oct 3 00:29 etc
drwxr-xr-x 4 root root 96 Oct 3 00:29 home
drwxr-xr-x 4 root root 2592 Oct 3 00:29 lib
drwxr-xr-x 4 root root 96 Oct 3 00:32 opt
drwx--x--- 3 root root 168 Oct 3 00:32 root
drwxr-xr-x 2 root bin 5704 Oct 3 00:33 sbin
drwxr-xr-t 10 root root 328 Oct 3 00:33 tmp
drwxr-xr-x 18 root root 544 Oct 3 00:40 usr
drwxr-xr-x 16 root root 456 Oct 3 00:40 var
------------------------------------------------------------------------------------
Have you encounter this problem before?

Anyway, thanks for your help! :D

jailbait 10-02-2003 11:59 AM

" it tried to re-copy all the files instead of updating new files(which aren't supposed to exist at all)"

cpbk has to read all of the directories in both your system and your backup to compare names and time stamps even when it eventually decides that no files need to be copied.


"mkdir: File exists
Cannot make directory `/mnt/linux/BACKUP/BACKUP/bin'."

I do not know why you get this message. I have never seen it or a similar message before.

___________________________________
Be prepared. Create a LifeBoat CD.
http://users.rcn.com/srstites/LifeBo...home.page.html

Steve Stites

koyi 10-02-2003 08:38 PM

I have kept trying last night but I still couldn't figure out what was wrong... so... sorry to say this but I have to give up cpbk... and go back to stick with tar... :(

Thanks for your help, Steve. :)

quatsch 10-02-2003 08:53 PM

you could also take a look at partimage. It creates a compressed partition image so you can restore a partition to its exact state at the time of backup.

koyi 10-07-2003 06:22 AM

Yeah, I tried partimage and it is coooool~~~~!!! Easy to use and no installations needed if you get the rescue CD image iso and burn it to a CD :)

Thanks!


All times are GMT -5. The time now is 01:28 PM.