LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-25-2006, 09:02 PM   #1
depam
Member
 
Registered: Sep 2005
Posts: 851

Rep: Reputation: 30
Backup and restore linux


Hi!

I recently bought a 120 GB external harddrive. I want to backup my linux fs. Can someone suggest what is the safest and more effective way to backup linux. Can I just tar the whole root directory (/) and when I install a new one, just untar it on the root directory? Or can I use dd? Can you suggest some commands or utility for me to backup my whole linux and restore it whenever I format my hard drive?
 
Old 12-25-2006, 09:21 PM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 68
I had an experience of plainly tarring the partition to .tar.bz2's and untarring it later. It worked. The main thing you should think of is bootloader. But I guess you have practice of CD boot-chroot-grub/lilo, if not - search here on how to restore bootloader.
 
Old 12-25-2006, 09:27 PM   #3
runnerfrog
Member
 
Registered: Jul 2006
Location: Paraná, Argentina
Distribution: Frugalware 0.6 (Terminus) - Kubuntu 7.04 (Feisty Fawn Herd 5)
Posts: 217

Rep: Reputation: 31
Whenever I needed to backup a complete GNU/Linux, I used Mondo Rescue or Mondo Rescue CD (http://www.mondorescue.org/) to create a self-extracting cd/dvd system.
 
Old 12-25-2006, 09:42 PM   #4
depam
Member
 
Registered: Sep 2005
Posts: 851

Original Poster
Rep: Reputation: 30
Mondo Rescue seems fine but the ftp site seems to be down.

raskin,

Do you mean you tarred everything (/ partition)?
 
Old 12-25-2006, 09:48 PM   #5
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 68
Yes. More exactly, I tarred directories in /, except for /tmp and /boot, as I remember, to restore /boot later by installing some minimal install (just for bootloader and /boot quickly and without effort) and then I overwrote everything I had tarred with old copies.
 
Old 12-25-2006, 11:00 PM   #6
depam
Member
 
Registered: Sep 2005
Posts: 851

Original Poster
Rep: Reputation: 30
Can I just tar /boot? Does the MBR included in the /boot? I am also thinking if dd command can be used to backup and restore...What is the exact command you issued to copy the root directory? Does tar copy the permissions and groups?

If I typed in :

tar -czvf /mnt/sda1/backup122606.tar.gz /

Is this enough?

Thanks.
 
Old 12-26-2006, 08:06 AM   #7
depam
Member
 
Registered: Sep 2005
Posts: 851

Original Poster
Rep: Reputation: 30
Hi!

I've tried the following command to backup my hard disk which is 35% full into a USB hard drive with 120 GB and with remaining 90 GB of space:

dd if=/dev/hda | gzip > /mnt/hdb1/system_drive_backup.img.gz

However, after an error occurred: file size limit exceeded. I tried it again and received the same error message. It seems that the "dd" command can only copy up to 4GB of space. I also tried partimage but it does not finish for some reason. Maybe, "dd" command is also used by this application to copy files...

I'm kinda lost because I don't know how I will be able to backup my whole filesystem. I need to try out another distro without using virtualization to maximize the hardware resources. I think it would be easier to backup files on another hard drive so that I can restore my OS whenever I feel restoring my old filesystem.

Another question is that does the MBR of linux is the same as the /boot? My other question is that can my ipod be copied also? I sync my ipod using gtkpod and I see to it that I erase all my music on my PC to save up some space. But what if I wanted to upgrade and buy a larger capacity IPod and wanted to transfer everything from my old Ipod to the new one? Isn't that possible? Hope someone can help me out on this. Thanks.
 
Old 12-26-2006, 12:00 PM   #8
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 68
Your problem with dd is that output is FAT32 which cannot hold big files. You can use split, though. Or tar multi-volume capabilities.
 
Old 12-26-2006, 07:37 PM   #9
depam
Member
 
Registered: Sep 2005
Posts: 851

Original Poster
Rep: Reputation: 30
Thanks. How about the MBR? Is it different with /boot? Can I also backup my Ipod which I believe has a NTFS format so that if I buy a new one, I'll just dump everything into it? Or do you know a tool for this one? Thanks.
 
Old 12-26-2006, 11:42 PM   #10
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 68
If you dd and split your entire device, it should be no different for MBR, which is there. About iPod - I've never used one, but I think they are dumpable (though Apple may have made something strange to prevent direct copying).
 
Old 12-27-2006, 06:43 AM   #11
depam
Member
 
Registered: Sep 2005
Posts: 851

Original Poster
Rep: Reputation: 30
Another question raskin,

Does dd copy the whole hard disk or just the used one? I've heard about partimage? Have you used that software? It only copies the used data...I just want to get feedback whether to use partimage or the dd...I've tried the partimage and it completed successfully after splitting it into 2GB each. Hope you can provide me the feedback on this one...Thanks.
 
Old 12-27-2006, 12:53 PM   #12
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 68
Dd copies entire disk. Really I've never used it for that purpose - I used at most tarring all contents of fs, while having boot disk to restore bootloader. About partimage - I've never seen it at all.
 
Old 12-27-2006, 01:35 PM   #13
sadarax
Member
 
Registered: Sep 2005
Distribution: Ubuntu
Posts: 249

Rep: Reputation: 30
You could try using the program called "partimage". It works pretty well, I use it all the time for making backups of my root partition and it preserves the bootloader.
 
Old 12-28-2006, 06:29 AM   #14
depam
Member
 
Registered: Sep 2005
Posts: 851

Original Poster
Rep: Reputation: 30
How about copying NTFS partitions like Norton Ghost? Can partimage do this as well? I've heard that partimage 's support for NTFS is just experimental. Can you provide me some light on this? Thanks.
 
Old 12-28-2006, 10:29 AM   #15
depam
Member
 
Registered: Sep 2005
Posts: 851

Original Poster
Rep: Reputation: 30
sadarax,

I was able to use partimage..After restoring my drive, Grub is not copied. I have to manually restore my MBR. The same with Windows XP the MBR was not restored. I also tried dd before to backup the MBR but it doesn't seem to work. I just want a tool that will backup everything (including the MBR) and will only backup the used data. This tool should be able to backup filesystems including linux and NTFS, FAT, etc..Ever heard of a tool like this? Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
XP Backup/Restore from Linux failed - Help please!!! clint_in_sydney Linux - Hardware 6 08-10-2006 10:08 AM
How to backup & restore the MBR in linux? sgzlit Linux - Newbie 7 03-02-2005 10:07 PM
Need to backup then restore a linux partition stuart Linux - General 5 07-16-2004 08:30 AM
Linux Raid system backup and restore ron4linux Red Hat 1 08-29-2003 01:57 PM
How to backup and restore a working Linux System redwolf Linux - General 3 07-27-2003 09:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration