双引导 Fedora 26(已安装)和 Windows 7

双引导 Fedora 26(已安装)和 Windows 7

我已经在 1tb 硬盘上安装了 fedora 26,该硬盘目前使用量不到 100GB,我想将硬盘转换为双启动,并分配给 Windows 7 300GB。我很乐意在 bash 终端中使用parted,但我从未使用过parted(调整大小)命令。我已经备份了数据,并且拥有 Fedora26 Live(安装)闪存驱动器和单独的 Windows 7 安装闪存驱动器。我可以在电脑冷启动期间通过 F12 键使用任一闪存驱动器启动。下面显示的是我打算采取的一般步骤,然后是我的问题。我请求帮助解决这些问题。

脚步

 1. Boot from the Fedora 26 Live installation, leaving the 1tb hard disk 
    unmounted.

 2. Within Fedora 26 Live, use lsblk to determine the device name given to the 
    1tb partition.  Then use parted in a bash terminal to resize this partition.
    Shown below is the parted (print) output of the 1tb partition.

    (parted) print                                                            
    Model: ATA WDC WD10EZEX-00W (scsi)
    Disk /dev/sda: 1000GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: msdos
    Disk Flags: 

    Number  Start   End     Size    Type     File system  Flags
     1      1049kB  1075MB  1074MB  primary  ext4         boot
     2      1075MB  1000GB  999GB   primary               lvm

    Assuming that lsblk indicates that the 1tb partition is assigned to 
    /dev/sdb, I plan to execute the following in a bash terminal

    sudo parted /dev/sdb
    < RESIZE COMMAND GOES HERE >
    quit

 3. Still within Fedora 26 Live, quit parted, re-execute lsblk, and then use
    parted on the 300 gb remaining to create a Windows 7 partition.  Assuming   
    that lsblk now indicates that the 300 gb is assigned to /dev/sdc, I
    will then execute the following in a bash terminal:

    sudo parted /dev/sdc
    mklabel msdos
    mkpart primary ntfs 1MiB 100%
    quit

 4. Power off and then cold boot with the Windows 7 installation flashdrive.
    During the installation, select the 300gb (unformatted) partition.

 5. SOMEHOW, install grub on the 1tb hard disk.  My intention is that when I
    hit F12 during a cold boot and select the 1tb hard disk, grub will then 
    present the option to boot into either Fedora 26 or Windows 7.

问题

a.  Are these the right steps to take, in the right order?

b.  In step 2 above, what is the syntax needed for the resize command?

c.  How do I install and configure grub on the 1tb hard disk?

d.  Should I expect the (now 700gb) Fedora 26 environment to be unaffected, 
    except for the reduced space?

e.  (Slightly off topic) Does the 300gb partition need to be pre-formatted, or 
    flagged as bootable, or will the Windows 7 installation flashdrive handle
    this?

答案1

A。它们很复杂,但我认为除了我要提到的问题之外它应该有效。

b. resizepart。这是一个交互式命令。只需指定分区号和新大小即可。不过,我更喜欢使用gparted而不是parted我自己。

C。在实时启动的 Fedora 中,以 root 身份运行

grub2-install /dev/sda

或者如果您愿意的话可以替换/dev/sda/dev/sda1,但我自己从未尝试过,/dev/sda1所以使用它需要您自担风险。

d.如果gparted工作正常,你应该这样做。理论上parted应该resizepart可行,但我自己没有尝试过

e.您可以将其保留为未格式化,并且不需要将其标记为可启动。

加上对第五步的评论:grub 菜单不会自动更新,您需要运行grub2-mkconfig > /boot/grub2/grub.cfg来更新菜单。

然而,根据我的经验,更可能发生的情况是 MBR 被 Windows 覆盖,您可能必须调用该grub2-install命令才能恢复漂亮的 grub 菜单。

免责声明:这些都是基于我的个人经验。我已经多次经历过这个过程,但这并不能保证它在您的情况下不会出现进一步的问题。

答案2

你的方法听起来很有道理,但是很复杂。失败的概率很高。
您需要对数据进行完整备份,并且 Fedora 即将升级到 27。重新分区硬盘并从头开始安装可能会更快更容易 - 首先是 Windows,然后是 Fedora 27。Fedora 安装将为grub您配置。

相关内容