This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: impossible to restore MBR using dd
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Tue, 03 May 2005 08:04:27 -0700
- Subject: Re: impossible to restore MBR using dd
- References: <42778C30.4000909@echotech.ch>
- Reply-to: cygwin at cygwin dot com
Matthias Bertschy wrote:
> dd if=boot.MBR of=/dev/sda bs=446 count=1
> --> dd: writing '/dev/sda': No space left on device
This is the proper form of the command, as far as I know. I don't know
why it's giving you the error, but I suspect that reading and writing
the raw disk is not something that's thoroughly tested.
> http://sourceware.org/ml/cygwin/2001-01/msg00193.html
> I decided to try the following:
> mount -s -b -f //./physicaldrive0 /dev/hd00
> dd if=boot.MBR of=/dev/hd00 bs=446 count=1
Check the Users Guide. You cannot use mount to do any sort of device
mapping. The message you're referring to is more than 4 years old. I'm
afraid that things do change over time.
> I even tried directly:
> dd if=boot.MBR of=//./physicaldrive0 bs=446 count=1
> --> dd: opening '//./physicaldrive0': Invalid argument
dd is a posix program, and expects posix paths. You will almost never
get what you want by trying to feed a NT style path to it. /dev/sda is
what you want.
> QUESTION1: Does anyone know how to write into MBR from Windows XP
> using Cygwin's dd ?
Can you successfully read the first sector from /dev/sda at least?
> QUESTION2: I am doing somathing wrong since dd sees
> //./physicaldrive0 as a directory ?
It's not surprising that it does weird stuff. See above about not using
NT paths with posix programs.
Brian
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/