在哪里安装 GRUB?

在哪里安装 GRUB?

我正在远程服务器上运行 Ubuntu 14.04。这是唯一安装的操作系统。在重新启动机器之前我需要非常小心,因为 KVM 访问服务器非常棘手。

在 GRUB 更新期间,系统会询问我在哪里安装 GRUB。磁盘上有 Raid1。我不知道我应该去哪里。

这是挂载表:

# mount

/dev/md2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
/dev/md1 on /boot type ext3 (rw)
/dev/md126 on /home type ext4 (rw,noexec,nosuid,nodev)
/dev/md127 on /backup type ext4 (rw,noexec,nosuid,nodev)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)

并且,这是 fdisk 输出:

# fdisk -l

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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: 0x000b5404

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    33556480    16777216+  fd  Linux raid autodetect
/dev/sdb2        33558528    34607104      524288+  fd  Linux raid autodetect
/dev/sdb3        34607105  1094607934   530000415   fd  Linux raid autodetect
/dev/sdb4      1094607935  3907029167  1406210616+   5  Extended
/dev/sdb5      1094607998  2154608764   530000383+  fd  Linux raid autodetect
/dev/sdb6      2154608828  3907029167   876210170   fd  Linux raid autodetect

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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: 0x00044ee7

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    33556480    16777216+  fd  Linux raid autodetect
/dev/sda2        33558528    34607104      524288+  fd  Linux raid autodetect
/dev/sda3        34607105  1094607934   530000415   fd  Linux raid autodetect
/dev/sda4      1094607935  3907029167  1406210616+   5  Extended
/dev/sda5      1094607998  2154608764   530000383+  fd  Linux raid autodetect
/dev/sda6      2154608828  3907029167   876210170   fd  Linux raid autodetect

Disk /dev/md127: 897.1 GB, 897104996352 bytes
2 heads, 4 sectors/track, 219019774 cylinders, total 1752158196 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: 0x00000000

Disk /dev/md127 doesn't contain a valid partition table

Disk /dev/md0: 17.2 GB, 17171349504 bytes
2 heads, 4 sectors/track, 4192224 cylinders, total 33537792 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: 0x00000000

Disk /dev/md0 doesn't contain a valid partition table

Disk /dev/md1: 536 MB, 536543232 bytes
2 heads, 4 sectors/track, 130992 cylinders, total 1047936 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: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md2: 542.6 GB, 542586207232 bytes
2 heads, 4 sectors/track, 132467335 cylinders, total 1059738686 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: 0x00000000

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/md126: 542.6 GB, 542586174976 bytes
2 heads, 4 sectors/track, 132467327 cylinders, total 1059738623 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: 0x00000000

Disk /dev/md126 doesn't contain a valid partition table

答案1

在 VPS 中,您通常不会安装 GRUB。 GRUB 加载内核(除其他外)。如果您有 OpenVZ 或类似环境,则无需加载内核。内核在容器之间共享。您也不会更新内核——事实上,它会受到写保护,免受您的更新影响。

在基于 KVM 的 VPS 中这是另一回事。在这些情况下,您确实会加载内核。您可以通过检查合同或查看 的输出来了解您拥有哪种类型的 VPS uname -a。 OpenVZ 内核通常会向内核版本添加特定字符串,例如 2.6.26-1-openvz-amd64。

也可以看看https://stackoverflow.com/questions/1603351/should-i-choose-kvm-or-openvz-for-my-vps比较两种方法(还有更多,但不太常见)。

PS:这个答案与 VPS 上 GRUB 位置的原始问题相关。相关数据现在在这个答案的评论中。

相关内容