当前位置: 首页>>技术教程>>正文


partitioning – 是否还需要/boot 分区?

,

问题描述

不久前(~ 2004 年)我被告知始终为引导目录创建一个单独的分区。从那以后我一直都有。但是在阅读了一些关于分区问题的问题后,我很好奇。我还需要 /boot 分区吗?

注意:如果有帮助,我是双启动(Win XP 或 7)& Ubuntu 10.04。我还有一个分区(使用 ext2/3),用于在两个操作系统之间共享文件。

最佳方法

如果您不使用 LVM、根卷加密、软件 RAID 等,或者只是将根卷放在没有中间层的 plain-jane 文件系统上,那么您就不需要它。

实际上,启动时最重要的文件是内核映像 ( vmlinuz ) 和 initramfs 映像 ( initrd.img )。如果 GRUB 无需特殊处理即可访问这两个(以及 GRUB 配置文件),则不需要单独的 /boot 卷。

次佳方法

一般来说,除非您处理加密或 RAID,否则您不需要单独的 /boot 分区。

也就是说,我偶尔会发现将单独的 /boot 分区添加为 FAT 分区的用途。这允许您的 dual-boot 系统更改您的 GRUB 配置,因此您可以创建一个批处理文件来关闭窗口并更改默认菜单选项,以便它接下来启动其他内容。大多数人不需要这个,但我有一些需要来回切换的项目,它允许它完全由脚本完成。

第三种方法

This response 可能会回答您的问题:

Generally speaking, you shouldn’t bother with a separate /home or /boot partition unless you’re running multiple Linux distributions at once.

The Ubuntu installers for both the desktop CD and server/alternate CD have the ability to install over an existing system, preserving your home directory (and the local system driectories: /usr/local, /usr/src, and /var/local). This functionality also reuses the user ID and group ID of an existing user, if it has the same username as the user you’re creating during installation.

To use this option when installing, choose the option for advanced partitioning, then select your existing / or /home partition. In the box that appears, make sure the filesystem selected matches the existing filesystem of that partition, and that the format box is not checked. Proceed as normal through the rest of the options.

In Ubuntu 10.10 we had hoped to add an option to the installer that detected when you had an existing copy of Ubuntu installed and offered to replace it with the newer version you were attempting to install (using the aforementioned functionality behind the scenes). While it did not make the final cut, it is likely to arrive in Ubuntu 11.04.

As for a separate /boot partition, that’s a relic of hardware constraints of the past (the bootloader 1024 cylinder limit). I can think of no practical advantage a separate /boot would have on a modern system, and if not given an arguably excessive amount of space, it will potentially fill up and create problems of its own, given that Ubuntu does not automatically remove old kernels.

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/12069.html,未经允许,请勿转载。