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

Ubuntu磁盘空间显示异常求助:Disk Usage Analyzer与lsblk结果不一致

Ubuntu磁盘空间显示异常求助:Disk Usage Analyzer与lsblk结果不一致

Hey there! Let's tackle this confusing disk space mismatch you're seeing. You've got a 500GB SSD, but Disk Usage Analyzer is only showing 141.9GB, while lsblk correctly recognizes the full size. Let's start by looking at the command outputs you shared:

df -h Results

Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
tmpfs              1,5G     26M  1,5G   2% /run
/dev/nvme0n1p2     468G    433G   12G  98% /
tmpfs              7,5G     78M  7,4G   2% /dev/shm
tmpfs              5,0M     12K  5,0M   1% /run/lock
efivarfs           128K     23K  101K  19% /sys/firmware/efi/efivars
/dev/nvme0n1p1     1,1G    6,2M  1,1G   1% /boot/efi
tmpfs              1,5G    140K  1,5G   1% /run/user/1000

lsblk Results

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0     4K  1 loop /snap/bare/5
loop1         7:1    0  98,1M  1 loop /snap/bitwarden/120
loop2         7:2    0  35,2M  1 loop /snap/cheese/40
loop3         7:3    0  55,7M  1 loop /snap/core18/2829
loop4         7:4    0  55,4M  1 loop /snap/core18/2846
loop5 ...

First off, notice that df -h shows your main root partition (/dev/nvme0n1p2) is actually 468GB total (which makes sense for a 500GB SSD, accounting for the EFI partition and filesystem overhead) and it's 98% full. That means the Disk Usage Analyzer is probably missing a lot of space usage—here's how to fix that:

  • Refresh Disk Usage Analyzer's data: Sometimes the tool caches outdated info. Close it completely, run sudo updatedb in the terminal to refresh the system's file index, then reopen the analyzer and rescan your disk.
  • Show hidden/system files: By default, Disk Usage Analyzer might not display protected system files or hidden folders. Head to its settings (look for a menu icon in the top-right corner) and enable options to show these files. This will reveal space used by directories like /root, /var, or hidden folders in your home directory.
  • Identify space-hogging directories: Use the command sudo du -h / --max-depth=1 to list the size of every top-level folder. This will quickly tell you which directory is eating up most of that 433GB used space. For example:
    • If /var is huge, clean old logs in /var/log or clear package caches with sudo apt clean && sudo apt autoremove.
    • If your home directory is the culprit, check for large downloads, unused apps, or backup files you no longer need.
  • Check for filesystem errors: Corruption can cause incorrect space reporting. Boot into Ubuntu's recovery mode, select the fsck option to check and repair your root partition (you'll need to unmount it first if prompted).
  • Verify no partitions are unmounted: While lsblk shows your main partition is mounted at /, double-check that no other partitions on the SSD are unmounted—Disk Usage Analyzer won't scan drives that aren't mounted.

Chances are the 141.9GB the analyzer showed was only your user-facing files, not the entire system. Enabling hidden/system file viewing should resolve that mismatch right away.


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.15 13:13:11