Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] change GRUB2 boot default from windows/linux
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Mon Oct 26, 2015 6:46 am    Post subject: [Solved] change GRUB2 boot default from windows/linux Reply with quote

I'm connected to distant PC with gentoo via SSH. There are windows too. Grub default boot option is set to windows, so when I reboot PC it boots windows. Is there any way to boot from windows to linux, i.e. e.g. change default boot option from windows? Thanks.

Last edited by DeIM on Sat Oct 31, 2015 7:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9891
Location: almost Mile High in the USA

PostPosted: Tue Oct 27, 2015 6:31 pm    Post subject: Reply with quote

Well, this would be an advantage of installing GRUB on a FAT filesystem, and then Windows could edit that directly. Else you'd have to install some sort of ext2fs or whatever filesystem driver on that machine and then you can use that to edit the grub configuration.

Another possibility if you have a hex editor and search for the file and edit the file that way...very carefully...

You may be SOL, especially if the editing fails and you don't have some sort of remote management hardware...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Thu Oct 29, 2015 12:44 pm    Post subject: Reply with quote

Maybe setting default grub boot option will be more easy from gentoo.

I've found command:
Code:
grub2-reboot

But it's not working for me :(
When I set to boot windows:
Code:
grub2-reboot 0

It changes default entry to first entry - windows. But when I reboot it is still set to 0, but default in config is 1 (gentoo). It simply didn't returned to default config before grub2-reboot command.

Is there a bug or am I doing something wrong?
Back to top
View user's profile Send private message
DeIM
Guru
Guru


Joined: 11 Apr 2006
Posts: 443

PostPosted: Sat Oct 31, 2015 7:25 pm    Post subject: Reply with quote

Solved myself:
in /etc/default/grub needs to be GRUB_DEFAULT=saved
then
Code:
grub2-mkconfig -o /boot/grub/grub.cfg

Code:
grub2-set-default 0
grub2-reboot 1

now works :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum