3

In my computer I had 2 partitions of Windows 7 (classical C: and D:), Ubuntu Gnome (that I standardly use when I need to code) and some old Fedora partitions that I don't use anymore and that I was planning to delete.

I wanted to resize my 2 W7 partitions to give more space to C:. However, when I wanted to restart my computer, I had the "grub rescue" issue.

So I used a bootable USB key (Ubuntu 14.04) and tried several solutions I could find online, for example How can I repair grub? (How to get Ubuntu back after installing Windows?) , I tried using boot-repair... but each time I am stopped by the same kind of error : the packets "grub-pc", "grub-common", "grub"... don't have any version that could be installed, according to apt-get.

The only thing I managed to do without errors is

sudo grub-install --boot-directory=/media/sda5 /dev/sda

And what it did is changing my error to "Minimal BASH-like line editing is supported" when I reboot.

I am aware that this is a widely-discussed problem, but I am unable to correct the problem on my computer. I even feel that I am making it worse.

A small part of my sudo fdisk -l :

Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xbf16e21c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    52430847    26214400   1c  Hidden W95 FAT32 (LBA)
/dev/sda2   *    52430848   979963903   463766528    7  HPFS/NTFS/exFAT
/dev/sda3       979963904  1054484479    37260288    7  HPFS/NTFS/exFAT
/dev/sda4      1054484479  1465147391   205331456+   f  W95 Ext'd (LBA)
Partition 4 does not start on physical sector boundary.
/dev/sda5      1054484480  1380587519   163051520   83  Linux
/dev/sda6      1380589568  1413945343    16677888   82  Linux swap / Solaris
/dev/sda7      1413947392  1414971391      512000   83  Linux
/dev/sda8      1414973440  1465147391    25086976   8e  Linux LVM
Disk /dev/mapper/fedora-swap: 8371 MB, 8371830784 bytes
255 heads, 63 sectors/track, 1017 cylinders, total 16351232 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/fedora-swap doesn't contain a valid partition table

Disk /dev/mapper/fedora-root: 17.3 GB, 17314086912 bytes
255 heads, 63 sectors/track, 2104 cylinders, total 33816576 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/fedora-root doesn't contain a valid partition table

Disk /dev/sdb: 4009 MB, 4009754624 bytes
145 heads, 48 sectors/track, 1125 cylinders, total 7831552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          48     7831551     3915752    b  W95 FAT32

EDIT : I don't know if it is relevant, but the first time I tried boot-repair, I purged grub on sda5 (as asked, I've just copypasted what was asked to), and then I had my "no version" problem. Now, it just says "grub2 purge cancelled" when I start it.

lvs :

  LV   VG     Attr      LSize  Pool Origin Data%  Move Log Copy%  Convert
  root fedora -wi-a---- 16,12g                                           
  swap fedora -wi-a----  7,80g
2
  • sorry, post was made for ubuntu. But what type of computer do you have; Hp 2000, Sony Vaio, Dell Experion, etc. Jul 9, 2014 at 14:28
  • I have an Asus N53S.
    – Traklon
    Jul 9, 2014 at 15:26

2 Answers 2

3

Try this

mkdir /mnt/root
mount /dev/sda7 /mnt/root
mount /dev/sda5 /mnt/root/boot
mount --bind /dev /mnt/root/dev
mount --bind /proc /mnt/root/proc
mount --bind /sys /mnt/root/sys

This will create a chroot environment and now you need to run chroot and create configuration file for grub

chroot /mnt/root
/usr/sbin/update-grub2
reboot

Now it should works

9
  • /mnt/root already exists, should I create another or, create the /dev, /proc... in this one (they don't exist) ?
    – Traklon
    Jul 9, 2014 at 13:39
  • create another one, eg /mnt/mydisk
    – Koss645
    Jul 9, 2014 at 13:40
  • I have a strange error on "chroot /mnt/mydisk" : chroot: failed to run command ‘/bin/bash’: No such file or directory
    – Traklon
    Jul 9, 2014 at 13:44
  • please paste here output from these commands: lvs;lvdisplay;
    – Koss645
    Jul 9, 2014 at 13:49
  • I've put my "lvs" in the question. It's strange, it only shows my 2 Fedora partitions.
    – Traklon
    Jul 9, 2014 at 13:52
1

First boot from live Ubuntu CD or Live Ubuntu flash drive and connect to internet. After that go to terminal by Ctrl+Alt+T and just use the command below,

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo sed 's/trusty/saucy/g' -i /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list
sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)

This actually fixes any problems with boot. If it still does not work for you, just leave the error report in the add comment section. You will find I have attached a link, it has screenshots and clear instruction. Just go to the link if something still not clear to you. Have Fun.

Reference link: Installing Boot-Repair in Ubuntu

4
  • This is really strange, gparted doesn't see anything in /dev/sda : it basically shows a grey rectangle saying the whole 698 G are unallocated.
    – Traklon
    Jul 9, 2014 at 13:37
  • I have copypasted my whole fdisk -l, maybe it helps.
    – Traklon
    Jul 9, 2014 at 13:47
  • Show me a picture of your system in GParted. Oh yeah, sorry about the wait. Google Drive takes a lot of time for the files. Jul 9, 2014 at 14:17
  • And what is the name of your computer? (HP 2000, Sony Vaio, etc.) Jul 9, 2014 at 14:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .