LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 04-29-2015, 12:54 AM   #1
Milo4t
LQ Newbie
 
Registered: Sep 2003
Location: Canberra, Australia
Distribution: Mageia #4.1
Posts: 27

Rep: Reputation: 0
Unhappy Mageia won' t boot after deleting a Mageia Test partition - GRUB Error 17


I have already posted this on the Mageia forums but I am posting it here as well to see if someone can help sort out what is going on!

On Friday I deleted 2 partitions on my 240Gb SSD - via Partition Manager #14 Free on my Windows 7 64 bit system - well I thought I deleted 2, looks like I only deleted one! I was using these as Mageia Test partitions. I needed to expand my /home partition on my usual Mageia #4 system as I was running out of space. So I deleted - what turns out to be only 1 partition of about 7Gb - and expanded my /home to be 37Gb. I must admit I wasn't keeping an eye on whether the boundary was on a 4K or not, but I would have thought that PM #14 would look after that. Here is the current partition of my SSD:

Present Partition Map -
Click image for larger version

Name:	Present Partition Map - SSD.PNG
Views:	56
Size:	9.0 KB
ID:	18298

Anyway, I re-booted and GRUB failed to boot my normal Mageia system. I was horrified, I should have just left well enough alone! So I re-booted with the Mageia DVD and selected "re-install bootloader". This failed with:

Click image for larger version

Name:	GRUB Error Code 17 - Cannot mount selected partition.jpg
Views:	89
Size:	252.0 KB
ID:	18299

So I tried a re-install of the system to /root hoping the install of the bootloader in that process might fix things - NO.

So I re-booted with the Mageia DVD and selected "reinstall Windows bootloader". Now GRUB doesn't even get a look in and my system just boots into Windows.

Going on the GRUB Error 17 messages it looks as though GRUB is trying to boot from (hd0,4). I thought partitions started at "0", so this looks GRUB is trying to boot the undeleted/unused/left-over-from-Mageia-Test /swap partition with an unrecognisable filesystem of "0x5"! Would that be correct????

This is what TestDisk finds on my SSD:

Quote:
Disk \\.\PhysicalDrive0 - 240 GB / 223 GiB - CHS 29185 255 63
Current partition structure:
Partition Start End Size in sectors

1 * HPFS - NTFS 0 32 33 12 223 19 204800
2 P HPFS - NTFS 12 223 20 7678 254 63 123156287
3 E extended 7679 133 1 15581 254 63 126953316
X extended 7679 133 6 10229 41 52 40960001
5 L Linux 7679 133 7 10229 41 52 40960000 [Mageia4_Root]
X extended 10229 41 53 15072 248 24 77815808
6 L Linux 10229 106 54 15072 248 24 77811712 [Mageia4_Home]
Mageia_Root doesn't have an " * " in front of it so this indicates it's not bootable?????? Why???

BUT, the interesting thing I discovered yesterday - accessing the newly re-installed Mageia in the /root partition from within Windows - is this located in /boot/grub/menu.lst:

Quote:
timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,4)/boot/gfxmenu
default 0

title linux
kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=a529b32a-323d-496b-9903-25393846941c nokmsboot splash quiet resume=UUID=46e0c7c9-1f40-41d9-a270-f8f5b84ff4d0
root (hd0,4)
initrd /boot/initrd.img

title failsafe
kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=a529b32a-323d-496b-9903-25393846941c nokmsboot failsafe
root (hd0,4)
initrd /boot/initrd.img

title windows
root (hd0,0)
makeactive
chainloader +1

title windows1
root (hd2,0)
map (0x80) (0x82)
map (0x82) (0x80)
makeactive
chainloader +1
Notice that Mageia is supposed to boot from (hd0,4) which is the partition listed in the " GRUB Error 17" msg! So what is going on????? I don't understand how this is failing with an unknown file type when this is from a re-install!

When I started all this I didn' t even touch the /root partition at all, so why would GRUB all of a sudden fail to boot Mageia - even after a re-install of system and bootloader?

Is there any way I can recover from this situation that doesn't involve wiping the whole Extended partition with /root and /home and the unused old /swap partitions and starting from scratch!

Any help most welcome!
Myles,
Canberra, Australia
 
Old 04-29-2015, 01:56 AM   #2
translator1111
Member
 
Registered: Jun 2010
Location: Slovakia
Distribution: Debian 8, Ubuntu 10.04 and 12.04; SLAX 6.0; ConnochaetOS 0.9.; LFS; Natty chip: VT1708S
Posts: 93
Blog Entries: 2

Rep: Reputation: 7
try to reinstall grub

