dd to make backup of partition
Hi folks,
I'm sorry to ask this because I know I could read it in the man pages and other documentation and threads, but I'm in a hurry to get some lost data recovered and want to do nothing wrong here. From a post here on lq.org I got a dd one-liner to clone a partition. Could someone familiar with dd please take a look at the following two line and post if they do what they should?! 1) Clone partition including free space bit for bit in a compressed file: dd if=/dev/hdb2 bs=1024 | gzip > /mnt/data-a/bilders.iso.gz 2) Put the data back on the partition: zcat /mnt/data-a/bilders.iso.gz | dd of=/dev/hdb2 bs=1024 Many thanks for reading (and answering) :D |
For me it is correct but I provide NO WARRANTY.
(I think bs parameter is useless, and try to not name your image "*.iso") |
Quote:
Quote:
Any second confirmation that this should be ok to secure the partition? Two opinions would *feel* like a warranty. |
Seems good to me..I've "backed up" a flash disk using lines quite like those, but after all it was too scrambled to rescue..though dd did it's work all right, so you should be fine (well if you happen to loose something, it's not my fault though:) but nevertheless..go ahead).
It's really not important whether or not it's ".iso", arguing about that is stupid. You can name it to ".godbackup" if you like..doesn't bother me as long as you know what it is :) |
Quote:
|
bs should be set to 512, since that's the size of the blocks. I don't know if it's possible to have an odd number of blocks or not, but should it actually happen, things might turn ugly (or you might wind up losing the last block of the filesystem).
|
Quote:
|
All times are GMT -5. The time now is 10:56 PM. |