[TriLUG] Using dd to repair a VirtualBox .vdi file

Roger Broseus via TriLUG trilug at trilug.org
Tue May 26 11:20:50 EDT 2015


Paul,

Try posing your question on Oracle's virtualbox forum. I've gotten expert advise there:
https://forums.virtualbox.org

Good luck.


On May 26, 2015 11:03:52 AM EDT, Paul Boyle via TriLUG <trilug at trilug.org> wrote:
>Hi,
>
>I have a VirtualBox VM (guest is Windows7) hosted on my Linux laptop.
>Recently (after upgrading to VirtualBox 4.3.28), the "main disk"  vdi
>file got corrupted and the VM won't boot now.  The main disk file is
>about 26GB in size. A little googling yielded this potentially useful
>lead,
>
>https://forums.virtualbox.org/viewtopic.php?f=6&t=45192
>
>Following the advice, I created a 72 byte preheader from a good .vdi
>file (I used 'head -c72 good_disk.vdi > preheader.vdi' )
>
>I could write a C or python program to try to make the repair, but I
>thought I try to see if command line tools could do the trick.  I tried
>using 'dd' in the following way:
>
>cp preheader.vid new_disk.vdi
>
>dd if=bad_disk.vdi skip=72c of=new_disk.vdi oflag=append conv=notrunc 
>
>However, the sizes of bad_disk.vdi and new_disk.vdi are different.
>They differ by 3679 bytes with the original file being slightly
>larger.  I would think that the files should end up being exactly the
>same size.
>
>I was wondering if someone could advise me on what dd incantation would
>skip the first 72 bytes of the bad_disk.vdi file and append the rest of
>that file to new_disk.vdi.  Alternatively, if there is a better tool
>than dd, I'm open to suggestions.
>
>Thanks for any help.
>
>Paul
>
>-- 
>Paul D. Boyle, Ph. D.
>Manager, X-ray Facility
>Department of Chemistry
>Western University
>London, ON N6A 5B7
>Canada
>GPG Fingerprint: 8ECE 516D 9046 FE83 4A46  7E8E D720 555D 8CC3 EC6B
>-- 
>This message was sent to: Roger <rogerb at bronord.com>
>To unsubscribe, send a blank message to trilug-leave at trilug.org from
>that address.
>TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
>Unsubscribe or edit options on the web	:
>http://www.trilug.org/mailman/options/trilug/rogerb%40bronord.com
>Welcome to TriLUG: http://trilug.org/welcome

-- 
Roger Broseus
www.bronord.com
(This email was composed on an Android device. Please excuse predictive-text induced tiepos.)


More information about the TriLUG mailing list