mbr dd"d

mbr dd"d

am 13.12.2004 14:30:02 von kaushal

hi,
My friends' system is in a critical situation.
Hdd. is /dev/hdc.
CD-WR is /dev/hdd.
created a bootable linux iso img.
MISTAKE part:
dd if=iso.img of=/dev/hdc.Instead of hdd.

To retrive it back we tried the following:

1.)lilo:
1st sector of the device doesn't has valid boot signature.

2.)grub-install /dev/hdc
the device doesn't has BIOS recognition.

though multiboot,tried out this :
3.)dd if=/boot/vmlinuz of=/dev/hdc
grub-install /dev/hdc
the device doesn't has BIOS recognition.

4.)backed up the /boot/grub
copied the grub of another sys in the network,
replaced the /boot/grub.conf with the backedup grub.conf(i.e old one)
again grub-install failed with the same reason.


Net connectivity is available.Is there anyway he can recover the mbr
?Other os is windows 2000.He did backup the entire data and the system
is working fine now.

Desperately waiting for a solution.

Thanks a lot in advance.

kaushal.

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: mbr dd"d

am 13.12.2004 15:31:19 von chuck gelm net

This is a multi-part message in MIME format.
--------------070805040604090602010900
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

kaushal wrote:
> hi,
> My friends' system is in a critical situation.
> Hdd. is /dev/hdc.
> CD-WR is /dev/hdd.
> created a bootable linux iso img.
> MISTAKE part:
> dd if=iso.img of=/dev/hdc.Instead of hdd.
>
> To retrive it back we tried the following:
>
> 1.)lilo:
> 1st sector of the device doesn't has valid boot signature.
>
> 2.)grub-install /dev/hdc
> the device doesn't has BIOS recognition.
>
> though multiboot,tried out this :
> 3.)dd if=/boot/vmlinuz of=/dev/hdc
> grub-install /dev/hdc
> the device doesn't has BIOS recognition.
>
> 4.)backed up the /boot/grub
> copied the grub of another sys in the network,
> replaced the /boot/grub.conf with the backedup grub.conf(i.e old one)
> again grub-install failed with the same reason.
>
>
> Net connectivity is available.Is there anyway he can recover the mbr
> ?Other os is windows 2000.He did backup the entire data and the system
> is working fine now.
>
> Desperately waiting for a solution.
>
> Thanks a lot in advance.
>
> kaushal.

Dear kaushal:

I do not create a CD-ROM diskette from an .iso image using 'dd'.
I "burn" .iso images to CD-ROM using 'cdrecord'.
See attachment for an example bash script that copies
an .iso image to CD-ROM diskette.

HTH, Chuck

--------------070805040604090602010900
Content-Type: text/plain;
name="burncd.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="burncd.sh"

#!/bin/bash
#
# /usr/local/bin/burncd.sh
#

cat /usr/local/bin/burncd.sh

echo ""
echo " First argument is <$1>."
echo "Second argument is <$2>."
echo ""

eject -t

if [ -n $1 ] ; then
if [ -n $2 ] ; then
cdrecord -v dev=0,0,0 fs=64M speed=$2 driveropts=burnproof $1
else
echo "Second argument is burn speed [1 - 52] and must not be null."
fi
else
echo ""
echo "First argument is filename.ext and must not be null."
echo ""
fi
mount /mnt/cdrom && ls -l /mnt/cdrom && umount /mnt/cdrom
echo $1
eject

--------------070805040604090602010900--

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: mbr dd"d

am 13.12.2004 16:59:23 von jbrown106

On Mon, Dec 13, 2004 at 07:00:02PM +0530, kaushal wrote:
> hi,
> My friends' system is in a critical situation.
> Hdd. is /dev/hdc.
> CD-WR is /dev/hdd.
> created a bootable linux iso img.
> MISTAKE part:
> dd if=iso.img of=/dev/hdc.Instead of hdd.
>

I did that once.

> Net connectivity is available.Is there anyway he can recover the mbr
> ?Other os is windows 2000.He did backup the entire data and the system
> is working fine now.

He backuped all the data and the system is working fine now?
If that is the case, then why do you need to recover the mbr?

You can't recover the mbr, no matter what you do. Unless you actually made a
backup copy with dd prior to the accident, it doesn't exist anymore.

However, if you have hackup copies, you can use fdisk to repartition the disk
(and make a new mbr in the process). And then you can restore data from backup.
The reason grub and lilo failed may have been because the hard disk no longer
looked like a valid hard disk. fdisk will fix that.

If you have no backups (I'm assuming he only backuped the Windows part), you
can try guessing the location of the partition by playing with partition table
numbers, or you can try to use a program like Partition Magic to restore it ..
but this is likely to fail if the file system was overwritten.

There is also the possibility that, for some reason not clear in your email,
the hard disk is not recongized by the BIOS at all ... if that is the case
then you'll need to enter CMOS configuration and tell it about the hard disk
again.

>
> Desperately waiting for a solution.
>
> Thanks a lot in advance.
>
> kaushal.
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>

--
Infinite complexity begets infinite beauty.
Infinite precision begets infinite perfection.

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: mbr dd"d

am 13.12.2004 22:19:07 von Stephen Samuel

kaushal wrote:
> hi,
> My friends' system is in a critical situation.
> Hdd. is /dev/hdc.
> CD-WR is /dev/hdd.
> created a bootable linux iso img.
> MISTAKE part:
> dd if=iso.img of=/dev/hdc.Instead of hdd.
The problem here is that you stomped on the hard disk partition
table (which is in the first few sectors of the disk)
zzog you remember exactly where the various partitions started/ended,
then you can repartition the system (just set the partition locations,
don'tformat them) and then continue on. If you're really lucky, your
first partition was a SWAP partition, otherwise you WILL have data
loss.

You might also want to check out things like knoppix (www.knoppix.org
and the systemrescuecd http://www.sysresccd.org ) I'm pretty sure that
at least one of those two can have a tool which can look for signs
of partition boundaries to help you figure out where the partitions used
to be.

Of your first psrtition was an ext[23] filesystem, the ext filesystem
has some capability of recovery under such conditions....

Once you hae recreated the partition table, go something
like (depending on the partition you're trying to recover:)
[root@me html]# mkfs -n -v /dev/hdc2

You will get output like:
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
131616 inodes, 263056 blocks
13152 blocks (5.00%) reserved for the super user
First data block=0
9 block groups
32768 blocks per group, 32768 fragments per group
14624 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

That last set of numbers is the important ones: they are backup
copies of the superblock (critical info about the filesystem
setup). You can recover (parts of) a filesystem that has been
trashed by a waywarddd via (in this case)

fsck -n -f -B 229376 /dev/hdc2

(
-n causes a dry run (does not actualy write to the disk)).If the results
look reasonable (you WILL get at least some errors), then you can remove
the -n to do a real repair attempt.
)

--
Stephen Samuel +1(604)876-0426 samuel@bcgreen.com
http://www.bcgreen.com/~samuel/
Powerful committed communication. Transformation touching
the jewel within each person and bringing it to light.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs