Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Now I created a new VM, booted it in rescue mode, mounted my NAS, I ran the following command to restore the image to this new VM:
Code:
dd if=/path/to/my/nas/sda.img of=/dev/sda
its my understanding that when you dd the entire disk (/dev/sda) that this copies the MBR/partition table but when i run fdisk -l on the new VM, there is no partition table. When i reboot my new VM, there is no OS. Did I miss something? Did I miss a step? Do I need to backup/restore the MBR as well?
A VM has a single or set of files that can easily be copied in the HOST. Why don't you just copy the virtual hard drive and don't fool with the dd part in the client?
If I do dd on a real system I don't like to boot the original OS. I use a live cd/usb to access the real hard drive and put to some place.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
I agree with you that this should work.
I just tried to copy the first 1k bytes from my /dev/sda to a file, and compared /dev/sda and the image file with hexedit. They are equal.
When you you open with khexedit the orginal /dev/sda, the .img file and the new /dev/sda, what do you see?
Well guyz, I think i figured it out, ran the dd command to copy the disk and I changed the follow bs option from 64K to 4096 and I also removed the notrunc as well. That seemed to fix the issue.
I used your commands many many times and they always worked, but I never used the conv=noerror,notrunc part of it.
Just a sidenote, if you are not speed limited (like a copy from disk to disk) you will get much better performance with larger blocksizes, I have had made good experiences with blocksizes between 4-16MB.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
Quote:
Originally Posted by L1nuxn00b703
Well guyz, I think i figured it out, ran the dd command to copy the disk and I changed the follow bs option from 64K to 4096 and I also removed the notrunc as well. That seemed to fix the issue.
Reducing the BS down to 4096 awfully slows down the process. In addition, the conv=notrunc option was also used as an example in the learn the dd command thread, so I don't see a reason why that shouldn't work.
Maybe you could try to experiment with both settings (or neither) and check the result, just for the sake of learning.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.