Ubuntu22.04下为安装Windows11双系统安全分区的方法咨询
Hey there! I’ve helped several users set up dual-boot configurations between Ubuntu and Windows, so I can walk you through the safe steps to free up space on your Ubuntu 22.04 system for Windows 11. Let’s break this down into easy-to-follow steps:
Backup your critical data first (non-negotiable)
No matter how confident you are with disk operations, always back up important files to an external drive or cloud storage before making any partition changes. Disk resizing carries a small risk of data loss, so this step ensures you’re covered if something goes wrong.Use GParted to resize your Ubuntu partition
GParted is the most user-friendly graphical partitioning tool for Ubuntu. Here’s how to use it:- Open a terminal and run
sudo apt update && sudo apt install gpartedto install the tool. - Launch GParted (you’ll need to enter your sudo password) and select your main system disk (usually
/dev/sdafor SATA drives or/dev/nvme0n1for NVMe drives). - Locate your Ubuntu root partition (it’s typically formatted as ext4 with a mount point of
/), right-click it, and choose "Resize/Move". - In the pop-up window, drag the right edge of the partition slider left to free up enough space for Windows 11—Microsoft recommends at least 64GB, but 100GB+ is better for long-term use.
- Click the "Apply" button to start the resizing process. This might take a few minutes; don’t interrupt your laptop during this time.
- Open a terminal and run
Verify the unallocated space
Once resizing is done, you’ll see a block of "Unallocated" space at the end of your disk. This is where Windows 11 will be installed.Prepare a Windows 11 installation USB
Create a bootable Windows 11 USB drive, then restart your laptop and boot from the USB (you’ll need to adjust the boot order in your BIOS/UEFI settings).Install Windows 11 to the unallocated space
When you reach the Windows installation screen, select "Custom: Install Windows only (advanced)". Then select the unallocated space, click "New" to let Windows automatically create the necessary system partitions, and proceed with the installation.Fix the GRUB bootloader
After installing Windows, it will overwrite the bootloader, so you’ll only see the Windows boot option by default. To restore GRUB (which lets you choose between Ubuntu and Windows):- Boot from your Ubuntu installation USB and select "Try Ubuntu".
- Open a terminal and run
sudo fdisk -lto find your Ubuntu root partition (look for the ext4-formatted one, e.g.,/dev/sda2). - Mount the root partition:
sudo mount /dev/sda2 /mnt(replace/dev/sda2with your actual partition path). - Bind essential system directories:
sudo mount --bind /dev /mnt/dev sudo mount --bind /dev/pts /mnt/dev/pts sudo mount --bind /proc /mnt/proc sudo mount --bind /sys /mnt/sys - Switch to the root partition environment:
sudo chroot /mnt. - Install GRUB to your main disk:
sudo grub-install /dev/sda(replace/dev/sdawith your disk path, e.g.,/dev/nvme0n1). - Update GRUB configuration:
sudo update-grub. - Exit the chroot environment and restart:
exit, then remove the USB and reboot. You’ll now see the GRUB menu with options to boot into Ubuntu or Windows 11.
备注:内容来源于stack exchange,提问作者李嘉雷

