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

Ubuntu安装故障求助:旧机用U盘作硬盘无法创建swap分区

Troubleshooting Swap Partition Issues When Installing Ubuntu to a USB Drive on an Old 2004 PC

Hey there! Let's walk through what might be tripping you up here—older 2004-era machines have some specific quirks when working with USB drives as "hard drives," so let's break down the most likely issues and fixes:

1. Mismatched Partition Table Type (Most Probable Culprit)

Nearly all 2004 computers use the MBR (msdos) partition table, but if your USB drive was formatted with GPT, the old BIOS might fail to recognize the swap partition entirely. MBR is the only partition table type these legacy systems reliably support.

Fix:

  • Boot into the Ubuntu live environment, open GParted (install it first if needed via sudo apt install gparted).
  • Select your USB drive from the top-right dropdown.
  • Go to Device > Create Partition Table, choose msdos (MBR) from the list, and confirm.
  • Recreate your partitions:
    • A 5GB partition set to Ext4 with mount point /
    • A 5GB partition set to swap area (no mount point needed)
    • Leave the remaining space unallocated for now

2. Swap Partition Wasn't Configured Correctly in the Installer

It's easy to overlook this step when manually partitioning: creating a 5GB partition isn't enough—you have to explicitly tell the installer it's meant for swap.

Fix:

When you reach the "Installation type" screen, select Something else to enter manual partitioning:

  • Find your 5GB unassigned partition, click Change
  • In the popup, set Use as to swap area, then click OK
  • For your 5GB root partition, set Use as to Ext4 journaling file system and Mount point to /
  • Double-check that the "Device for boot loader installation" is set to your USB drive (not the internal hard drive!), then proceed with installation

3. Legacy BIOS Treats USB as Removable Media (Not Fixed Disk)

Some old BIOS firmware sees USB drives as removable storage instead of a fixed hard disk, which can prevent swap from being detected during installation. Here's a workaround:

Fix:

After installing Ubuntu successfully (even if swap wasn't set up):

  1. Boot into your new Ubuntu USB system, open a terminal
  2. Run sudo blkid to find your swap partition's UUID (look for a line labeled TYPE="swap")
  3. Edit the fstab file to add the swap entry:
    sudo nano /etc/fstab
    
  4. Add this line at the bottom (replace YOUR_SWAP_UUID with the actual UUID from step 2):
    UUID=YOUR_SWAP_UUID none swap sw 0 0
    
  5. Save and exit (Ctrl+O, then Ctrl+X), then enable swap with:
    sudo swapon -a
    
  6. Verify it's working with sudo swapon --show

4. Swap Size Quirks on Legacy Systems

While 5GB of swap is reasonable for modern use, some old systems had odd limitations around swap size (especially if your PC only has 512MB-1GB of RAM, common in 2004). If the above steps fail, try reducing the swap partition to 2GB—this matches typical swap-to-RAM ratios from that era and might resolve recognition issues.


内容的提问来源于stack exchange,提问作者Jferg

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 09:47:14