LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Stuck at the GNU GRUB cmd, all partitions were deleted (https://www.linuxquestions.org/questions/linux-newbie-8/stuck-at-the-gnu-grub-cmd-all-partitions-were-deleted-4175556516/)

nramirez 10-18-2015 05:40 PM

Stuck at the GNU GRUB cmd, all partitions were deleted
 
Hi guys.. Sorry to bother and I am sorry if I sound stupid with this question, I am very new in linux... I had a Centos machine with Freepbx installed. I wanted to format the system in order to install another version. The system was configured to use two partitions /dev/sda1 and /dev/sda2. I deleted both partitions using the fdisk and then reboot the system. I am now stuck at the grub command line and nothing seems to work. I read a couple of forum to rescue the system but was unable to do it. I tried to find all possible combinations for grub>root (hd0,1) but looks like there is nothing on the system. I tried the geometry and find grub conf commands and they displayed nothing. Thanks in advance!!!

albinard 10-19-2015 10:43 AM

I'm sorry to tell you that if you indeed deleted both partitions there is nothing for your bootloader to access (no UUIDs to identify start points).

syg00 10-19-2015 06:19 PM

Just boot from a DVD/USB and install the next system you want to install - it will overwrite the old grub and allow you to re-allocate partition(s).

berndbausch 10-19-2015 06:27 PM

Quote:

Originally Posted by nramirez (Post 5436522)
Hi guys.. Sorry to bother and I am sorry if I sound stupid with this question, I am very new in linux... I had a Centos machine with Freepbx installed. I wanted to format the system in order to install another version. The system was configured to use two partitions /dev/sda1 and /dev/sda2. I deleted both partitions using the fdisk and then reboot the system. I am now stuck at the grub command line and nothing seems to work. I read a couple of forum to rescue the system but was unable to do it. I tried to find all possible combinations for grub>root (hd0,1) but looks like there is nothing on the system. I tried the geometry and find grub conf commands and they displayed nothing. Thanks in advance!!!

If you want to install another version, there is no need to salvage your partitions. Just create new ones; this can be done automatically during the installation process.

If you need to recover the partitons, it's not entirely hopeless. The only thing that you destroyed on the disk is the partition tabled, a minuscule area in the first disk sector (sector = 512 bytes). The data itself is probably untouched. The challenge is creating a partition table identical to what you had before.

In case you know exactly what your partition table looked like, simply recreate it.
Otherwise, there are procedures and even tools for that task. While I can't advise you, search the internet for "find dos partition" or "fdisk recreate partition" or "parted recreate partition" etc. I found the description of a tool, http://findandmount.com, but can't tell you if it works.

In the end, it depends on the value of your lost data how much you will invest to recover it.

nramirez 10-19-2015 10:25 PM

Hi guys! Thanks for your support and advice. I really appreciate you took time to help me or at least to comment about it. I invested some time trying to recover the partition but was unable to do it so, I ended up creating a USB boot and installing the system again. Good thing about it was that it was a new install and did not invested much time in the configuration and I know for a fact that I need to be more careful in the future with this kind of stuff... Again thanks everyone for all your help and time. Lesson learned :)

syg00 10-19-2015 10:40 PM

If this happens again (lost partitions) have a look at Testdisk - designed just for this.
Wasn't obvious (to me) this is what you wanted to do.


All times are GMT -5. The time now is 03:03 PM.