0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ubuntu 26.04で肥大化したストレージを削除する方法

0
Last updated at Posted at 2026-06-10

Ubuntuを長期間使っていると、気付かないうちにストレージが圧迫されていきます。色々調べた結果、意外な盲点だった「Firefox(Snap版)のWebストレージデータ」をピンポイントで特定して削除し、数GB〜数十GBの空き容量を安全に確保できたので手順を共有します。

1. まずは現在の状況と原因の特定

まずは df -h で全体の空き容量を確認します。

df -h

次に、ルート直下でどのディレクトリが容量を大きく占有しているかを調査します。これでどこに原因があるかを絞り込みます。

# ルート直下で容量の大きい上位10個のディレクトリを表示
sudo du -ahx / | sort -rh | head -n 10

2. ターゲットの容量を確認(FirefoxのWebストレージ)

Ubuntu 26.04のFirefoxは「Snap」として管理されています。
YouTubeやSNSなどのWebアプリを見ていると、storage/default というWebストレージ領域に数GB単位のデータが蓄積されます。

Snap版Firefoxのプロファイル名(ランダムな英数字)を自動判別し、該当フォルダのサイズをピンポイントで確認するコマンドがこちらです。

find ~/snap/firefox/common/.mozilla/firefox/ -type d -name "default" -path "*/storage/default" | xargs du -sh 2>/dev/null

実行結果の例:

2.1G    /home/you/snap/firefox/common/.mozilla/firefox/vehpl9g7.default/storage/default

3. Webストレージのゴミを一括削除する

原因が分かったので、このディレクトリの中身を削除します。
※作業前に必ずFirefoxのアプリを完全に終了させてください。

プロファイル名(今回の例では vehpl9g7.default)の部分をご自身の環境のフォルダ名に合わせて実行します。

rm -rf /home/you/snap/firefox/common/.mozilla/firefox/vehpl9g7.default/storage/default/*

4. 削除後の効果確認

削除が完了したら、再度容量を確認します。

df -h

使用量が減り、空き容量が増えていれば成功です!

まとめ

一般的な apt cleanautoremove を試してもあまりストレージが空かなかった方は、ぜひこの Snap版FirefoxのWebストレージ領域 を確認してみてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?