-1

I accidentally formatted the boot partition on my 8-year-old Linux Fedora 17.?? computer. Now it won't start, after pressing the power button it says:

GRUB Loading.
Welcome to GRUB!

error: no such partition.
Entering rescue mode. . .
grub rescue> _

Can I make my computer work again when the only things next to that computer that I can use are:

  • A 32GB bootable flash disk with Ubuntu 16.04 Desktop on it;

  • An old touch phone (writing this on it)

I already tried plugging in the USB stick, nothing changed (maybe only because of the computer's settings).
Is it possible to save my computer now? If yes, how could I do that?

(Also, because I don't speak Computer very well, please don't use too many advanced expressions. Thanks!)

  • 1
    From the BIOS Settings you should be able to select the device from which your computer starts to search for the operative system. When the computer starts press F2 or F12 or whatever is required from your computer model. Then try to select start from USB. With the USB plugged in, if the USB is bootable, you can start the system (Ubuntu). Then you can download another system and install it. What do you mean for save? How did you format your disk? Do you want to try to rescue the data inside? ps> good luck. pps> the computer is ok, you have only to reinstall it... – Hastur Jun 23 '16 at 15:48
  • @Hastur Yes - If I save the formatted partition, I won't have to install any new stuff. I formatted it the fast way using the "disks" program while trying to do something else. – user576011 Jun 23 '16 at 15:53
  • @Hastur also, where could I get this boot drive? – user576011 Jun 23 '16 at 15:56
  • It can do the difference the way in which you have formatted the disk. Try to be specific (program version... links, commandline...). Even if you will be able to recover what inside, if you will be not able to recover each file, it should be a problem longer to fix than to reinstall all. To install an operative system and the program is boring, maybe long but it is not the problem. If you have personal data, that maybe worth the effort/time of trying to rescue the data... – Hastur Jun 23 '16 at 16:00
  • 1
  • 1
    You said A 32GB bootable flash disk with Ubuntu 16.04 Desktop on it;... I suppose it is bootable :-) Try it... If it starts, you can use some utilities to rescue the partition "formatted". Read the references of the previous link if you want to try it... or reinstall all and live happy :D – Hastur Jun 23 '16 at 16:07
  • @Hastur Okay :D – user576011 Jun 23 '16 at 16:35

1 Answers1

2

You could recreate the boot partition and reinstall GRUB using the Ubuntu 16.04 live CD. If the boot partition is still there but simply formatted, you can skip step 4.

  1. Boot on a liveCD or liveUSB Boot your computer either on:

    • a Linux-Secure-Remix liveCD or liveUSB, then choose "Try Ubuntu", then go directly to Step 3 below.

    • or a Ubuntu live-CD or live-USB, choose "Try Ubuntu", then go to Step 2 below.

  2. Install Boot-Repair in the live-session Once in the Ubuntu live session, install Boot-Repair this way:

    Connect internet Open a terminal (Ctrl+Alt+T) and type :

    sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update

    sudo apt-get install -y boot-repair

  3. Launch gParted from either:

    • the Dash (Ubuntu 11.04 and next): click the Ubuntu logo in the top-left corner of the screen, then type gparted and click on the gParted icon that will appear.
    • or System->Administration->gParted menu (Ubuntu 10.04)
    • or by typing gksudo gparted in a terminal
  4. Create a 1GB partition at the start of the disk via gParted:

    • Reduce one of the first partitions of the disk in order to create 1GB (=1000MiB) of free space at the start of the disk where Ubuntu is installed. This free space must be located inside the first 100GB of the disk (its end must not be located at more than 100GB from the start of the disk). Important: to resize Windows Vista/7/8 partitions, don't use gParted but Windows tools instead.

    enter image description here

    • In this free space, create a 1GB partition formatted in EXT4.

    • On a paper, note the name of this new 1GB partition. This is generally something like /dev/sdXY (X is a letter, Y is a number).

  5. Launch Boot-Repair from either:

    • the Dash (Ubuntu 11.04 and next): click the Ubuntu logo in the top-left corner of the screen, then type boot and click on the Boot-Repair icon that will appear.

    • or System->Administration->Boot-Repair menu (Ubuntu 10.04)

    • or by typing boot-repair in a terminal

  6. In Boot-Repair:

    • Click on Advanced Options

    • Go to the GRUB location tab

    • Tick the "Separate /boot partition: sdXY" option (sdXY must be your 1GB partition)

    enter image description here

    • Click "Apply"

    • Note on a paper the URL (paste.ubuntu.com/XXXXXX/) that will appear.

    • Shutdown the computer

    • Remove the liveCD and/or liveUSB

    • Start the computer. You should now be able to boot into Ubuntu.

Source: https://help.ubuntu.com/community/BootPartition

  • Do you think it will be easy to repair a Fedora 17 (2012) with an Ubuntu liveUSB 16.04 (2016)? I'm afraid that those are different Linux distribution, and even the packaging can be different. Note that the OP formatted all the partition not only the boot sector. When you start to move the partition (point 4) it will be more difficult (if not impossible) to retrieve the data. IMHO this is a really good answer once you decided to reinstall all the system and pass to a stable Ubuntu LTS. – Hastur Jun 23 '16 at 16:15
  • If I remember correctly, boot repair should recognize the Fedora installation and modify grub appropriately. –  Jun 23 '16 at 16:38
  • ... if it finds a partition with the operative system inside, almost for sure. The problem is that the OP said "I accidentally formatted the boot partition..", so it seems non only the boot sector, but the whole partition. Do you remember if the Boot-Repair repairs even the formatted partition reconstructing (or copying back from the eventually present copies) the inode table? BTW for the OP it should be the right time to pass to Ubuntu and ext4. :-) – Hastur Jun 23 '16 at 16:52
  • True, I'd switch if it were me. –  Jun 23 '16 at 16:56
  • @Moses thanks for the answer, but when I execute the first command (step 2) it says ERROR: '~yannubuntu' user or team does not exist. Error: 'ppa:yannubuntu/boot-repair' invalid, so I thought yannubuntu is a user - changed it to ubuntu - the default username, and got the same output. – user576011 Jun 23 '16 at 17:08