DebianThis forum is for the discussion of Debian Linux.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
I did an apt-cache search backup
and it seems that there are plenty of utility to achieve this. Has anyone has any personal experience with these kind of tools. Can anyone suggest one based on their own experience.
Thanks
Last edited by kushalkoolwal; 02-22-2006 at 08:48 PM.
You don't usually need to backup the whole drive -- most folks just back up their home directory, since, everything else can just be reinstalled. Your data is the stuff that's tough to replace.
That said, if you want an entire bit-for-bit copy of /dev/hda1, I think the dd command may be what you're looking for.
You don't usually need to backup the whole drive -- most folks just back up their home directory, since, everything else can just be reinstalled. Your data is the stuff that's tough to replace.
That said, if you want an entire bit-for-bit copy of /dev/hda1, I think the dd command may be what you're looking for.
Yes I would like to take the snapshot of my entire hard drive partition(/dev/hda1). How can dd be used to have those backups? What about utility like pdumpfs,cpbk?
dump/restore is a good backup/restore solution. It works with the filesystem and not files so it does not needlessly copy /proc, /sys, /dev, etc. You also have the option of incremental backups.
> How can dd be used to have those backups? What about utility like pdumpfs,cpbk?
Never heard of dumpfs or cpbk.
Google around for a tutorial on using dump and restore. dracae probably knows better than me -- I don't think dd knows to avoid /proc, /sys, and /dev. There's whole books written on doing backups.
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.
Haha! I'm getting on the Acronis bus too. Just for the initial pre-patch imaging though. That was I will always have a quick backup of the OS to convert back to in the event of a disaster.
We are actually going to implement rsync as part of our DR solution and replicate between Production and the mirrored DR servers in a separate location. Hopefully it works.
I would love to see some existing scripts or related rsync tips or tricks that people are using. This is my first time attempting to use it, wish me luck!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.