从 Grub 启动到 Windows 一次,然后在下次启动时返回 Ubuntu

从 Grub 启动到 Windows 一次,然后在下次启动时返回 Ubuntu

我在计算机上做了很多远程工作,我的家用电脑有两个操作系统:Ubuntu 和 Windows 7。我希望能够偶尔切换到 Windows,但这是不可能的,因为我以后无法启动回 Ubuntu。

本质上我希望能够启动一次 Windows,然后在下次重启时返回到 Ubuntu,有什么办法吗?

编辑:我目前正在使用 EXT4,我不想恢复到 EXT3。

答案1

在 Ubuntu 中你可以调用grub 重新启动

$ grub-reboot --help
Usage: /usr/sbin/grub-reboot [OPTION] entry
Set the default boot entry for GRUB, for the next boot only.

  -h, --help              print this message and exit
  -v, --version           print the version information and exit
  --root-directory=DIR    expect GRUB images under the directory DIR
                          instead of the root directory

ENTRY is a number or a menu item title.

Report bugs to <[email protected]>.
$ grub-reboot 12

在下次启动时启动到 Grub 选项 12 一次,之后它将恢复为默认值。

第一个条目将是 0。但是,使用名称可能更安全,因为当您更新内核时,grub 菜单列表偶尔会添加新项目。

答案2

这不是对你问题的准确回答,但如果你只是偶尔需要 Windows,你可以考虑在虚拟机中运行它,例如 KVM 或 Virtualbox。这样你就不必重新启动计算机了。

答案3

我能想到的唯一方法是在 Windows 7 下挂载 ubuntu 的启动分区,因此它必须是 ext 3 或 2,然后编辑 grub 启动文件。当你想反过来做的时候也是一样,这更简单。

相关内容