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