LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-26-2017, 03:01 PM   #1
lonesoac0
Member
 
Registered: Jan 2010
Distribution: Ubuntu
Posts: 98

Rep: Reputation: 4
Debian not booting into OS automatically


Hello all,

My machine keeps wanting to boot into the Grub shell by default. I can do:

grub> set root=(hd0,1)
grub> linux /vmlinuz root=/dev/sda1
grub> initrd /initrd.img
grub> boot

and I can get into my OS then. Is there a permanent fix for this issue?
 
Old 03-26-2017, 03:36 PM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
once booted you could run grub-install and update-grub. My SSD or motherboard is odd, I have to boot grub from a USB stick. At which point I can switch over to the grub on the ssd.

GRUB> insmod part_gpt
GRUB> insmod ext2
GRUB> ls
(hd0) (... ... ... ...
GRUB> configfile (hd1,gpt1)/boot/grub/grub.cfg

Too lazy to update-grub on the stick, plus not the default option anyway. I have to get to the grub prompt with "c" in my case.
 
Old 03-26-2017, 03:37 PM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,909

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by lonesoac0 View Post
Hello all,

My machine keeps wanting to boot into the Grub shell by default. I can do:

grub> set root=(hd0,1)
grub> linux /vmlinuz root=/dev/sda1
grub> initrd /initrd.img
grub> boot

and I can get into my OS then. Is there a permanent fix for this issue?
You can try re-install grub as root to have it do the scanning again, any time it does not find everything that was there originally when installed you get that shell option foolishness. At least that is what I am thinking happened a change in the OSs installed or drive location possibly.
 
Old 03-26-2017, 05:07 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 9,396

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Is this a new problem, meaning did it boot the way you wanted/expected previously?
Or, is this a new install and it never worked correctly?
And is this the only OS on the computer since you don't mention any other?
And, did you make any changes to drives/partitions, etc.

I don't think there is any need to re-install Grub, especially if Debian is the only OS which we don't know but doing the update-grub, if Debian uses it, should help. I don't use Debian so I don't know id it uses the update-grub stud or sudo, but in any case, as root the following will update the grub files: sudo grub-mkconfig -o /boot/grub/grub.cfg
If you aren't using sudo, you need to be logged in as root. Also, some systems name the grub directory 'grub2' so watch for that.
 
Old 03-26-2017, 05:28 PM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
There are reasons to re-install grub. The version changes. Windows messes up the MBR. You changed /etc/fstab. Or any and all of the above happened since you last installed grub.

update-grub will regenerate the grub.cfg (grub2). Every time the kernel updates, update-grub gets run. One advantage of grub is that you don't need to reinstall it to the MBR with every kernel update like you do with lilo, but it does on occasion need to be reinstalled to the MBR. If only to avoid bit rot.

Grub seems to keep the UUID of / in the MBR, with symptoms of using a wrong/old UUID from /etc/fstab if you installed grub before creating / fixing /etc/fstab. So if you did something unusual like use tune2fs to change the UUID and changed /etc/fstab, you'll need to reinstall grub. Or forever be doomed to manually edit /boot/grub/grub.cfg with every kernel update.
 
  


Reply

Tags
boot from hd, grub 2


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
PC not booting automatically pommeldier Linux - General 2 02-07-2013 05:23 PM
Starting C application automatically after booting nitinmhetre Linux - Newbie 1 01-04-2007 03:06 AM
Booting linux without having X start automatically Vulnix Linux - Hardware 4 12-15-2005 05:10 PM
starting apache automatically upon booting zoso *BSD 4 02-14-2005 09:01 PM
automatically startup a program after booting? caicai Linux - Software 7 08-12-2004 07:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:04 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
Open Source Consulting | Domain Registration