LoginSignup
26

More than 5 years have passed since last update.

Macの/lost+found/以下のファイルを調べて必要なければ消してディスクスペースを空ける

Posted at

概要

macのディスクスペースがいっぱいになってきたから消せるものないか調べたら/lost+found/以下に数GBあるファイルがあったので、調べて消した。その手順の共有。

状況

こんな感じだった

$ ls -la /lost+found
total 18824776
drwxrwxrwt@  4 root     wheel         136 Jan  5  2014 .
drwxr-xr-x  34 root     wheel        1224 Aug  1 05:20 ..
-rw-r--r--   1 takc923  staff  5290062380 Jan  5  2014 iNode171581888
-rw-r--r--   1 root     wheel  4348218934 Sep 22  2012 iNode94162499

そもそも/lost+found/とは

Unix系OSでOSが異常終了した時とかにファイルはあるけどどのディレクトリにあったファイルか分からん、ってやつをとりあえずここに置いておく、って言うディレクトリ。

/lost+found/にあるファイルを調べる。

fileコマンドを使う

$ file /lost+found/iNode*
/lost+found/iNode171581888: xar archive - version 1
/lost+found/iNode94162499:  xar archive - version 1

xar圧縮ファイルらしい。
中身を調べる。

$ xar -t -f /lost+found/iNode171581888
Distribution
InstallMacOSX.pkg
InstallMacOSX.pkg/Bom
InstallMacOSX.pkg/Payload
InstallMacOSX.pkg/Scripts
InstallMacOSX.pkg/PackageInfo
InstallMacOSX.pkg/InstallESD.dmg
Resources
Resources/ar.lproj
Resources/ar.lproj/Localizable.strings
Resources/ar.lproj/VolumeCheck.strings
Resources/ca.lproj
Resources/ca.lproj/Localizable.strings
Resources/ca.lproj/VolumeCheck.strings
Resources/cs.lproj
Resources/cs.lproj/Localizable.strings
略
$ xar -t -f /lost+found/iNode94162499
Distribution
InstallMacOSX.pkg
InstallMacOSX.pkg/Bom
InstallMacOSX.pkg/Payload
InstallMacOSX.pkg/Scripts
InstallMacOSX.pkg/PackageInfo
InstallMacOSX.pkg/InstallESD.dmg
Resources
Resources/ar.lproj
Resources/ar.lproj/Localizable.strings
Resources/ar.lproj/VolumeCheck.strings
Resources/ca.lproj
Resources/ca.lproj/Localizable.strings
Resources/ca.lproj/VolumeCheck.strings
Resources/cs.lproj
Resources/cs.lproj/Localizable.strings
略

どちらもOSのインストーラらしい。OS上げて結構経つし消したところで問題なさそう。

いらないファイルをゴミ箱に移す

とは言え念には念を入れて、完全に消す前にゴミ箱に移して復旧出来るようにしておく。
FinderでCommand+Shift+g押して/lost+found/と入力してEnter押して/lost+foundに移動する。
あとは普通に削除する。
これで何日か過ごして問題なさそうなら完全に消す。

参考

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
26