LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-13-2009, 07:03 PM   #1
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Rep: Reputation: 33
Keeping a backup copy of my system. How?


Hello!
After running Slackware for a while, I am trying Debian Lenny AMD64 now.

What would you recommend to create a backup of my Debian System. I mean something to be able to restore my system in case of failure.

My system has three partitions: /; SWAP and /home.

Thanks in advance,
Glore2002.-
 
Old 04-13-2009, 08:00 PM   #2
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Hi There,

I would recommend using some thing like clonezilla. Its like Norton Ghost, so It will take a backup image of either then entire drive, or just selected partitions.
Ideally just plug in a usb drive to save the image too, and away you go.
 
Old 04-14-2009, 05:11 AM   #3
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by FragInHell View Post
Hi There,

I would recommend using some thing like clonezilla. Its like Norton Ghost, so It will take a backup image of either then entire drive, or just selected partitions.
Ideally just plug in a usb drive to save the image too, and away you go.
Thanks for the advice FragInHell!

That way Is it possible to restore data to partitions with different size than the source ones?

Glore2002.-
 
Old 04-14-2009, 12:56 PM   #4
pliqui
Member
 
Registered: Feb 2007
Location: Caracas, Venezuela
Distribution: Debian x64
Posts: 156

Rep: Reputation: 17
For data backup i use Backuppc, its a very good software that allows you make backups of your files and even other pcs attached to the network and can change a lots of parameters like, compression, time of full backups and incrementals backups. Check it out.
 
Old 04-20-2009, 07:58 PM   #5
987687
Member
 
Registered: Oct 2007
Location: 127.0.0.1
Distribution: Debian
Posts: 35

Rep: Reputation: 15
I use rsync to back up to external drives. It works very well, and I can restore my system from the backup just fine (have done it a couple times)
Code:
rsync -aruvt --delete --exclude="/proc/*"  --exclude="/lost+found/*"  --exclude="/dev/*"  --exclude="/mnt/*"  --exclude="/media/*"  --exclude="/sys/*"  --exclude="/tmp/*" / /mnt/backup
that is the command that's the heart of my backup script. It backs up / to /mnt/backup, and excludes things that don't need to be/ shouldn't be backed up.
I'm not big on the GUI programs, it generally makes restoring harder, with a full backup you can restore from pretty much any bootable linux disk, you can chroot in and change things around, using rsync makes your backups much more flexible.
 
Old 04-21-2009, 10:30 AM   #6
gnudude
Member
 
Registered: Apr 2009
Posts: 46

Rep: Reputation: 28
might also look at live-helper
 
Old 04-21-2009, 12:49 PM   #7
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Rep: Reputation: Disabled
Quote:
Originally Posted by 987687 View Post
I use rsync to back up to external drives. It works very well, and I can restore my system from the backup just fine (have done it a couple times)
Code:
rsync -aruvt --delete --exclude="/proc/*"  --exclude="/lost+found/*"  --exclude="/dev/*"  --exclude="/mnt/*"  --exclude="/media/*"  --exclude="/sys/*"  --exclude="/tmp/*" / /mnt/backup
that is the command that's the heart of my backup script. It backs up / to /mnt/backup, and excludes things that don't need to be/ shouldn't be backed up.
I'm not big on the GUI programs, it generally makes restoring harder, with a full backup you can restore from pretty much any bootable linux disk, you can chroot in and change things around, using rsync makes your backups much more flexible.
i never did backup before, so be a bit patient with my question please:
how would i restore the backup with that method?

@gnudude: how would i backup my system with lh?

thanks a lot for an answer.

Last edited by j1alu; 04-21-2009 at 12:56 PM.
 
Old 04-21-2009, 01:41 PM   #8
987687
Member
 
Registered: Oct 2007
Location: 127.0.0.1
Distribution: Debian
Posts: 35

Rep: Reputation: 15
Quote:
Originally Posted by j1alu View Post
i never did backup before, so be a bit patient with my question please:
how would i restore the backup with that method?

@gnudude: how would i backup my system with lh?

