System fails to boot [Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

System fails to boot [Solved]

Postby VolvoBirkenstock » Sat Jun 22, 2013 4:34

My system is dual-bootable into Sabayon Linux and Windows 7 64-bit. The system was new several months ago. I have kept Sabayon up-to-date on a weekly basis through sabayon-weekly. I have booted daily into Sabayon Linux and seldom into Win7. However, last night I booted into Win7 and used the system for several hours. I then rebooted. During reboot the system literally showed
Code: Select all
GRUB loading..

on the monitor and failed to progress.

I found the following webpage: wiki.sabayon.org/index.php?title=HOWTO:_Restore_Grub2

I loaded the liveDVD into the DVD drive and booted into the liveDVD. I carefully read through and executed the "Quick Recovery" section. However, before performing the mount commands, I executed "vgchange -a y" in order to make the default volume groups available for mounting, in the event that I needed to regain access to personal data. As such, the execution went as follows:
Code: Select all
mkdir -p /mnt/sabayon
vgchange -a y
mount /dev/sda3 /mnt/sabayon
mount /dev/sda1 /mnt/sabayon/boot
grub2-install --root-directory=/mnt/sabayon /dev/sda

I suspect that the use of "vgchange" had no impact on /dev/sda3 since it does not appear to be part of a logical volume or a volume group. I hope that this action didn't mess up the process.

I then unmounted /dev/sda1 and /dev/sda3 and executed "vgchange -a n". I then attempted to reboot the system. The system shutdown and I removed the LiveDVD. I then attempted reboot and again saw progress halt at
Code: Select all
GRUB loading..


This is what "fdisk -l" returns for /dev/sda:
Code: Select all
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   614399999   307096576    7  HPFS/NTFS/exFAT
/dev/sda3       614400000   615423999      512000   83  Linux
/dev/sda4       615424000  3907028991  1645802496    5  Extended
/dev/sda5       615426048  3907028991  1645801472   8e  Linux LVM

so I don't see any significant discrepancy between the "Quick Recovery" instructions and the configuration of my system.

I don't know what the problem is other than I can't get the system past "GRUB loading..". I do not know if Win7 destroyed the MBR (Master Boot Record).

Can the experts here please provide me with advice on what I should do next?

Do I need to attempt the "Completely Reinstall and Re-Configure Grub2" section of the previously listed web link?

Is there a potential hardware issue here, and if so, how should I troubleshoot to determine that?

Once this is fixed -- assuming it can be fixed -- what can I do to preclude recurrence?

Thanks very much for any help you can provide.
Last edited by VolvoBirkenstock on Mon Jun 24, 2013 6:39, edited 1 time in total.
VolvoBirkenstock
Growing Hen
 
Posts: 143
Joined: Sun Mar 31, 2013 5:34

Re: System fails to boot

Postby Honeyman » Sat Jun 22, 2013 14:35

VolvoBirkenstock wrote:My system is dual-bootable into Sabayon Linux and Windows 7 64-bit.

[snip]

I found the following webpage: wiki.sabayon.org/index.php?title=HOWTO:_Restore_Grub2

I loaded the liveDVD into the DVD drive and booted into the liveDVD. I carefully read through and executed the "Quick Recovery" section. However, before performing the mount commands, I executed "vgchange -a y" in order to make the default volume groups available for mounting, in the event that I needed to regain access to personal data. As such, the execution went as follows:
Code: Select all
mkdir -p /mnt/sabayon
vgchange -a y
mount /dev/sda3 /mnt/sabayon
mount /dev/sda1 /mnt/sabayon/boot
grub2-install --root-directory=/mnt/sabayon /dev/sda



Regarding the output of fdisk -l below, /dev/sda1 seems to be Windows 7's boot-partition.
Your Sabayon root-partition should be /dev/sda5 and not /dev/sda3 as you declared in the grub2-install command. You mounted your boot-partition as /mnt/sabayon (I assume this was meant to be the root-partition) and Windows boot-partition as /mnt/sabayon/boot



VolvoBirkenstock wrote:This is what "fdisk -l" returns for /dev/sda:
Code: Select all
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda2          206848   614399999   307096576    7  HPFS/NTFS/exFAT
/dev/sda3       614400000   615423999      512000   83  Linux
/dev/sda4       615424000  3907028991  1645802496    5  Extended
/dev/sda5       615426048  3907028991  1645801472   8e  Linux LVM



You do not seem to have a separate home-partition. I do not think it is absolutely helpful for solving your problem, but could you post your Volume Group and Physical/Logical Volumes set up?

Code: Select all
# pvdisplay

# vgdisplay

# lvdisplay


VolvoBirkenstock wrote:Once this is fixed -- assuming it can be fixed -- what can I do to preclude recurrence?


It might help, but most probably will not prevent all imaginable problems, to make a backup of the MBR. By this I do not say that your problem has to do with the MBR, this is just recommendation for trying to preclude such unhappy issues in the future.

Code: Select all
# dd if=/dev/sda of=/PLACE-TO-BE-SAVED/mbrsda.bak bs=512 count=1


This make a byte-to-byte copy of the MBR, which sits on the first 512 byte of the physical drive. The restore the backup just reverse the order of the command:

Code: Select all
# dd if=/PLACE-TO-BE-SAVED/mbrsda.bak of=/dev/sda bs=512 count=1
Je me regarde pour me désoler,
je me compare pour me consoler

Maurice de Talleyrand
Honeyman
Growing Hen
 
Posts: 159
Joined: Sun Apr 08, 2012 2:25
Location: Berlin, Germany

Re: System fails to boot

Postby VolvoBirkenstock » Sat Jun 22, 2013 17:10

Thank you for responding, Honeyman. I used the Sabayon default setup which included the lvm2 setup when I setup the dual-bootable system. Hopefully my previous manipulation does not kill my ability to boot into Win7, otherwise that will require a lengthy reinstall since there is a lot of third-party software inside Win7. (If I must reinstall Win7, then I assume that I will yet again need to repair Grub.) The reason I used the instructions from wiki.sabayon.org/index.php?title=HOWTO:_Restore_Grub2 verbatim is because those instructions also involved a multi-bootable system. (From the second sentence of http://wiki.sabayon.org/index.php?title ... tore_Grub2: "Maybe you reinstalled Windows and lost Grub2 or you just plain old did something silly...".) I apparently mistakenly believed that those instructions would account for that, especially given that I performed the default Sabayon installation. As for doing something silly, I am likely occasionally guilty. ;-)

I will try to repair Grub again using the insight you have provided. I will report back the result.

You asked for Volume Group and Physical/Logical Volumes set up:
Code: Select all
localhost sabayonuser # vgdisplay
  --- Volume group ---
  VG Name               vg_titanic
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               1.53 TiB
  PE Size               32.00 MiB
  Total PE              50225
  Alloc PE / Size       50225 / 1.53 TiB
  Free  PE / Size       0 / 0   
  VG UUID               NVfuWO-4m3x-M8tI-E3ui-BylT-Uy0W-YsZpcX

localhost sabayonuser # pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda5
  VG Name               vg_titanic
  PV Size               1.53 TiB / not usable 28.00 MiB
  Allocatable           yes (but full)
  PE Size               32.00 MiB
  Total PE              50225
  Free PE               0
  Allocated PE          50225
  PV UUID               2g8Pli-Yvoj-U1yA-HLjN-s5DI-do3D-0VhBbp

localhost sabayonuser # lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg_titanic/lv_root
  LV Name                lv_root
  VG Name                vg_titanic
  LV UUID                q1p5iu-y2co-6uEy-1jRc-MFpK-gOUk-t3AuhO
  LV Write Access        read/write
  LV Creation host, time localhost, 2012-12-30 16:56:14 +0000
  LV Status              NOT available
  LV Size                97.66 GiB
  Current LE             3125
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/vg_titanic/lv_swap
  LV Name                lv_swap
  VG Name                vg_titanic
  LV UUID                q7f2M0-yxWo-9CP9-hnZI-Q6fr-crYZ-DTuUbF
  LV Write Access        read/write
  LV Creation host, time localhost, 2012-12-30 16:56:15 +0000
  LV Status              NOT available
  LV Size                15.62 GiB
  Current LE             500
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Logical volume ---
  LV Path                /dev/vg_titanic/lv_home
  LV Name                lv_home
  VG Name                vg_titanic
  LV UUID                fM9p2t-xbvI-uJUa-WmyI-LY0p-uf90-vtVvo3
  LV Write Access        read/write
  LV Creation host, time localhost, 2012-12-30 16:56:17 +0000
  LV Status              NOT available
  LV Size                1.42 TiB
  Current LE             46600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto


Again, thank you very much.
VolvoBirkenstock
Growing Hen
 
Posts: 143
Joined: Sun Mar 31, 2013 5:34

Re: System fails to boot

Postby VolvoBirkenstock » Sat Jun 22, 2013 17:40

I just performed the following manipulation while running LiveDVD:
Code: Select all
mkdir -p /mnt/sabayon
vgchange -a y
mount /dev/vg_titanic/lv_root /mnt/sabayon
mount /dev/sda3 /mnt/sabayon/boot
grub2-install --root-directory=/mnt/sabayon /dev/sda
umount /mnt/sabayon/boot
umount /mnt/sabayon
vgchange -a n
reboot

grub2-install completed without error.
I removed the LiveDVD prior to restart of the boot attempt.
However, reboot failed in the same manner as before with
Code: Select all
GRUB loading..


The Titanic remains sunken. :-(
VolvoBirkenstock
Growing Hen
 
Posts: 143
Joined: Sun Mar 31, 2013 5:34

Re: System fails to boot

Postby Honeyman » Sat Jun 22, 2013 21:57

In case you have an installation media for Windows 7 (a CD/DVD that is) you can boot from it and have the Windows installer repair its boot-partition and/or MBR, so you can at least boot Windows, no need to reinstall the system. At least the Ultimate Edition gives you this option, I do not know about other editions. Windows will ignore Linux of course, so there still remains the task to get GRUB2 running.
Je me regarde pour me désoler,
je me compare pour me consoler

Maurice de Talleyrand
Honeyman
Growing Hen
 
Posts: 159
Joined: Sun Apr 08, 2012 2:25
Location: Berlin, Germany

Re: System fails to boot

Postby VolvoBirkenstock » Sun Jun 23, 2013 2:55

Again, thank you very much for your help, Honeyman.

I have just completed
Code: Select all
smartctl -t long /dev/sda
on the hard drive.
Code: Select all
smartctl -l selftest /dev/sda
returned "Completed without error".

Should I next attempt to "Completely Reinstall and Reconfigure Grub2" instead of just trying a "Quick Recovery"? (See http://wiki.sabayon.org/index.php?title ... tore_Grub2) If this works, then hopefully I would be able to boot into either Linux or Win7. If it fails, then something is very messed up. If reinstalling and reconfiguring Grub2 allows me to boot into Linux and NOT into Win7, then that would tell us _something_, but I don't know what that would be; I would suspect that the Win7 installation has become the problem. I can always fall back on trying to use the Win7 install DVD to repair the Win7 Master Boot Record (MBR) and/or boot partition, and if needed, reinstall/reconfigure Grub2 afterwards.

I know nothing about how Grub2 works. Does grub2-install write anything into the Win7 boot partition and specifically into the MBR when you have a dual-bootable system? Is Grub2 dependent on the integrity of the MBR of /dev/sda which is contained within a Win7 partition? If so, if Win7 has somehow corrupted the contents of the MBR, then that would explain _something_.

I'm not knowledgeable when it comes to recovering an MBR, and I don't even know if that is the problem. I could try to use the Win7 installer to repair the Win7 boot partition and/or MBR, but I've never done that before, and frankly don't know if I could damage that installation with that manipulation. Considering that I don't yet understand the problem, I should probably try to save off as much personal data from the Windows partitions as possible. Once that is done, then I will use the Windows installer to repair.

Do you think this is a reasonable approach? Should I attempt to completely reinstall and reconfigure grub2 first?
VolvoBirkenstock
Growing Hen
 
Posts: 143
Joined: Sun Mar 31, 2013 5:34

Re: System fails to boot

Postby Honeyman » Sun Jun 23, 2013 7:46

VolvoBirkenstock wrote:Should I next attempt to "Completely Reinstall and Reconfigure Grub2" instead of just trying a "Quick Recovery"? (See http://wiki.sabayon.org/index.php?title ... tore_Grub2) If this works, then hopefully I would be able to boot into either Linux or Win7. If it fails, then something is very messed up. If reinstalling and reconfiguring Grub2 allows me to boot into Linux and NOT into Win7, then that would tell us _something_, but I don't know what that would be; I would suspect that the Win7 installation has become the problem. I can always fall back on trying to use the Win7 install DVD to repair the Win7 Master Boot Record (MBR) and/or boot partition, and if needed, reinstall/reconfigure Grub2 afterwards.


Try a complete reinstall of GRUB2.

VolvoBirkenstock wrote:I know nothing about how Grub2 works. Does grub2-install write anything into the Win7 boot partition and specifically into the MBR when you have a dual-bootable system? Is Grub2 dependent on the integrity of the MBR of /dev/sda which is contained within a Win7 partition? If so, if Win7 has somehow corrupted the contents of the MBR, then that would explain _something_.


Here are some links that might help you along the way and especially the Archi Wiki has lots of information on all the options of how to reinstall GRUB2:

https://wiki.archlinux.org/index.php/GRUB

https://wiki.archlinux.de/title/GRUB

http://wiki.ubuntuusers.de/GRUB_2/Installation

https://help.ubuntu.com/community/Grub2

https://help.ubuntu.com/community/Grub2/Installing

Some links are in German, as I deduce from your user name that you might be German.


VolvoBirkenstock wrote:I'm not knowledgeable when it comes to recovering an MBR, and I don't even know if that is the problem. I could try to use the Win7 installer to repair the Win7 boot partition and/or MBR, but I've never done that before, and frankly don't know if I could damage that installation with that manipulation. Considering that I don't yet understand the problem, I should probably try to save off as much personal data from the Windows partitions as possible. Once that is done, then I will use the Windows installer to repair.


I did repair the Win7 MBR once with an installation media and it worked fine, which of course might no turn out to be the case in your situation. But I think the risk is not too high (damaging the Win7 system partition by the repair tool).

Definitively make a backup of all your personal data on Windows and on Sabayon!! In case you have enought disk space on an external drive you could also make a dd-copy of the Win7 partition. In case Windows 7 does not survive the repair efforts, you then have the chance to copy the data back, and if you are lucky the complete system is saved:

Code: Select all
# dd if=/dev/sda2 of=/PATH/TO/EXTERNAL-DRIVE/Name_of_Windows-Backup-dd bs=4M noerror, sync


This would copy the entire partition /dev/sda2 byte by byte even empty parts to the backup file. For a 60GB partition this creates a 60GB file!

Why don't you try to reinstall GRUB2 first? If this fails then you could repair the Windows MBR - this should give you back the Windows installation. Then try again to reinstall GRUB2. If the last step is unsuccessful, well you might figure that it is not worth the effort and reinstall Sabayon.
Je me regarde pour me désoler,
je me compare pour me consoler

Maurice de Talleyrand
Honeyman
Growing Hen
 
Posts: 159
Joined: Sun Apr 08, 2012 2:25
Location: Berlin, Germany

Re: System fails to boot

Postby VolvoBirkenstock » Sun Jun 23, 2013 20:32

Hi, Honeyman.
I just performed the following complete Grub2 reinstallation in keeping with the instructions presented in http://wiki.sabayon.org/index.php?title ... tore_Grub2 :
Code: Select all
mkdir -p /mnt/sabayon/boot
vgchange -a y
mount /dev/vg_titanic/lv_root /mnt/sabayon
mount /dev/sda3 /mnt/sabayon/boot
mount -t proc none /mnt/sabayon/proc
mount -t sysfs sys /mnt/sabayon/sys
mount -o bind /dev /mnt/sabayon/dev
chroot /mnt/sabayon /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"
cp /proc/mounts /etc/mtab
grub2-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount /mnt/sabayon/dev /mnt/sabayon/sys /mnt/sabayon/proc /mnt/sabayon/boot /mnt/sabayon
vgchange -a n
shutdown -r now

During the shutdown process I removed the LiveDVD. Upon attempted reboot I saw the following displayed on my monitor:
Code: Select all
GRUB Loading..
with no progress. :-(

I had earlier attempted
Code: Select all
grub2-install /dev/sda3
instead of
Code: Select all
grub2-install /dev/sda
but multiple warnings were displayed to my monitor due to the file system I am running (xfs) and complaints that this operation could damage the file system. Instead of forcing the grub2-install to /dev/sda3, I instead changed it to /dev/sda.

I don't know why this failed to work. My motherboard runs UEFI, and that has been successfully booting on a daily basis for several months. I do not understand why the system continues to fail to recover. Unless someone can provide some magic, it looks like I will be buying another hard drive and performing fresh installations of Win7 and Sabayon Linux in the near future. This is going to cost me a great deal of time.

If anyone has seen similar issues with UEFI and knows corrective methods, I would definitely like to hear about it.

Thank you for your time and effort. The Titanic is on the sea floor.
VolvoBirkenstock
Growing Hen
 
Posts: 143
Joined: Sun Mar 31, 2013 5:34

Re: System fails to boot

Postby Honeyman » Sun Jun 23, 2013 21:37

I'm sorry to here about you being unsuccessful. It seems to me that UEFI is the culprit, this has given Linux distributions quite some trouble since it was introduced on a wider scale. I do not have any experience with UEFI+Linux+GRUB, I'm afraid. So I cannot help you here.

I do not think that buying a new hard drive will solve your problems (a really unattractive option anyways), it's rather to do with UEFI. Before you totally exasperate (quite understably), head over to the LinuxQuestions Forum (http://www.linuxquestions.org/questions/) and ask for help there. I hope I will not get lynched here on the Sabayon forum for recommending a 'rival'. There are so many people, and quite a few of them know a lot about Linux, that I would say there is a more than fair chance for you to get valuable help.

BTW: Could you repair the Win7 boot-partition?
Je me regarde pour me désoler,
je me compare pour me consoler

Maurice de Talleyrand
Honeyman
Growing Hen
 
Posts: 159
Joined: Sun Apr 08, 2012 2:25
Location: Berlin, Germany

Re: System fails to boot [Solved]

Postby VolvoBirkenstock » Mon Jun 24, 2013 6:39

Hi, Honeyman.
You asked if I could repair the Win7 boot partition. I repaired the Win7 MBR. The system -- both Win7 and Sabayon Linux -- then booted. So it looks like whatever corrupted the Win7 MBR also may have crippled Grub2. Even so, I was feeling pretty elated. The Titanic was starting to float again. ;-)

But that is not the end of the story. I decided to scrutinize the Win7 partitions. I ran a few select tools from Hiren's, primarily MalwareBytes, and found a few things, but I don't know if they could have corrupted the MBR. After completing this work, I then rebooted.

And the reboot failed. :shock:

I noticed the following line near the top of the monitor when it was attempting to boot:
Code: Select all
ata3: softreset failed
Starts to smell like a hardware issue, eh?

I setup the UEFI to attempt to boot off of the hard drive but fail over onto the DVD drive and inserted the LiveDVD. The system took a very long time and finally decided to boot the LiveDVD. Once the LiveDVD came up, I opened up a "konsole" terminal and executed "df -h". Lo and behold, the /dev/sda hard drive was not detected. All other hard drives were detected.

I shutdown the system and opened the case and checked the power and communication wiring to all of the hard drives and the DVD drive. The communication wiring for the sda drive was uncharacteristically loose on the motherboard. I re-seated the wiring. I then rebooted.

I am typing this message from the deck of the Titanic. I believe all icebergs have vanished. ;-) I am marking this thread "Solved". Again, thank you very much for your help.

I am curious. Is it possible for a loose SATA wire to somehow damage an MBR?
VolvoBirkenstock
Growing Hen
 
Posts: 143
Joined: Sun Mar 31, 2013 5:34

Next

Return to Beginners|Newbies Area

Who is online

Users browsing this forum: No registered users and 2 guests