Ubuntu LTS替换Windows 11及D盘挂载为/home/d的磁盘分区与交换分区创建详细步骤咨询
Hey there, I get that the initial answer glossed over the detailed partitioning and swap setup—let's fix that with a step-by-step breakdown, including the kind of interface details you'd get from screenshots. First, critical reminder: back up everything on your D drive (and any important Windows files on C) before touching anything—disk operations can go wrong if you rush!
一、前期准备(快速回顾)
- Make sure you've got your bootable Ubuntu LTS USB ready (using Rufus/Etcher as mentioned)
- Boot into the USB by changing your BIOS/UEFI boot order to prioritize the USB drive
二、手动磁盘分区(替换C盘的Windows 11)
When you reach the "Installation type" screen, do NOT select "Erase disk and install Ubuntu"—we need manual control here. Instead, pick "Something else" and click Continue. You'll see a list of all your disks:
- Your C drive is the 256GB SSD (look for the label or size, it'll have existing Windows partitions like EFI, Recovery, and the main NTFS partition)
- Your D drive is the 1TB HDD (the large NTFS partition with your images/videos)
Step 1: Wipe the C drive's existing partitions
- Select each partition on the 256GB SSD (one by one) and click the "-" button at the bottom to delete them. This will turn the entire SSD into unallocated space.
- Confirm each deletion when prompted—this removes Windows 11 entirely.
Step 2: Create Ubuntu's system partitions on the SSD
We'll create two essential partitions here (EFI and root—since you want to use D drive for /home/d, a separate /home partition isn't necessary):
- EFI System Partition (required for UEFI boot):
- Select the unallocated space on the SSD, click "+"
- Set "Size" to 512MB
- Set "Type for the new partition" to Primary
- Set "Location for the new partition" to Beginning of this space
- Set "Use as" to EFI System Partition
- Click OK
- Root Partition (/) (where Ubuntu system files live):
- Select the remaining unallocated space on the SSD, click "+"
- Set "Size" to the entire remaining space (256GB minus 512MB is more than enough for the system)
- Set "Type for the new partition" to Primary
- Set "Location" to Beginning of this space
- Set "Use as" to Ext4 journaling file system
- Set "Mount point" to / (forward slash)
- Click OK
三、创建交换分区(Swap Memory)
Swap acts as virtual memory—here are two reliable ways to set it up:
Option 1: Dedicated Swap Partition (during installation)
- For faster swap performance, use a small portion of the SSD; if you want to preserve SSD lifespan, use the HDD instead.
- Select unallocated space (either on SSD or HDD), click "+"
- Set "Size" based on your RAM:
- If you have ≤8GB RAM: set swap to 2x your RAM (e.g., 8GB RAM → 16GB swap)
- If you have ≥16GB RAM: set swap to 8GB (or equal to your RAM if you use hibernation)
- Set "Type for the new partition" to Primary
- Set "Location" to Beginning of this space
- Set "Use as" to swap area
- Click OK
Option 2: Swap File (post-installation, more flexible)
If you don't want to create a partition during install, you can set up a swap file after Ubuntu is running:
- Open Terminal (search "Terminal" in the applications menu)
- Create an 8GB swap file (adjust the size as needed):
sudo fallocate -l 8G /swapfile - Restrict access to the swap file for security:
sudo chmod 600 /swapfile - Format the file as swap:
sudo mkswap /swapfile - Enable the swap file immediately:
sudo swapon /swapfile - Make it permanent across reboots by editing the
/etc/fstabfile:
Add this line at the end of the file:sudo nano /etc/fstab
Save the file (press/swapfile none swap sw 0 0Ctrl+O), exit the editor (pressCtrl+X), then reboot to confirm it works.
四、挂载D盘为/home/d(两种方式)
Option 1: Mount During Installation
While still in the "Something else" partitioning screen:
- Select your D drive's NTFS partition (the large one with your existing data)
- Click "Change"
- Set "Use as" to NTFS (do NOT format it—this preserves your files!)
- Set "Mount point" to /home/d
- Click OK
- At the bottom of the partitioning screen, ensure "Device for boot loader installation" is set to your SSD's EFI partition (it'll be labeled as
/dev/sda1or similar, the 512MB partition) - Click "Install Now" and follow the remaining setup steps (timezone, user account, etc.)
Option 2: Mount Post-Installation
If you skipped mounting during install, do this after booting into Ubuntu:
- Open Terminal and find your D drive's UUID (this ensures consistent mounting even if disk labels change):
Look for the line with your 1TB HDD—it will look like:sudo blkid
Copy the UUID string (without the quotes)/dev/sdb1: UUID="abc123-def456-ghi789" TYPE="ntfs" - Create the mount point:
sudo mkdir /home/d - Set permissions so your user can access the drive without sudo:
sudo chown $USER:$USER /home/d - Edit the
/etc/fstabfile to make the mount permanent:
Add this line at the end (replacesudo nano /etc/fstab<UUID>with your copied UUID):UUID=<UUID> /home/d ntfs defaults,uid=$UID,gid=$GID 0 0 - Save and exit the editor, then test the mount to check for errors:
If no errors appear, reboot to confirm the drive mounts automatically.sudo mount -a
五、Final Checks
After rebooting:
- Open Files (the file manager) and you should see
/home/dlisted on the left, with all your D drive's data intact - Verify swap is working: run
sudo swapon --showin Terminal—you should see your swap partition or file listed - Confirm Ubuntu boots correctly from the SSD
备注:内容来源于stack exchange,提问作者Arijit