thanks a lot for an answer.
To restore I boot from a knoppix CD. I cd to / (on the CD) and make 2 directories, /backup and /restore.
I mount the backup to /backup, and mount the computer's hard drive (what is / when you boot the computer) to /restore
then I use cp
Code:
cp -a /backup/* /restore
EDIT: then, of course you will have to chroot into the system and install grub again.
You can try backing up and restoring the boot sector, but that usually doesn't work for me...
In any case, to back up grub
Code:
dd if=/dev/sda of=grub_backup.img bs=512 count=1
(change sda to whatever your hard drive is)
to restore grub
Code:
dd if=grub_backup.img of=/dev/sda bs=512 count=1
"bs=512 count=1" is sort of redundant restoring, because that should be the length of the backup, but in case you did something wrong, that could save you...

Last edited by 987687; 04-21-2009 at 01:47 PM.
 
Old 04-21-2009, 01:53 PM   #9
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Rep: Reputation: Disabled
thanks 987687,
i wouldn`t have known that and it would have taken quite a while to figure that out
on my own (sounds so damn easy `restore the backup')
greetings
(btw: nice you and some of the forum-members are around,
but i surely miss all the others)

Last edited by j1alu; 04-21-2009 at 01:57 PM.
 
Old 04-21-2009, 03:27 PM   #10
gnudude
Member
 
Registered: Apr 2009
Posts: 46

Rep: Reputation: 28
Quote:
Originally Posted by j1alu View Post
@gnudude: how would I backup my system with lh?
try something like
lh_config --bootstrap copy --debian-installer
 
Old 04-21-2009, 05:04 PM   #11
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Rep: Reputation: Disabled
Quote:
Originally Posted by gnudude View Post
try something like
lh_config --bootstrap copy --debian-installer
gives me an error kinda " --debian-installer needs a parameter/argument" (or whatever).
as i`m a bit down i`ll keep that in mind for my futural progress with lh.

@987687:
i gotta easy question:
i got / /home /tmp /var and /usr on different partitions (but will never do that again), is that a problem when trying to restore? the backup seems to have worked (-> ~five minutes)

thanks
 
Old 04-21-2009, 05:14 PM   #12
gnudude
Member
 
Registered: Apr 2009
Posts: 46

Rep: Reputation: 28
Quote:
Originally Posted by j1alu View Post
gives me an error kinda " --debian-installer needs a parameter/argument" (or whatever)
well yea....you didn't expect me to do all the work for you did ya...

man lh_config
 
Old 04-21-2009, 05:15 PM   #13
987687
Member
 
Registered: Oct 2007
Location: 127.0.0.1
Distribution: Debian
Posts: 35

Rep: Reputation: 15
Quote:
Originally Posted by j1alu View Post
@987687:
i gotta easy question:
i got / /home /tmp /var and /usr on different partitions (but will never do that again), is that a problem when trying to restore? the backup seems to have worked (-> ~five minutes)

thanks
To be quite honest, I have no idea... lol. But, if they are all mounted, I don't see why it would be a problem. Because by default rsync will backup EVERYTHING in the root tree (unless you exclude it), it will even back up ssh volumes mounted with sshfs.
The best way to check if it worked is to check to make sure everything is on the backups.
 
Old 04-21-2009, 05:22 PM   #14
j1alu
Member
 
Registered: Apr 2009
Distribution: debian gnu/linux
Posts: 798

Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by gnudude View Post
well yea....you didn't expect me to do all the work for you did ya...

man lh_config
ahhh: finally i get what i need to feel healthy again. thanks for that.

987687: ok, thanks, seems fine, i`ll check it these days.

(note: my first backup ever made; thanks for the help )
 
Old 04-21-2009, 05:52 PM   #15
987687
Member
 
Registered: Oct 2007
Location: 127.0.0.1
Distribution: Debian
Posts: 35

Rep: Reputation: 15
the subsequent backups will go a lot faster with rsync, because it only backs up what has changed. The reason I love rsync. Makes backing up my 1TB raid bearable.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Probem copy whole backup including hardlinks to another system hendrixx Linux - Software 3 08-05-2008 07:26 AM
Backup system ala rdiff-backup, but without mirror and with dst encryption dr_dex Linux - Software 0 08-04-2008 03:39 AM
How do I copy my system backup from hda3 to DVD? Balarabay1 Linux - Software 1 11-17-2006 10:24 AM
Backup partition keeping file owners the same Sledge Linux - Newbie 1 05-14-2005 09:14 PM
boot error after using Copy Commander to copy debian system onto larger new drive Interceptor Linux - Hardware 7 05-04-2003 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration