Quote:
Originally Posted by zkab
3) Can I just create a disk image with:
dd if=/dev/sda1 of=/disk2.img
gzip disk2.img
|
Yep, that is a fine way to do it. However, obviously "disk2.img" cannot be on /dev/sda1, so if that is where your root filesystem is when you do this, you will need to use a path to a different device, large enough to hold the image. Also, use "bs=1024".
Quote:
|
4) Will there be any problems with files in use during the dd operation ?
|
No. However, one problem with doing this while you are using the system is that the state of many system files, and virtual things like proc, will be very different than they are when the system boots. Since the only way this image could be used would be if you were to replace another install with it, you will be booting into it, but those system files will not be correct. That may not be much of an issue -- it's the same thing as would happen if you pulled the plug without halting. Usually fine, occasionally a problem.
Ie, if you have a second installation on the computer, or a bootable CD-ROM or something you can use, do it from there instead of from "inside" the system itself.
Quote:
|
5) Do I restore it with following: a) make a basic installation with Fedora on the crashed disk and b) dd if=disk2.img of=/dev/sda1
|
Just the second part (dd again). That's all. There is no point in installing anything to the disk first because you will be overwriting it. That means you definitely cannot do this if you are booted into a system on /dev/sda1. You MUST do it from somewhere else, such as a bootable CDROM. I've done this more than a few times, it works perfectly. You can actually take an image of an entire device (inc. all partitions) this way.
However, you might instead want to check out something called "rsnapshot", which is a very clever and simple way to backup the drive. Whenever you want a fresh backup, you just run the command, "rsnapshot", which makes it very very easy to do. This will also spare you the hassle of having to use a second system if you don't have one available.
http://rsnapshot.org/