Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <4277B099.2050609@echotech.ch> Date: Tue, 03 May 2005 19:10:49 +0200 From: Matthias Bertschy User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: [Fwd: Re: impossible to restore MBR using dd] Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Ovh-Remote: 213.162.28.121 (egw2.echotech.ch) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: fait|type 1&3|0.0|H 0.5 -------- Original Message -------- Subject: Re: impossible to restore MBR using dd Date: Tue, 03 May 2005 19:10:20 +0200 From: Matthias Bertschy To: Eric Blake References: <050320051554 DOT 17789 DOT 42779EC1000829600000457D22007358340A050E040D0C079D0A AT comcast DOT net> Hello Blake, Eric Blake wrote: >>Hello, >> >>Cygwin version: 1.5.12 >> >> > >Can't you upgrade? coreutils-5.3.0-5 is out, and requires a newer version of cygwin. Perhaps with the latest versions you may pick up a bug fix along the way that helps solve your problem. Also, see http://cygwin.com/problems.html to give us more information so we can help you better. > > > As suggested, I have upgraded to the latest cygwin. Unfortunately, it doesn't change the results :-( >>For safety reasons, I would like to restore only the first 446 bytes of >>the MBR to keep the existing partition table. >> >>The command line to use would normally be: >> dd if=boot.MBR of=/dev/sda bs=446 count=1 >>--> dd: writing '/dev/sda': No space left on device >> 1+0 records out >> 0+0 records in >>(I also tried with bs=512 and I get the same output) >> >> > >Hmm - writing just 446 bytes to raw devices is not very safe. /dev/sda is a block-special device for a reason, and writing anything more or less than a full block at a time on a block-special device is not guaranteed to work. Maybe that is your problem? Also, according to `stat /dev/sda', the IO block size of an NTFS raw device is 1024, so even bs=512 may be equally dangerous. > > > Maybe I should recall you that on Linux, we can safely write 446 bytes blocks to a raw device. Indeed, the command dd if=boot.MBR of=/dev/sda bs=446 count=1 works under Linux. I also don't understand why you are using NTSF raw devices to access the MBR... after all the MBR isn't formatted at all ! I think I will fill a bug report for the dd command under Cygwin. Could you point me where to do it? (or maybe for Cygwin's ability to access raw devices) > > >>PS: If I do only: >> dd if=//./physicaldrive0 >>--> dd is wrinting things on the command line. >> >> >> > >That's to be expected. The of= flag is necessary to tell dd to put the output in the named (device) file, rather than on stdout. > > I know :-) that was just to point out that without any bs parameter, the dd command works. >-- >Eric Blake >cygwin coreutils maintainer > > > > Matthias -- 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/