I think I have just made the worst mistake one can made - please help me recovering from it.
A guy from another room came over said to me this is a BIOS update (or something similar) for the new servers we just bought. Would you mind making an image and dd
into the floppy so I can use it for the server installation.
I was in such pressure doing 5 things in parallel so I said okay, and he pointed out to the IBM readme file.
I simply followed the instructions there and did the mounting and the dd
line. As a result, rebooting the machine few minutes later brought up boot failure error message.
I started the machine with the ubuntu live cdrom and noticed that during new installation attempts, when it gets to the partitioning part, no hard-drive is presented.
Is there a safe way rolling back this stupid action?
Ok, first thing first: DO NOT REBOOT. What you need is
gpart
(which will scan your hd and try to determine boundaries of primary partitions, not logical ones)if you have everything on a single partition, make a backup of everything important (home, /etc) and be ready for a complete reinstall.
ps: welcome to the club :)
The first thing I would recommend after an event like this is to take a disk image with dd. Forgive the irony, this really is the best next step. To help you get this right in the future, make sure you use /dev/sda as the
if=
(Input File) and a file an some other working partition for theof=
(output file).The idea is that once you have this image, you can work with that image, or you have the image as a back up. Trying to fixing first without doing this runs the risk of causing further damage.
One you have done that, I would recommend testdisk as well, you can specify the disk image you created as an argument to test disk.
You can try the utility testdisk, it searches for partitions and tries to recover them.
It is available in the repositories, if you are running the ubuntu-live cdrom you can install it in memory.
First of all, before you make any additional changes to the disk, do as others have suggested here and pull a full disk image for backups. Do this before you risk anything else.
dd if=/dev/sda of=/dir/for/backup/disk-sda.img block=8M
After you have the backup, it's possible you only blew away the partition information and bootloader stuff. I don't honestly remember the low-level details of a disk offhand (such as whether you overwrote actual data, or just partition/bootloader), but do you have the exact partition layout that the disk was previously using? If so, restoring that disk partitioning could get you moving in the right direction. At the very least, if there are multiple partitions on the disk, that will let you access all but (potentially) the first.
Note that this needs to be an exact partition layout. The kind you get from sfdisk is ideal:
If you have another machine that is configured identically, you can likely pull this information from there (assuming it has identical sized disks and is using an identical partition latyout). I've had success doing this in the past when someone overwrote the partition table.
If you don't have or can't find the partition layout, there are some tools that will attempt to find partitions by scanning the disk.
Basically, all answers given here are good and pointing to the right direction (voted all up).
Unfortunately, in my case, it seems like on top of this logical deletion, the hard drive itself crashed physically. That is according to the lab I took it this morning.
They said that the reboot attempts and all those plug/unplug the power cable the IT guy did right after, probably caused this damage to the disk.
This explain why
/dev/sda
was not available for all partitioning and recovery tools I've tried.Thank you all for your time and efforts.