linux reboot grub,GrubReboot

GrubReboot

GRUB contains the ability to reboot into a specified OS once. This is useful for people who DualBoot.

Configuration

With GRUB v1

In your /boot/grub/menu.list you need to set "default" to "saved". For example.default saved ## important.

timeout 5

color cyan/blue white/blue

title Debian GNU/Linux, kernel 2.6.18-4-k7

root (hd0,2)

kernel /boot/vmlinuz-2.6.18-4-k7 root=/dev/sda3 ro

initrd /boot/initrd.img-2.6.18-4-k7

title WinXP

root (hd0,0)

makeactive

chainloader +1

Next you need to run grub-install to set up the default change.

With GRUB v2

in your /etc/default/grub GRUB_DEFAULT should be set to saved, for example:# If you change this file, run 'update-grub' afterward to update

# /boot/grub/grub.cfg.

# For full documentation of the options in this file, see:

# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=saved ## important.

GRUB_TIMEOUT=5

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

GRUB_CMDLINE_LINUX=""

Next you need to run update-grub to set up the default change.

grub-set-default

Next you need to specify the default OS for grub to boot. This is the OS booted if we don't use grub-reboot. For this we use the grub-set-default command.

grub-set-default [num]

Where [num] is the number of a entry in /boot/grub/menu.lst or /boot/grub/grub.cfg

To set the first OS (Debian in example) as the default rungrub-set-default 0

Usage

We can use the grub-reboot command to select the OS we want to boot only once.grub-reboot [num]

Where [num] is the number of a entry in /boot/grub/menu.lst or /boot/grub/grub.cfg.

For example:grub-reboot 1

Will select WinXP for the next boot in the example. If we reboot now, WinXP will boot once. The time after that the boot will be again on the default entry.

KDE usage

Kde has a built in implementation of this. To set this up go to Control Center > System Administration > Login Manager > Shutdown > Miscellaneous And set Boot Manager to "Grub"

Now when you go to reboot, at the shutdown screen if you click-hold the mouse over reboot you get a drop down menu where you can select which OS you want to go to.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值