LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices



Reply
 
Search this Thread
Old 01-30-2013, 02:52 AM   #1
vecciora
Member
 
Registered: Jan 2009
Distribution: Mageia, Fedora, OpenMandriva Lx, ROSA Linux
Posts: 37

Rep: Reputation: 0
Bootloader Erased After Suspend to RAM


This thread is related to this thread. I can't figure out why Mandriva, Mageia, Mint and Fedora destroyed the bootloader after suspending to RAM. Each distro was tested after installed on my netbook via suspend to RAM menu on KDE.

My netbook is an ASUS 1215B with AMD E350 APU which the spec you can see here.

Everything works just fine after wake up from sleeping mode except that after rebooting I always found that the bootlader was erased. I got "_" blinking on the upper-left corner of the screen.

I have to reinstall GRUB via live USB to fix this.
 
Old 01-30-2013, 03:22 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,488

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
It is (extraordinarily) unlikely the Linuxen are doing this.
Check your BIOS for a "Virus Protection" option that may be getting in the way. Dell laptops have some "handy" Windoze tools that protect you and have this effect - only when run unannounced from Windoze tho'.
 
Old 01-30-2013, 04:03 AM   #3
vecciora
Member
 
Registered: Jan 2009
Distribution: Mageia, Fedora, OpenMandriva Lx, ROSA Linux
Posts: 37

Original Poster
Rep: Reputation: 0
Linuxen? I've never heard anything about that. Can you explain me what is Linuxen?

Okay, I've searched through my BIOS settings but there is not something like "Virus Protection" exists.
 
Old 01-30-2013, 04:37 AM   #4
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Mint, Xubuntu
Posts: 186

Rep: Reputation: 13
Could you verify if anything actually gets changed on the MBR and/or /boot partition while suspending? Do a binary compare before and after suspend.
 
Old 01-30-2013, 09:47 AM   #5
vecciora
Member
 
Registered: Jan 2009
Distribution: Mageia, Fedora, OpenMandriva Lx, ROSA Linux
Posts: 37

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by displace View Post
Could you verify if anything actually gets changed on the MBR and/or /boot partition while suspending? Do a binary compare before and after suspend.
How could I verify that? Sorry, but I'm a noob.
 
Old 01-30-2013, 12:57 PM   #6
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Mint, Xubuntu
Posts: 186

Rep: Reputation: 13
What exactly did you mean that GRUB disappears / gets erased? Did you mean that the screen becomes black and doesn't show the bootloader screen on reboot? That does not necessarily mean your entire boot loader is gone. It's still strange that you get a black screen. And this only happens after you suspend, not poweroff/reboot normally without suspending?

What is the partition layout for your setup? In a terminal type "fdisk -l" and print the output here. Do you have a swap partition? What is the amount of your RAM?

You can calculate a hash for any file (or partition while logged in as root - in linux a partition is a file!). Assuming your /boot files are on a separate partition you can do "shasum /dev/sda1" inside a root terminal. This should print something like:

a57ab8c4f4c7800b3ab649eee3200419794a2f13 /dev/sda1

Do it before and after suspending. Compare both numbers - they must be identical. If not then something has been modified for sure!
 
1 members found this post helpful.
Old 01-30-2013, 01:10 PM   #7
vecciora
Member
 
Registered: Jan 2009
Distribution: Mageia, Fedora, OpenMandriva Lx, ROSA Linux
Posts: 37

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by displace View Post
What exactly did you mean that GRUB disappears / gets erased? Did you mean that the screen becomes black and doesn't show the bootloader screen on reboot? That does not necessarily mean your entire boot loader is gone. It's still strange that you get a black screen. And this only happens after you suspend, not poweroff/reboot normally without suspending?

What is the partition layout for your setup? In a terminal type "fdisk -l" and print the output here. Do you have a swap partition? What is the amount of your RAM?

You can calculate a hash for any file (or partition while logged in as root - in linux a partition is a file!). Assuming your /boot files are on a separate partition you can do "shasum /dev/sda1" inside a root terminal. This should print something like:

a57ab8c4f4c7800b3ab649eee3200419794a2f13 /dev/sda1

Do it before and after suspending. Compare both numbers - they must be identical. If not then something has been modified for sure!
Yeah. It's only after a suspend to RAM. I thought the bootloader was erased because it was restored after I reinstalled GRUB.

This is fdisk -l output.
Code:
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0xbe28290d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576    7  HPFS/NTFS/exFAT
/dev/sda2         2099200   535330815   266615808    7  HPFS/NTFS/exFAT
/dev/sda3       535332861   625137659    44902399+   f  W95 Ext'd (LBA)
/dev/sda5       535332864   575978444    20322790+  83  Linux
/dev/sda6       575985664   584364374     4189355+  82  Linux swap / Solaris
/dev/sda7       584368128   625137659    20384766   83  Linux
Yes, I have a swap partition for about the same amount of my actual RAM.
Code:
             total       used       free     shared    buffers     cached
Mem:       3647076    3504472     142604          0    2383236     255560
-/+ buffers/cache:     865676    2781400
Swap:      4189348         44    4189304
The 'current' hash of my Linux root. I don't have /boot in another partition.
Code:
f322f3215a6f08f18a830d737d1f78e5dfd856b3  /dev/sda5
This is the hash of my Linux root after suspending.
Code:
d95fbd674a44acd0126d01cf82fc42bff4efb605 /dev/sda5
It's changed.

Last edited by vecciora; 01-30-2013 at 01:37 PM.
 
Old 01-30-2013, 02:05 PM   #8
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Mint, Xubuntu
Posts: 186

Rep: Reputation: 13
The root hash isn't going to do here because it hashes the entire root partition. The files on root partition are bound to change over time - take the /var/log folder for example where the logs can change every minute. I see you're dual-booting linux and windows.

If your /boot is not on another partition then you can do this instead:

tar -cf - /boot | shasum

You might also want to check the first 2047 sectors (including MBR) that reside on your HDD before the 1st partition:

dd if=/dev/sda of=/root/sectors.tmp bs=512 count=2047
shasum /root/sectors.tmp


Exercise caution when using the "dd" as the root account because you can easily erase your MBR, if you're not careful!

~dis
 
Old 01-30-2013, 06:11 PM   #9
jefro
Guru
 
Registered: Mar 2008
Posts: 12,086

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Some new bios's do an odd deal where you can only return to the saved OS if you hibernate. It may be that some issue is going on there.


It also might even be some oddity of overlapping partitions.

Swap has to be (I forget how much) more than ram but use some factor more.
 
Old 01-30-2013, 11:14 PM   #10
vecciora
Member
 
Registered: Jan 2009
Distribution: Mageia, Fedora, OpenMandriva Lx, ROSA Linux
Posts: 37

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by displace View Post
The root hash isn't going to do here because it hashes the entire root partition. The files on root partition are bound to change over time - take the /var/log folder for example where the logs can change every minute. I see you're dual-booting linux and windows.

If your /boot is not on another partition then you can do this instead:

tar -cf - /boot | shasum

You might also want to check the first 2047 sectors (including MBR) that reside on your HDD before the 1st partition:

dd if=/dev/sda of=/root/sectors.tmp bs=512 count=2047
shasum /root/sectors.tmp


Exercise caution when using the "dd" as the root account because you can easily erase your MBR, if you're not careful!

~dis

I've tried your command and nothing was changed after suspending to RAM.
 
Old 01-31-2013, 01:29 AM   #11
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Mint, Xubuntu
Posts: 186

Rep: Reputation: 13
Strange. And you say this happens after rebooting, but only if you suspend to ram before rebooting? Does it happen if you reboot without suspending to ram? The only other thing I can imagine is that something changes when you poweroff/reboot. Could you repeat the process to get the black screen at boot again? Then when the "grub disappears", boot to a rescue system and do the hashing from there. Hashing the first 2047 sectors should be the same as above, but you will need to mount the main partition to hash the /boot folder. I hope you still have the old HASH numbers somewhere!

cd /mnt
mkdir disk
mount /dev/sda5 /mnt/disk
tar -cf - /mnt/disk/boot | shasum
umount /mnt/disk



If this doesn't show any changes then there must be a hardware/firmware problem somewhere. Likely with BIOS.
 
Old 01-31-2013, 01:48 AM   #12
vecciora
Member
 
Registered: Jan 2009
Distribution: Mageia, Fedora, OpenMandriva Lx, ROSA Linux
Posts: 37

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by displace View Post
Strange. And you say this happens after rebooting, but only if you suspend to ram before rebooting? Does it happen if you reboot without suspending to ram? The only other thing I can imagine is that something changes when you poweroff/reboot. Could you repeat the process to get the black screen at boot again? Then when the "grub disappears", boot to a rescue system and do the hashing from there. Hashing the first 2047 sectors should be the same as above, but you will need to mount the main partition to hash the /boot folder. I hope you still have the old HASH numbers somewhere!

cd /mnt
mkdir disk
mount /dev/sda5 /mnt/disk
tar -cf - /mnt/disk/boot | shasum
umount /mnt/disk



If this doesn't show any changes then there must be a hardware/firmware problem somewhere. Likely with BIOS.
Okay, thanks! I'll try it soon.
 
Old 01-31-2013, 02:11 AM   #13
vecciora
Member
 
Registered: Jan 2009
Distribution: Mageia, Fedora, OpenMandriva Lx, ROSA Linux
Posts: 37

Original Poster
Rep: Reputation: 0
Yeah, it's not "being erased". I've tried to suspend to RAM and then reinstalled GRUB immediately, rebooted and still got "_" blinking on the top-left corner.

Even more surprising is that after I booted to Debian Live, Mageia Installer without doing anything and then rebooting, I could get into my installed Mageia in sda5.

I haven't done that shasum thing.

edit: I have tried it and the hash wasn't changed.

Last edited by vecciora; 01-31-2013 at 02:23 AM.
 
Old 01-31-2013, 02:33 AM   #14
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Mint, Xubuntu
Posts: 186

Rep: Reputation: 13
Does the black screen only happen when you suspend? Does it happen, if you install Mageia and reboot a couple of times without suspending to ram? I see that the boot loader remains unchanged, so there's little point in reinstalling grub2.
 
Old 01-31-2013, 10:06 AM   #15
vecciora
Member
 
Registered: Jan 2009
Distribution: Mageia, Fedora, OpenMandriva Lx, ROSA Linux
Posts: 37

Original Poster
Rep: Reputation: 0
This blank screen never occurred before the day I started to suspend my system.
 
  


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
Suspend to ram (worked only once) Tripsun Linux - Newbie 2 05-18-2011 09:55 AM
Suspend to RAM yegnal Linux - Hardware 1 05-23-2009 07:21 PM
Plz explain Suspend to Disk and Suspend to Ram pkhera_2001 Linux - Newbie 2 02-18-2008 08:23 AM
suspend to ram and s2ram radiodee1 Debian 3 12-08-2007 05:18 PM
Bootloader (MBR) erased by XP (different ISSUE) Cr7pt0r Linux - Newbie 3 05-25-2005 09:48 PM


All times are GMT -5. The time now is 05:38 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration