[SOLVED] DD to restore compressed hard drive images
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.
Hi guys I have a question and I am a little unsure of by what i have read I just want to know how to do it simply.... My question is I am installing a new hard drive in my laptop I have my partitions backed up as individual compressed files made by dd and I also have one complete image of the whole drive now my current HDD is 120B my new drive is 160GB how do I restore my images onto a new drive I have slackware on one and a LFS project on another how do I go about restoring them onto my new drive from my external HDD I know how to fix the boot loader once i have restored the images cheers guys
Looks pretty simple so what about the partitioning will it automatically do all that or will i have to set that prior to restoring the image that is what is confusing me the most I have the images there just in case of hdd failure but am unsure of how to restore them as I never had to restore them yet thank you for the quick reply it looks rather simple.
the image of the whole disk should contain the mbr, partition table, and partitions.
the images of just the partitions should just hold the partition data.
No worries I will be installing my new hard drive during the course of the day I will report back and let you know how I go thank you for the help just needed to clear it up as was unsure about the partition table data etc before I went about doing this task as I said before I have backed up my data before and on numerous occasions keeping recent images of my hdd for the event of hdd failure however I run regular fsck checks of my hdd and found that I have a number of bad blocks that have appeared recently so my hard drive is failing so have purchased a refurbished one to replace the one I am using so now I am going to be utilizing the image of my hard drive I created finally anyhow cheers again and will let you know how i went
No problems thank you for the information I am using an external hard drive that contains the data of my images to transfer to my new hdd on my laptop will keep you posted cheers
Ok I am finally reporting back with the results now for some reason when I used the image of the whole drive of all partitions I had issues with superblock errors and couldn't chroot into my slack partition to be able to fix grub however when I made images of individual partitions and made partitions of the same size and put the images of the partitions on my newly made partitions I had no issue mounting and being able to chroot into the slack partition to fix grub weird I don't know what I was doing wrong however the superblock error was odd so for future reference I am making individual partition images and if i have to ever restore them I will do it individually and won't use a whole image maybe someone might come along and point out where I went wrong I couldn't find the info i needed to fix the superblock error however issue is fixed and I am now talking to you on my new hard drive running my slackware install from my old hard drive cheers
I will look into it for future reference I never had to restore a system using a image before so many people rave on about DD being the best as I said never had to do this till now I always made backup images just in case but never had to use them till now and making a image of the whole drive was useless the only way it worked was making individual partitions into images but anyhow I will look into other backup options for the future.
I have an old e machines computer that I use for a server. There is no raid or any type of backup of any kind. Every few months I just plug in another drive configured as a slave on the same cable. Then do a "dd if=/dev/sda of=/dev/sdb bs=512 conv=noerror,sync" I will then unplug both drives and use the slave as my primary to be sure it works, and keep in the computer,then put the primary that I pulled out, and put it on the shelf for the next time.
Hi guys I have a question and I am a little unsure of by what i have read I just want to know how to do it simply.... My question is I am installing a new hard drive in my laptop I have my partitions backed up as individual compressed files made by dd and I also have one complete image of the whole drive now my current HDD is 120B my new drive is 160GB how do I restore my images onto a new drive I have slackware on one and a LFS project on another how do I go about restoring them onto my new drive from my external HDD I know how to fix the boot loader once i have restored the images cheers guys
Instead of using dd, I'd back up the filesystem itself using tar.
Code:
mount /dev/sda1 /media/sda1 #mount partition, cd to it
cd /media/sda1
tar cvfp /media/backup/sda1.tar --exclude tmp ./ #tar contents of ./ directory, exclude tmp
Instead of using dd, I'd back up the filesystem itself using tar.
Code:
mount /dev/sda1 /media/sda1 #mount partition, cd to it
cd /media/sda1
tar cvfp /media/backup/sda1.tar --exclude tmp ./ #tar contents of ./ directory, exclude tmp
If only I knew backing up my system was that easy I would of done it that way thank you for advising me on this as a backup solution I use the tar command all the time and never thought of it as a means to back up my partitions after all the trouble I went to in the first place to get my image to work again was a nightmare using DD as I stated I made a image of the whole drive that didn't work was only when I restored the partitions individually it worked without superblock errors etc etc I am spewing I didn't realize tar was a backup solution +1 for the advice I will do that from now on thanks heaps
Not sure you need dd, here's another way using gzip
Code:
gzip -1 < /dev/sda1 > sda1.img.gz #create a /dev/sda1 partition image (using fast compression)
gunzip > /dev/sda1 < sda1.img.gz #restore the image to /dev/sda1
Thank you also for this advice as well I have backup solutions using compressed files instead of DD I quite like that how easy is that I never thought of it now I won't forget cheers
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.