Hi Robert. On Wednesday 15 Jan 2003 4:54 pm, Robert P. J. Day wrote: > On Wed, 15 Jan 2003, Gary Stainburn wrote: > > Hi folks, > > > > I've just boobed big time > > > > Instead of typing > > > > dd if=boot.img of=/dev/fd0 bs=1024 > > > > I typed > > > > dd if=boot.img of=/dev/hda bs=1024 > > > > Now I recon I've stuffed the MBR including the partition table, and the > > 1st 1023 blocks of /boot. > > > > While I've still got by PC booted everything's working fine, and I have > > access to the system. However, it's obvious that I can't reboot. > > > > Can anyone suggest a way of restoring the MBR and partition table and how > > I can rebuild the /boot partition. > > FIRST, take copious notes as to what you try since, if it works, > the rest of would like to know. :-) > > 1) run "fdisk" *right* *now* and record the values. theoretically, > you should still see the valid values since that info is cached > by the kernel.
I did that immediately, but the values were already stuffed. However, if I cat /proc/partitions I get (amongst other disks) : major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq 3 0 20010816 hda 2089242 4394726 51869324 30464184 2964443 17355046 162620752 14275300 -1 35161847 41135210 3 1 16033 hda1 399 430 1658 4200 311 4794 10216 94200 0 12580 99710 3 2 1 hda2 0 0 0 0 0 0 0 0 0 0 0 3 5 72261 hda5 35431 0 283448 263240 7929 25396 272520 7742860 0 927180 8006320 3 6 19920568 hda6 2053407 4394269 51584154 30196644 2956180 17323439 162335136 6437090 0 28060970 38787924 so hopefully I can sort something out from this. Presumably, hda1 starts at block 1 and is 16033 blocks long, hda2 looks like it's a DOS extended partition containing hda5 and had6. So hda5 probably starts at 16034 (16033 for hda1 +offset 1) and hda6 starts at 88295 (16034+72261+1) > > 2) also *theoretically*, if those values still look good, you > should be able to "w" from within fdisk to at least rewrite a > valid partition table. Never mind > > that's where i would *start*. this does nothing regarding /boot, > but one thing at a time. Presumably I can copy /boot from an identical server. However, I'll need to re-install the Grub stage 1 into the MBR but I don't know how I'd do that. > > rday > > p.s. are you sure it's /boot that's your first partition on > the disk? what does an "ls" of that directory show? -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list