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

8GB硬盘安装Ubuntu时,根分区、/usr及/usr/local分区大小设置咨询

Partitioning 8GB Drive for Ubuntu: /, /usr, and /usr/local Sizing

Hey there! I’ve tackled a few tight Ubuntu installs on small drives before, so let’s break down the best way to split your 8GB space between /, /usr, and /usr/local—keep in mind, 8GB is well below the official minimum (25GB for a full desktop), so we’ll need to prioritize essentials to make this work smoothly.

Here’s a balanced split that supports a minimal, functional Ubuntu setup:

  • Root (/): 2.5–3GB
    • This holds system configs, boot files, temporary data, and your user home folders (we can’t spare space for a separate /home partition here). 2.5GB is the absolute bare minimum to handle updates and basic system logs; 3GB gives a small buffer to avoid unexpected "disk full" errors.
  • /usr: 4–4.5GB
    • /usr houses most of Ubuntu’s core software, libraries, and pre-built binaries. A default minimal install takes ~3–3.5GB here, so 4–4.5GB leaves room for a few extra tools (like a lightweight browser or code editor) and minor system updates without hitting capacity limits.
  • /usr/local: 500MB–1GB
    • This partition is for software you compile from source or install manually (outside the apt package manager). If you only plan to add a couple of custom tools, 500MB is sufficient. If you do frequent source builds, bump it to 1GB—but keep an eye on the total space used across all partitions.

Pro Tips to Make This Work

  • Skip a dedicated swap partition (if you have ≥4GB RAM): Swap eats up precious space. Instead, create a flexible swap file after installation with these commands:
    sudo fallocate -l 1G /swapfile
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile
    
    This lets you adjust the swap size later if needed, without locking up partition space upfront.
  • Opt for the "Minimal Installation": When setting up Ubuntu, choose the minimal option—it skips bloat like LibreOffice, pre-installed games, and media players, saving 2–3GB right off the bat.
  • Clean up regularly: Run sudo apt autoremove && sudo apt clean after updates to delete old package files. You can also enable automatic cleanup in the Software & Updates settings to handle this automatically.
  • Stick to lightweight apps: Use tools like midori (lightweight browser), mousepad (text editor), and pcmanfm (file manager) to avoid filling up space with heavy, resource-hungry software.

If you end up running low on space later, you can resize partitions safely using a Ubuntu live USB—just make sure to back up your data first!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 08:22:42