Making a dd Safety Backup
In reference to the LQorg tutorial on dd;
I intend to do a bootable iso image clone to a larger drive and boot from it prior to upgrading to Ubuntu ff7.10. I'll keep my old smaller drive as a working backup. Will dd work on drives of unequal size? Should I use the dd command with the destination drive mounted or unmounted? Should I wipe any previous data from the destination drive? Why does the example dd command copy partition 2? How is the swap partition handled? clone one drive to another dd if=/dev/sda2 of=/dev/sdb2 bs=4096 conv=notrunc,noerror to remove all data from dev/sdb1 dd if=/dev/zero of=/dev/sdb conv=notrunc Thanks Bill C |
Quote:
Quote:
Quote:
Quote:
dd if=/dev/sda of=/dev/sdb BTW, I've never used the notrunc option and am not sure I understand it. Under most circumstances I would think you would not want to use the noerr option. If you use it and there is an error, it will just keep going. In your second example, the way you have the dd command listed, it will write zeroes to the entire disk, not just sdb1. dd just copies bytes without worrying about what they mean. So you can copy a swap partition just as well as any other partition. Likewise, it makes no difference to dd what filesystem is on a partition. |
Thanks '54
Wouldn't it be great to have a nice neat GUI on top of dd making it much less likely to commit a fatal error or mix conflicting commands in a string.
Typically the tutorial at LQ.org does not give a background such as what drives specs can be safely cloned, what to do with swap files, using dd mounted or unmounted. I've picked up all this just reading misc posts and feedback from other's success and failures. Scary subject. There is a big gap in the continuity of making Ubuntu "user friendly" to newbies if the processes of backup, cloning and upgrading storage hardware are not made more accessible, intuitive or (dirty word) easier. New users are told "try Linux on an old PC" and if you like it, make it part of your computing life, system inventory etc. What happens immediately upon discovery that it is a usable friendly system with real productive potential? The first thing you want is more storage, bigger or additional HDs. Yes I know, I'm complaining about a free OS. Well it isn't free if it costs weeks of time to figure out simple problems. Thanks will continue research on this. Bill Indy |
Quote:
Quote:
Quote:
Quote:
Good luck as you explore this new (for you) operating system. Have fun (and don't be afraid of the command line)! |
The problem with dd is that it doesn't do any type of integrity check. It's exactly like the name describes it, disk dump. It doesn't care if the data is corrupt or missing, etc.
If you do decided to use dd as a backup method, the best way to ensure that the dd image you created is valid is to test it before you wipe anything you've backed up or you might find yourself in a really big jam when something went wrong during the dump. I use dd for iso images, creating small images of the like not intended to be a backup but never as a primary backup solution, it really is too risky and it's too much of a maintenance as a sysadmin to ensure the dd is good, it's almost like double work. |
Thanks 54, your input is well appreciated. When I say free software it's a given that I include both meanings (freedom and free beer) but also feel I'm importuning volunteers who have already worked miracles with Ubuntu and other distros. I'll get over it.
I finally figured out how to invoke g4l on the bootable SystemRescueCD and it did sorta work. I checked the cloned drive and all the files are there. However it will not boot. Perhaps I need to do that trick expanding the swap file or partition to match the drive (gulp!). I'm keeping the original small 20GB drive w/Ubu7.04 intact as a backup for now. I'll install Ubu7.10 over the larger cloned drive when I get it to boot. Thanks trickykid, I am only using dd or g4l as a one time clone project, and will probably use a simpler GUI front end like Sbackup for subsequent backups. That G4L boot CD does have Gparted on it so I do have that available as well. What am I looking for to repair that larger 40GB drive I just cloned from the 20GB image? Do I need to put grub on it? Bill Indy |
Quote:
Code:
# grub Quote:
If you want to be able to use the full disk, you need to expand the extended partition if there is one and it is the last of the used primary partitions. And this is true only if you copied the whole disk, partition tables and all (rather than individual partitions). If your satisfied with the smaller size, you don't need to do anything. Quote:
|
Thanks 54, this is almost like fun.
OK, boot to live CD and do the grub command, copy the MBR. then figure out how to expand the extended partition. Does this mean I have two data partitions regardless, or can I add the extended to the ext3 boot partition which is the preferred outcome? I take it I have root privileges with any distro using live rescue CD? The Gnome Partition Editor shows the cloned 40GB drive as follows: dev/sdb1 ext3 18.25GB ext3 /home/40GB/ used3.54GB unused14.71Gb boot dev/sdb2 extended 8.55.02MB dev/sdb5 swap 8.54.99MB unallocated 18.19GB |
Quote:
Quote:
Quote:
Quote:
Code:
sudo su Quote:
Remember the limit of 4 primary partitions. And if you are going to have any logical partitions, one of the primary partitions will have to be the extended partition. Plan now for what you may wish to do in the future so you don't run out of primary partitions. Remember to recreate your swap partition. After creating it, you must format it with Code:
mkswap <partition> Yeah, this is just like a game! ;) |
All times are GMT -5. The time now is 04:37 AM. |