Jump to content

Copy of windows recovery partition


xboxboy
 Share

Recommended Posts

Can anyone please confirm if this is the correct command for me to back up the MBR? The hard disk is /dev/sda, with partitions sda1 and sda2.

 

dd if=/dev/sda | ssh username@host "dd of=/home/username/Desktop/mbr.img" bs=512 count=1

 

I am asking as the lines I have seen on the net use /dev/hda, but my disk is listed as sda.

Link to comment
Share on other sites

Yes, looks like it should be work based on the google I did also. But it should be like this:

 

dd if=/dev/sda | ssh username@host "dd of=/home/username/Desktop/mbr.img bs=512 count=1"

 

you need the bs and count inside the quotes, in your post it's incorrect.

Link to comment
Share on other sites

This is something I have never done, but without changing the idea, I would write the above command rather like this:

dd if=/dev/sda bs=512 count=1 | ssh username@host "dd of=/home/username/Desktop/mbr.img"

 

Yves.

 

Ah. Ian was quicker. You'd better follow Ian's advice; at least he knows what he's writing about :D

Edited by theYinYeti
Link to comment
Share on other sites

Thanks guys. Most appreciated.

 

First time I've ever compressed a file. I have followed Ians directions on the first page. Seems to take a long time to compress! I guess it is 5Gb I am playing with though.

Link to comment
Share on other sites

Next problem! After compressing the image of the recovery partition, everytime I click on it to check its file size, try to open it in ark, or burn a disc the program accessing it has a hissy fit and crashes.

 

When I tired to burn a disc it tels me the file is over 2gb, and can only be accessed if mounted as udf?

 

Whats going on here? Why is the file acting up? Its is called recover.img.tar.bz2

Link to comment
Share on other sites

Ok, so my image I can mount and read perfectly.

 

But I can not for the life of me compress this file properly.

 

I have tried using the CLI, I have tried using Ark. I have even rename the image several different names just to be sure the *.img extension isn't messing it up.

 

Nothing seems to work. I get a file at the end, but as soon as I do anything with the compressed file the program accessing it fails. If I'm in dolphin and I try to read its properties it crashes. If I try to use K3B to burn it, it crashes. If I right click on it in my desktop folder view, plasma crashes. I have no idea whats happening here.

Link to comment
Share on other sites

The image is actually 4.9gb, and when compressed if I run ls -al it shows as approx 4.3gb.

 

Is it really possible that the compressed file is just to large? Especially given I can do the same thing with the image with no problems before compressing?

Link to comment
Share on other sites

  • 2 weeks later...

Ok, I finally got k3b to burn a copy of recover_img.tar.bz, which I used drackbackup to create....

The md5sum of the burnt and extracted file is the same as the img, but neither match

md5sum /dev/sda1

 

given I used dd, these md5sums should be all the same yes?

 

Edit: After chatting in the ##linux room on irc, I learned that by mounting /dev/sda1 and snooping around in the partition I had probably changed some data such as last accessed etc....

 

So I redid the whole dd copy process to my desktop. Ran md5sum on /dev/sda1 without mounting it and on the image, and the md5sum were identical! Beautiful a 100% identical copy.

 

I compressed, burnt to dvd, extracted and ran md5sum against it, result was the same as above. So my burnt copy is perfect as well!

 

Objective achieved! It was a big one though.

Edited by xboxboy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...