delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/05/03/10:35:56

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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: <42778C30.4000909@echotech.ch>
Date: Tue, 03 May 2005 16:35:28 +0200
From: Matthias Bertschy <matthias AT echotech DOT ch>
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: impossible to restore MBR using dd
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

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.

Matthias

PS: If I do only:
    dd if=//./physicaldrive0
--> dd is wrinting things on the command line.

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019