[CentOS] Corrupt mbr and disk directory map

m.roth at 5-cent.us m.roth at 5-cent.us
Thu Jan 5 20:33:17 UTC 2012

Billy Davis wrote:
> On 1/5/2012 11:20 AM, m.roth at 5-cent.us wrote:
>> Billy Davis wrote:
>>> We are running Centos 5.6.  All was fine until yesterday.  I attempted
>>> to tar a 14KB work file to a USB floppy  (/dev/sdb) for transport to
>>> another server.  Unfortunately, I keyed in 'tar cvf /dev/sda filename'
>>> instead of 'tar cvf /dev/sdb filename'.   /dev/sda is our main
<tail o' woe elided>
>> Sorry about your problem, but I appreciate the question: it led me to
>> <http://www.cromwell-intl.com/unix/linux-kernel-details.html>, a fair
>> bit of which was quite familiar, and other bits weren't. For example, cat
>> /proc/partitions might give you a serious bit of the information you're
>> looking for.
> Thanks Mark.  The cat command provided the lost partition information.
> I used that information with fdisk to restore the partition map.  The
> fdisk partition map is now identical to the cat partition information.

Good deal!
> Next, I reinstalled grub.  All seems normal now, at least until I
> shutdown and reboot.  I'll wait until the weekend to do that, just in
> case I still have to do a disk restore for some reason.

Best of luck, and let us know how things turn out.

If things go south, there *are* tools that will let you scan a raw disk,
and you could look for the superblock or the first dup, then calculate
where the fs & partition should start, but that would be *real* work.
> Thanks again for your input.

As I said, hope it works.


More information about the CentOS mailing list