This is the mail archive of the
cygwin
mailing list for the Cygwin project.
impossible to restore MBR using dd
- From: Matthias Bertschy <matthias at echotech dot ch>
- To: cygwin at cygwin dot com
- Date: Tue, 03 May 2005 16:35:28 +0200
- Subject: impossible to restore MBR using dd
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/