DebianThis forum is for the discussion of Debian Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I would like to back up my root partition on my drive i.e. /dev/hda1 on which I have Debian installed. What is the easiest way to make a compresssed backup copy of the /dev/hda1 partition.
First, you don't want to be writing to the partition while you're backing it up. Second, storing the backup of partition hda1 on some other partition of disk hda does not provide you much protection should hda fail. I suggest booting Knoppix and doing the imaging to a remote system from there. One way I have played with this in the past is (hope I'm remembering the syntax correctly):
This should give you a compressed copy over on remote_host in userid's home directory. Make sure you have enough disk space there, or alter the destination path to some better place. Of course, not everybody has multiple Linux boxes at their disposal for the above command to work. If you have other Windows boxes available over the LAN you could share one of their drives, mount it to your Linux box using smbfs, and then dd over the network that way.
Alternately, you could make the image and store it locally, then manually transfer it or burn it to a CD or DVD. You're set if you have other partitions where you can store the image (you can't image /dev/hda1 and store it on /dev/hda1 at the same time!) But there's still the issue of not writing to /dev/hda1 while you're imaging it. Again, Knoppix to the rescue.
If you DON'T have other partitions to store the /dev/hda1 image on, it gets trickier. Where are you going to store the thing while it's being created? Direct to CD or DVD might be an option, but I don't know how to do that. There's a program named partimage that may have this capability, but I've never used it and couldn't tell you. Otherwise you'd need to come up with some kind of dd | mkisofs | cdrecord chain of events. I have no idea if that would even be possible.
I use rsync and backup to an external HD, for what it's worth. Works good for me.
Ofcourse, I do not intend to backup on the same partition whose back up I want. All I am looking for is to backup my /dev/hda1 from /dev/hdb1(hard disk from which I will boot debian linux) and store the back up either on to a remote server or on /dev/hdb1.
So you guys think that rsync,backup,dd work?
Will dd exclude the /proc /sys and /dev?
Also can you give me example as to how to use rsync and backup?
I'm a traitor. I use Acronis. I'm thinking of using rsync though, once I get it all figured out. I'm sure that would be much faster than making a whole new disk image every time. The thing I worry about is restoration if my drive ever becomes completely wiped out. Will just copying the files (with cp or rsync) back onto a wiped disk, and then installing grub, make it bootable? I have my doubts. That's why I haven't done it yet!
leiavoia, it would be pretty cool if you would go ahead and post an example of the script you have created. BTW, does rsync delete files that are only in the destination? I'd like a util that does that.