Dear Milo4t,
I had the same problem and solved it.
Here are some answers to your questions:
Quote:
Test /swap partition with an unrecognisable filesystem of "0x5"! Would that be correct????
yes
Quote:
Mageia_Root doesn't have an " * " in front of it so this indicates it's not bootable?????? Why???
according to your post, you have reinstalled windows boot loader, that means that you do not have a dual system boot loader any more, only windows.
your /boot/grub/menu.lst is called only from GRUB. Correct me if I am wrong, but you are now booting your machine with your windows boot loader, so you do not have grub anymore as boot loader, right?
Quote:
Notice that Mageia is supposed to boot from (hd0,4) which is the partition listed in the " GRUB Error 17" msg! So what is going on????? I don't understand how this is failing with an unknown file type when this is from a re-install!
hd0,4 seems to me your home partition, in order to boot your machine, grub needs to find the partition that is bootable, that is the one that has the the *.
Is there any way I can recover from this situation that doesn't involve wiping the whole Extended partition with /root and /home and the unused old /swap partitions and starting from scratch!
Here is my suggestion:
try to reinstall grub to /dev/sd* (do you know how to find the name of your hard disk using fdisk?)
and run as root
PHP Code:
update-grub 
reboot and you should see your partitions in grub.
if not, please post any relevant information to help you further.
 
Old 04-29-2015, 03:38 AM   #3
Milo4t
LQ Newbie
 
Registered: Sep 2003
Location: Canberra, Australia
Distribution: Mageia #4.1
Posts: 27

Original Poster
Rep: Reputation: 0
Translator1111,
Thanks for the quick reply and pointing some things out.

But - why didn't the re-install of the bootloader - from the Mageia DVD - work in the first place when nothing had happened to the /root partition (I didn't touch it) so why wouldn't it boot after the partition deletion? - I tried several times to re-install the bootloader (GRUB2) always getting the GRUB Error 17 error - before I installed the Windows bootloader in frustration!

I mean, before I installed Mageia for the very first time on my system (it came with Windows installed on the SSD already), the install went successfully and GRUB was installed to replace the Windows bootloader. Would that be correct? So why didn't it work when I re-install the bootloader or as part of the re-install of Mageia?? I just do not understand this. I did work in IT before retiring so I am more than familiar with OS's etc. but have not had this sort of problem with my other systems, because this system has newer technology which I am not up to date with.

Now for your suggestion

Quote:
Here is my suggestion:
try to reinstall grub to /dev/sd* (do you know how to find the name of your hard disk using fdisk?)
and run as root
is that
PHP Code:
fdisk -
Does this mean that I re-boot using the Mageia DVD or other live CD and get into a terminal and do the
PHP Code:
update-grub 
Will that simple command fix the bootloader problem?
 
Old 04-29-2015, 08:11 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,756

Rep: Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810Reputation: 2810
Quote:
Originally Posted by Milo4t View Post
I tried several times to re-install the bootloader (GRUB2) always getting the GRUB Error 17 error
Those error messages are from grub legacy, not grub2. Something very screwy going on. Boot the install DVD (any liveCD is fine) and do the "fdisk -l" (root/sudo).
Even better, go here, run the script and post the RESULTS.txt.
 
Old 04-29-2015, 03:06 PM   #5
translator1111
Member
 
Registered: Jun 2010
Location: Slovakia
Distribution: Debian 8, Ubuntu 10.04 and 12.04; SLAX 6.0; ConnochaetOS 0.9.; LFS; Natty chip: VT1708S
Posts: 93
Blog Entries: 2

Rep: Reputation: 7
Dear Milo4t,
ok, so if you work in IT before, you probably know more than me.
What I presume is happening is something that has happened to me before and I solved it.
You may know that there are at least 2 kinds of GRUBs:
GRUB, also known as GRUB legacy, which is the v 0.97 that you showed in your print screen in your first post and it was organized using menu.lst in /boot/grub
and GRUB2 is the version 1. and superior with organizes using files in /etc/grub
I am assuming that your Mageia is trying to install GRUB2, however for some reason (it happened to me before) during reinstalation your machine cannot find GRUB2 but and old GRUB /this explains the menu.lst that you can see using Windows/
the GRUB error 17 is from v 0.97.
Until now what I know.
But you better listen to syq00 and send the result of the script, it will give us the facts and not the presumptions of the real state of your machine.

One hint more, GRUB legacy v 0.97 is older than GRUB2 and maybe does not understand how to treat GRUB2 chainloaders, probably this is the root-cause of error 17.
I have installed version 1.98 (adapted to Ubuntu 10.04)
Code:
grub-install --version
Faithfully,
M.
 
Old 04-30-2015, 02:50 AM   #6
Milo4t
LQ Newbie
 
Registered: Sep 2003
Location: Canberra, Australia
Distribution: Mageia #4.1
Posts: 27

