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: <42779388.4090208@hones.org.uk> Date: Tue, 03 May 2005 16:06:48 +0100 From: Cliff Hones User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: impossible to restore MBR using dd References: <42778C30 DOT 4000909 AT echotech DOT ch> In-Reply-To: <42778C30.4000909@echotech.ch> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Matthias Bertschy wrote: > Hello, > > Cygwin version: 1.5.12 > Windows XP Professional: Ver 5.1 Build 2600 Service Pack 2 > > I am trying to use Cygwin's dd command as a post Windows XP install > command to restore our custom GRUB to the MBR after an unattended > installation. > 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) > > After reading: > 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 > --> dd: opening '/dev/hd00': Invalid argument > (even if I change the device /dev/xxx name, I get the same output) > > I even tried directly: > dd if=boot.MBR of=//./physicaldrive0 bs=446 count=1 > --> dd: opening '//./physicaldrive0': Invalid argument > > After so many unefficient tries, I decided to read from it, just to see: > dd if=//./physicaldrive0 bs=446 count=1 > --> dd: reading '//./physicaldrive0': Is a directory > 0+0 records out > 0+0 records in > > So here is the: > QUESTION1: Does anyone know how to write into MBR from Windows XP > using Cygwin's dd ? > QUESTION2: I am doing somathing wrong since dd sees > //./physicaldrive0 as a directory ? > > Any help would be appreciated. Using /dev/sda should work. -- Cliff -- 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/