Fedora

雙啟動 fedora 26(已安裝)和 Windows 7

  • December 9, 2017

我已經在一個 1tb 硬碟上安裝了 fedora 26,目前使用不到 100gb,我想將硬碟轉換為雙啟動,為 Windows 7 分配 300gb。我很喜歡在 bash 終端中使用 parted,但我從未使用過 parted (resize) 命令。我已經備份了我的數據,並且我有一個 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?

一種。它們很複雜,但我認為除了我要提到的問題之外,它應該可以工作。

灣。resizepart. 這是一個互動式命令。只需指定分區號和新大小。不過,我更喜歡使用gparted而不是parted我自己。

C。在您實時啟動的 Fedora 中,以 root 身份執行

grub2-install /dev/sda

或者如果您願意,可以替換/dev/sda/dev/sda1,但我從未嘗試過/dev/sda1自己,所以使用它需要您自擔風險。

d。如果gparted工作正常,你應該。parted理論上應該可行,resizepart但我自己沒有嘗試過

e. 您可以將其保留為未格式化,並且不需要將其標記為可啟動。

加上對您的第 5 步的評論:grub 菜單不會自動更新,您需要執行grub2-mkconfig > /boot/grub2/grub.cfg以更新菜單。

但是,根據我的經驗,更有可能發生的是 MBR 被 Windows 覆蓋,您可能必須呼叫該grub2-install命令才能恢復漂亮的 grub 菜單。

免責聲明:這些都是基於我的個人經驗。我已經多次經歷了這個過程,但這並不能保證它會在你的情況下工作而不會出現進一步的問題。

引用自:https://unix.stackexchange.com/questions/409891