SlackwareThis 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.
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.
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646
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
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
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646
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
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).
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.