ubuntu - 在U盘上安装Linux系统,存在多个分区如何正确引导?
PHP中文网
PHP中文网 2017-04-17 15:35:50
0
2
957

打算在64GB的U盘上安装一个Ubuntu 16.04 LTS,这样不管走到哪里往电脑里一插就能得到自己最熟悉的坏境,感觉挺方便的,然而在引导启动时却遇到了问题。

以下是分区情况:

  • sdb为U盘设备,MBR分区表

  • sdb1空间为20GB格式化为ext4挂载到/

  • sdb2空间为16GB格式化为ext4挂载到/home

  • sdb3空间为16GB格式化为FAT32以方便接入Windows拷文件,不自动挂载

  • 剩余空间暂时未使用

写好系统后插入电脑选择从U盘启动,却提示Multiple active partitions found(检测到多个活动的分区,原话记不到了,不过意思差不多)。

请问:

  • 像这种在设备上有多个分区的情况,如何正确引导启动存在系统的分区(也就是sdb1)?是否需要类似于GRUB这样的bootloader?

  • 如果使用GUID分区表,GRUB是否应该安装在EFI分区并将EFI挂载到/boot

  • 接上条,我尝试过使用GUID并安装,然而GRUB好像被安装在了我的本地硬盘上的EFI分区(sda1)上。使用它启动U盘上的启动后,sda1也被直接挂载到了/boot,这种情况应该如何解决?

这里Linux新手,很多地方可能都理解得不对,还请多多包涵多多指正,感激不尽!

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
Peter_Zhu

Start process:

Hardware BIOS/UEFI --> Bootloader --> kernel


In this case where there are multiple partitions on the device, how to correctly boot the partition where the system exists (that is, sdb1)? Do I need a bootloader like GRUB?

To put it simply: bootloader mounts the partition /boot where the kernel file is located before the kernel is loaded, finds the kernel file, loads it into memory, and then transfers control to the kernel. The kernel can only operate after being loaded into memory through the bootloader, so a bootloader similar to GRUB is necessary.

To correctly boot a partition that exists in the system, as long as there is a bootloader installed on the computer (no matter which hard drive), the bootloader can find and load the kernel correctly (not necessarily on the same hard drive).

If using GPT partition table, should GRUB be installed on the EFI partition and mount EFI to /boot?

If the GPT/UEFI computer system uses GRUB, part of GRUB should be installed in the fixed directory EFI/boot under the EFI partition (grub-install program is automatically completed). GRUB is started by UEFI when the computer system starts. GRUB Load the kernel, which loads the entire system.

I tried using GPT and installing, however GRUB seems to be installed on the EFI partition (sda1) on my local hard drive. After using it to start the boot on the USB flash drive, sda1 is also directly mounted to /boot. How to solve this situation?

The installation location of GRUB is optional. Generally, you can choose the installation location of GRUB in the final stage of installing GNU/Linux.

All file systems under Linux are organized under /, no matter which hard drive this partition belongs to. As for why the external boot partition is mounted to /boot instead of the system's boot partition, I don't know.

Ty80

Not very familiar with Linux... However, for this kind of U disk system, you should look for a ready-made solution. The corresponding solution for Linux is LiveUSB, and the corresponding solution for Windows is WindowsToGo. In addition, I seem to remember that Windows does not support multiple partitions on USB flash drives, right? Of course, it doesn't matter if yours is a mobile hard drive.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!