Original Poster
Rep: Reputation: 0
*** ADMIN **** could you move this issue to the Mageia forum where I thought that I had posted it - only to find that I had posted it in the Mandriva forum (which I haven' t used since before it died).

translator1111, thanks for that and yes I know tat GRUB legacy stopped at 0.97. I thought that was a bit odd that I couldn' t find a /grub in /root/etc/ for GRUB2 where it should be I read. BUT, it should be as I thought that Mageia uses GRUB2. So why did it not re-install the GRUB2 bootloader when I very first tried to via the Mageia DVD, or when I completely re-installed Mageia into the /root partition?????

syg00, thanks for that link. I have the RESULTS.txt file: (I hope I have to use [CODE] tags?)

Code:
                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 =>  is installed in the MBR of /dev/sda.
 => Windows is installed in the MBR of /dev/sdc.
 => Windows is installed in the MBR of /dev/sdd.
 => Windows is installed in the MBR of /dev/sde.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /bootmgr /Boot/BCD

sda2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /Windows/System32/winload.exe

sda3: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info: 

sda5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:        /boot/grub/menu.lst /etc/fstab

sda6: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:
So that looks like it is using GRUB legacy for Mageia - but WHY?

Also, seeing I was using SystemRescueCD used sfdisk to list sda:

Code:
root@unknown902b34670b11 /root  sfdisk -l /dev/sda 

Disk /dev/sda: 29185 cylinders, 255 heads, 63 sectors/track
sfdisk: Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Units: cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sda1   *      0+     12-     13-    102400    7  HPFS/NTFS/exFAT
/dev/sda2         12+   7678    7667-  61578143+   7  HPFS/NTFS/exFAT
/dev/sda3       7679+  15581    7903-  63476658    5  Extended
/dev/sda4          0       -       0          0    0  Empty
/dev/sda5       7679+  10229-   2550-  20480000   83  Linux
/dev/sda6      10229+  15072-   4844-  38905856   83  Linux
So is that /dev/sda4 the problem? Which doesn't show up using TestDisk.

Okay, now I know a LOT more about this and what is going on. I did some more digging and got a link to Mageia doco - it seems GRUB legacy is the default bootloader for Mageia #4 until Mageia #5!

But, as I said I never changed that when I very first installed Mageia #4 on my system, so why fail now!

I just did yet another re-install, but in the Summary screen at the end of the install I chose GRUB 2 for the bootloader and this is what I got:

http://i1099.photobucket.com/albums/...psqgusmwph.jpg!



Thanks for all the help so far, I really appreciate it.

Still bamboozled! (and without my Mageia system)

So, any advice on what I should do from here to get mysystem back?

Last edited by Milo4t; 04-30-2015 at 04:26 AM. Reason: Added more info
 
Old 05-04-2015, 02:13 AM   #7
Milo4t
LQ Newbie
 
Registered: Sep 2003
Location: Canberra, Australia
Distribution: Mageia #4.1
Posts: 27

Original Poster
Rep: Reputation: 0
If anyone is interested, I now have my system back.

I am writing this reply on my newly installed Mageia #4.1 system! (for the 2nd time! details in a minute!) (Although I have picked up some quirks in the re-install - details later)

It sure looks as though what the installers did was create a 100Mb EFI partition for Windows. But that doesn't explain why I was able to successfully install Mageia #4 when Windows was already installed.

Anyway, benmc on the Official Mageia forums came to my rescue, I did indeed have to change my BIOS settings on my mobo form "UEFI and Legacy" to "Legacy only". I also had another setting for CSM but that turned a re-install into a text-basd install (why).

Anyway, here is what happened on Saturday and Sunday. Changed UEFI setting, tried re-install with GRUB - fail. Changed CSM - tried re-install - fail. Tried re-install with Mageia #5 RC with GRUB2 and "Legacy only" set - success! BUT, then realised that I wouldn't be able to re-install all my normal pgms that I use. So, re-install Mageia #4.1 with GRUB2 and "Legacy only" set - success - sort of! When I re-booted my name wasn't in the login panel (and still isn't!???? Minor - don't know how to fix that) but just typed my login and PW and in okay. Whilst logged in eventually had updates flagged for the system (of course). This took about an hour or so. Re-booted and logged in (still no name in login panel). Found that I had problems following the update - Firefox was acting strangely when I was in Yahoo mail - Minor, but annoying! BUT Dolphin hadn't automatically started (odd). So I tried to start it - no go, cursor animation just bounced up and down for a while and then stopped! Very annoyed!! Left it overnight.

Monday, Decided to give it one more chance. So I performed a re-install with GRUB2, including downloading all updated packages. This took 2 hours or so. Still no name in login panel! BUT Dolphin is working, Firefox still has quirk in Yahoo mail. Now I will have to re-install all of my other pgms to bring my system back to where it was before I stuffed up the partitioning!!!!

Anyway, I hope nothing further goes wrong.

So now I know that I'll be able to install Mageia #5 when it is released as well.

Again, thanks for all the help and patience!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mageia 4 fresh install won't boot. theKbStockpiler Mageia 5 03-05-2014 08:35 AM
[SOLVED] GRUB error? Mageia 3, can't boot without DVD ADDn00b Mageia 18 06-01-2013 06:28 PM
[SOLVED] Can't Boot Mageia 2 after Upgrading from Mageia 1 gdawg Mageia 3 06-24-2012 10:20 AM
LXer: Open Source: Mageia 1 to Mageia 2 Upgrade LXer Syndicated Linux News 0 05-22-2012 04:30 PM
[SOLVED] Grub error 17 after installing Mageia nigelc Mandriva 2 08-29-2011 12:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration