LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-01-2006, 07:51 AM   #1
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Rep: Reputation: 144Reputation: 144
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)
 
Old 08-01-2006, 08:16 AM   #2
lemmel
LQ Newbie
 
Registered: Jun 2006
Posts: 4

Rep: Reputation: 0
For me it is correct but I provide NO WARRANTY.

(I think bs parameter is useless, and try to not name your image "*.iso")
 
Old 08-01-2006, 08:23 AM   #3
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Original Poster
Rep: Reputation: 144Reputation: 144
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.
 
Old 08-01-2006, 08:32 AM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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
 
Old 08-01-2006, 08:41 AM   #5
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Original Poster
Rep: Reputation: 144Reputation: 144
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
 
Old 08-02-2006, 08:15 AM   #6
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
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).
 
Old 08-02-2006, 10:55 AM   #7
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,634

Original Poster
Rep: Reputation: 144Reputation: 144
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
backup the partition binary_dreamer Debian 7 07-14-2006 11:27 AM
How do I make a backup .iso of my setup? Charos MEPIS 16 08-28-2005 05:01 PM
partition backup jackren Linux - Software 1 10-09-2004 12:03 PM
Using dd to backup a partition. cjrao Linux - Newbie 1 08-29-2004 01:51 AM
Why can't I restore a partition table backup containing a reiser partition? oldweasel Linux - Software 2 05-23-2004 01:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration