Ubuntu安装故障求助:旧机用U盘作硬盘无法创建swap分区
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 viasudo 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
Ext4with mount point/ - A 5GB partition set to
swap area(no mount point needed) - Leave the remaining space unallocated for now
- A 5GB partition set to
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 systemand 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):
- Boot into your new Ubuntu USB system, open a terminal
- Run
sudo blkidto find your swap partition's UUID (look for a line labeledTYPE="swap") - Edit the fstab file to add the swap entry:
sudo nano /etc/fstab - Add this line at the bottom (replace
YOUR_SWAP_UUIDwith the actual UUID from step 2):UUID=YOUR_SWAP_UUID none swap sw 0 0 - Save and exit (Ctrl+O, then Ctrl+X), then enable swap with:
sudo swapon -a - 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

