Slackware This Forum is for the discussion of Slackware 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
08-01-2006, 06:51 AM
|
#1
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Rep: 
|
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) 
|
|
|
08-01-2006, 07:16 AM
|
#2
|
LQ Newbie
Registered: Jun 2006
Posts: 4
Rep:
|
For me it is correct but I provide NO WARRANTY.
(I think bs parameter is useless, and try to not name your image "*.iso")
|
|
|
08-01-2006, 07:23 AM
|
#3
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Original Poster
Rep: 
|
Quote:
Originally Posted by lemmel
For me it is correct but I provide NO WARRANTY.
|
Thank you. And I don't expect any warranty.
Quote:
Originally Posted by lemmel
(I think bs parameter is useless, and try to not name your image "*.iso")
|
The iso was in the example I adapted, I agree that it doesn't make sense, but I am feeling kind of panic so I forgive myself
Any second confirmation that this should be ok to secure the partition? Two opinions would *feel* like a warranty.
|
|
|
08-01-2006, 07:32 AM
|
#4
|
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131
Rep: 
|
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 
|
|
|
08-01-2006, 07:41 AM
|
#5
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Original Poster
Rep: 
|
Quote:
Originally Posted by b0uncer
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 
|
Thanks A LOT. The disk dump is saved, so I'll go ahead and see what reiserfsck will be able to recover. Maybe I will set the disk label to "godbackup" if I get back my files 
|
|
|
08-02-2006, 07:15 AM
|
#6
|
Member
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480
Rep:
|
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).
|
|
|
08-02-2006, 09:55 AM
|
#7
|
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 current
Posts: 1,649
Original Poster
Rep: 
|
Quote:
Originally Posted by evilDagmar
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).
|
Thanks evilDagmar, I will change this in my personal collection of useful tips and tricks. I actually didn't have to use dd backwards to play the image again onto the partition, but it might be useful for future adventures  Probably I should read the long dd post in the Newbie section again to see what dd is able to do.
|
|
|
All times are GMT -5. The time now is 10:22 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|