如何在 Fedora 的同时安装 Ubuntu?

如何在 Fedora 的同时安装 Ubuntu?

我目前正在运行 Fedora,并希望双启动 Fedora 和 Ubuntu。我不想替换 Fedora,我想将其保留为我的主要操作系统。但是,当使用 Ubuntu 安装程序时,我只能获得以下选项:“用 Ubuntu 替换 Fedora 版本 20(Heisenbug)”或“其他”。

有没有办法可以同时安装 Ubuntu 而不删除 Fedora?如果可以,因为我希望 Fedora 成为我的主要操作系统,有没有办法让它成为最佳 Grub 选项?

我尝试使用 Gparted 进行分区,但是无法拆分 Fedora 分区。它显示已全部使用,但是我只使用了大约 100GB/500GB。

我正在尝试使用 Live USB 棒安装 Ubuntu 13.10。安装后我将升级到 Ubuntu 14.04,但不想制作新的 Ubuntu Live USB。

fdisk -l:    

Device    Boot     Start       End    Blocks  Id System
/dev/sda1 *         2048   1026047    512000  83 Linux
/dev/sda2        1026048 976773119 487873536  8e Linux LVM


Disk /dev/mapper/fedora-swap: 3.8 GiB, 4043309056 bytes, 7897088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/fedora-root: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/fedora-home: 411.5 GiB, 441848954880 bytes, 862986240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

parted -l:

Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  525MB  524MB  primary  ext4         boot
 2      525MB   500GB  500GB  primary               lvm


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/fedora-home: 442GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  Flags
 1      0.00B  442GB  442GB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/fedora-root: 53.7GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system  Flags
 1      0.00B  53.7GB  53.7GB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/fedora-swap: 4043MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  4043MB  4043MB  linux-swap(v1)

答案1

我认为 Ubuntu(自动化)安装程序无法检测和配置逻辑卷管理器设置。因此,您必须使用 Gparted 或 lvm 工具(例如,从 Fedora 内部或 Ubuntu Live CD 中)来缩小分区并为 Ubuntu 留出一些空间,然后使用“其他”选项来安装 Ubuntu。

当然,Ubuntu 可以安装在逻辑分区中,如果 Gparted 不允许您缩小分区(因为正如您所说,它已被“使用”),这可能是因为即使您从 Live 映像启动,交换分区也会自动安装。

因此,(假设您使用 Ubuntu Live CD 中的 Gparted)

  • 从 LiveCD/USB 启动并单击“尝试 Ubuntu”。
  • 打开 Gparted,然后右键单击交换分区并进行 swapoff。
  • 缩小最大的分区(右键单击并调整大小)并为 Ubuntu 留出一些空间。创建一个新的逻辑分区。
  • 关闭 Gparted 并开始安装。
  • 单击“其他”,您就会看到新创建的分区。
  • 单击那里,然后单击“更改”以使用该分区(创建一个 ext4 文件系统并将其安装在根/上)。

关于你问题的第二部分:

如果是这样,因为我希望 Fedora 成为我的主要操作系统,是否也有办法使其成为最佳 Grub 选项?

安装完成后(没有错误),Ubuntu Grub 将替换磁盘 MBR 中的 Fedora Grub。因此,Ubuntu 将作为 Grub 列表中的主操作系统。为了再次用 Fedora Grub 替换 Ubuntu Grub,您必须在 Fedora 上启动并输入以下命令

sudo grub2-install --recheck /dev/sda 

上述命令将在磁盘的 MBR 中重新安装 Fedora Grub,因此一切都将恢复“正常”(我的意思是您已经拥有它,并且 Fedora 作为 Grub 列表中的第一个操作系统……等等)。

(目前,我无法在这里添加带有图片等的教程式答案。如果有人可以,请随意编辑此答案,使其更好地为每个人服务。)

相关内容