You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu LTS替换Windows 11及D盘挂载为/home/d的磁盘分区与交换分区创建详细步骤咨询

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):

  1. 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
  2. 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:

  1. Open Terminal (search "Terminal" in the applications menu)
  2. Create an 8GB swap file (adjust the size as needed):
    sudo fallocate -l 8G /swapfile
    
  3. Restrict access to the swap file for security:
    sudo chmod 600 /swapfile
    
  4. Format the file as swap:
    sudo mkswap /swapfile
    
  5. Enable the swap file immediately:
    sudo swapon /swapfile
    
  6. Make it permanent across reboots by editing the /etc/fstab file:
    sudo nano /etc/fstab
    
    Add this line at the end of the file:
    /swapfile none swap sw 0 0
    
    Save the file (press Ctrl+O), exit the editor (press Ctrl+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/sda1 or 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:

  1. Open Terminal and find your D drive's UUID (this ensures consistent mounting even if disk labels change):
    sudo blkid
    
    Look for the line with your 1TB HDD—it will look like:
    /dev/sdb1: UUID="abc123-def456-ghi789" TYPE="ntfs"
    
    Copy the UUID string (without the quotes)
  2. Create the mount point:
    sudo mkdir /home/d
    
  3. Set permissions so your user can access the drive without sudo:
    sudo chown $USER:$USER /home/d
    
  4. Edit the /etc/fstab file to make the mount permanent:
    sudo nano /etc/fstab
    
    Add this line at the end (replace <UUID> with your copied UUID):
    UUID=<UUID> /home/d ntfs defaults,uid=$UID,gid=$GID 0 0
    
  5. Save and exit the editor, then test the mount to check for errors:
    sudo mount -a
    
    If no errors appear, reboot to confirm the drive mounts automatically.

五、Final Checks

After rebooting:

  • Open Files (the file manager) and you should see /home/d listed on the left, with all your D drive's data intact
  • Verify swap is working: run sudo swapon --show in Terminal—you should see your swap partition or file listed
  • Confirm Ubuntu boots correctly from the SSD

备注:内容来源于stack exchange,提问作者Arijit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.21 13:20:32