您的Mac是否危险地接近耗尽存储空间?通常,您可以进行一次短暂的磁盘清理狂欢(go on a short disk cleaning spree)并快速释放大量空间。但有时,事情并没有那么简单。
不久前,我们谈到了有些令人费解的“其他”存储(somewhat baffling “Other” storage),它最终会消耗数十甚至数百 GB 的磁盘空间。这一次,我们将关注另一个令人困惑的问题:如何减少Mac上臃肿的“系统”存储。
什么是系统存储?
每当您进入Apple 菜单(menu )>关于本机(About This Mac)>存储(Storage)时,Mac 的内部存储指示器都会将与操作系统相关的数据量显示为“系统”存储。
理想情况下,它应该保持在 20 GB 以下,但您可以预期它会随着您继续使用Mac而缓慢增长。但是,如果它超过了两位数或三位数,那么发生这种情况的最常见原因如下:
- 本地时间机器快照。
- 大型应用程序日志文件。
- 膨胀的应用程序或系统缓存。
- 损坏的 Spotlight 搜索索引。
如果您的Mac有一个非常大的“系统”存储分配,那么下面的指针应该可以帮助您减少它。不要(Don)忘记清除垃圾箱(Trash)并经常检查存储屏幕,因为您正在处理它们。
删除本地时间机器快照
如果您在Mac上启用了Time Machine,您最终可能会得到一大块“系统”存储空间,远远超出通常的大小限制。当操作系统无法从内部存储中清除较旧的Time Machine快照时,就会发生这种情况。(Time Machine)最好使用Terminal检查并删除它们。
注意:(Note:)如果可能,请在连接外部备份驱动器的情况下创建新的Time Machine备份,然后再继续。
1. 前往Finder >应用程序(Applications )>实用程序(Utilities )并打开终端(Terminal)。
2. 键入tmutil listlocalsnapshotdates并按Enter以显示所有本地Time Machine快照及其相关日期标签的列表。
3. 您必须单独删除本地Time Machine快照(从最旧的开始)并检查这是否会减少 Mac存储(Storage)屏幕中的“系统”。
键入tmutil deletelocalsnapshots,后跟快照的日期(date)和名称(name)。然后,按Enter将其删除。
根据需要重复,但避免删除最近的快照。但是,如果您有外部备份驱动器,则可以使用以下命令安全地删除所有这些驱动器:
for snapshot in $(tmutil listlocalsnapshotdates | grep -v :); do sudo tmutil deletelocalsnapshots $snapshot; done
删除应用程序日志文件
如果您使用Mac一段时间,它可能包含大量应用程序日志文件。在某些情况下,这些文件最终可能会消耗数 GB 的存储空间。您可以通过转到Mac(Mac)用户库中的Logs文件夹来检查和删除它们。
1. 打开查找器。然后,选择前往(Go)>前往文件夹(Go to Folder)。
2.输入~/Library/Logs/并按Enter。
3. 检查任何过大的日志文件并将其删除。为了使事情更容易,您可以切换到列表(List )视图(从Finder窗口顶部)并使用大小(Size )列按大小对日志文件进行排序。
删除连接日志文件
(Application)除了应用程序日志,您的Mac还可能包含与(Mac)邮件(Mail)应用程序相关的大量连接日志文件。最好检查并摆脱它们。
1. 打开查找器。然后,选择前往(Go)>前往文件夹(Go to Folder)。
2. 输入以下文件夹路径并按Enter:
~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail
3.删除(Delete)目录内的所有大型连接日志文件。
删除系统和应用程序缓存
Mac上运行的操作系统和各种应用程序都经常缓存大量文件。这有助于加快速度,但有时,应用程序和系统缓存可能会失控并加速“系统”读取。尝试清除所有大文件缓存。
提示:(Tip:)如需完整的演练,请查看如何清除 Mac 缓存(how to clear the Mac cache)。
1. 打开查找器(Finder)。然后,选择前往(Go )>前往文件夹(Go to Folder)。
2.输入~/Library/Caches/并回车(Enter )打开应用程序缓存。
3. 切换到列表视图并使用(List)大小(Size )列对文件和文件夹进行排序。然后,删除目录中的所有超大项目。
注意:(Note: )如果Finder未在(Finder)列表(List)视图中显示文件夹大小,请打开菜单栏上的视图,选择显示(View )视图选项,选中(Show View Options)计算所有大小(Calculate all sizes)旁边的框,然后选择用作默认值(Use as Defaults)。
4. 重新启动您的Mac。如果一切看起来都不错,请清除垃圾箱(Trash)。
5. 重复步骤1 - 4 ,但在步骤(4)2中使用路径/Library/Caches/(打开系统缓存)。
进入/退出安全模式
引导至安全模式有助于删除(Mode)Mac上多余或过时的系统相关文件。为此,首先关闭您的Mac。重新打开电源,但立即按住Shift键,直到看到 Apple 标志。
在您的Mac启动到安全模式(Safe Mode)后,转到Apple 菜单(Apple menu )>关于本机(About This Mac )>存储(Storage)。等待(Wait)几分钟,直到存储指示器完全更新自身。然后,正常重新启动您的Mac,看看是否有帮助。
重建 Spotlight 索引
有时,由于Spotlight 搜索(Spotlight Search)索引损坏,您的Mac可能会显示不正确的“系统”存储读数。(Mac)尝试重建它以帮助减少Mac上的系统存储。
1. 打开Apple 菜单(Apple menu),选择System Preferences,然后选择Spotlight。
2. 切换到隐私(Privacy )选项卡。然后,将系统驱动器从桌面拖放到其中。
注意:(Note:)如果系统驱动器在桌面上不可见,请打开Finder,然后在Finder菜单上选择Preferences 。然后,选中Hard disks(Hard disks)旁边的框。
3. 选择确定(OK )以确认您希望 Spotlight Search停止搜索系统驱动器。
4.稍等(Wait)片刻。然后,选择您刚刚添加的系统驱动器并使用删除(Delete )( — ) 按钮将其删除。
这应该会提示Spotlight Search重新索引系统驱动器。
太复杂?使用玛瑙
如果上述减少Mac系统存储的方法看起来太乏味,请尝试使用Onyx。它是一个完全免费的应用程序,可以快速删除本地Time Machine快照、删除过时的日志文件、清除应用程序和系统缓存以及重建Spotlight索引。
Onyx也可用作垃圾清除工具。如果您经常在Mac上遇到与存储相关的问题,我们强烈建议您使用它。这是完整的 Onyx 演练(complete Onyx walkthrough)。
How to Reduce System Storage on Mac
Is your Mac dangerously close tо running out of storage? Usually, you can go on a short disk cleaning spree and free up a lot of space quickly. But sometimes, it’s just not that simple.
A while back, we talked about the somewhat baffling “Other” storage that can end up consuming tens—if not hundreds—of gigabytes of disk space. This time, we shall focus on another perplexing issue: how to reduce a bloated “System” storage on the Mac.
What Is System Storage?
Whenever you go to Apple menu > About This Mac > Storage, the Mac’s internal storage indicator will display the amount of data related to the operating system as “System” storage.
Ideally, it should stay under 20 gigabytes, but you can expect it to keep growing slowly as you keep using your Mac. If it exceeds that by double or triple-digits, however, then here are the most common reasons why that happens:
- Local Time Machine snapshots.
- Large application log files.
- Bloated application or system cache.
- Broken Spotlight Search index.
If your Mac has a very large “System” storage allocation, the pointers that follow should you help reduce it. Don’t forget to clear the Trash and check the Storage screen frequently as you work your way through them.
Remove Local Time Machine Snapshots
If you have Time Machine enabled on your Mac, you may end up with a chunk of “System” storage well beyond the usual size limits. That happens when the operating system fails to clear older Time Machine snapshots from the internal storage. It’s best to check and get rid of them using Terminal.
Note: If possible, create a fresh Time Machine backup with your external backup drive connected before you go ahead.
1. Go to Finder > Applications > Utilities and open Terminal.
2. Type tmutil listlocalsnapshotdates and press Enter to bring up a list of all local Time Machine snapshots along with their relevant date tags.
3. You must delete the local Time Machine snapshots individually (starting with the oldest) and check if that reduces “System” within your Mac’s Storage screen.
Type tmutil deletelocalsnapshots followed by the date and name of the snapshot. Then, press Enter to delete it.
Repeat as needed, but avoid deleting the most recent snapshots. If you have your external backup drive around, however, you can safely delete all of them with the following command:
for snapshot in $(tmutil listlocalsnapshotdates | grep -v :); do sudo tmutil deletelocalsnapshots $snapshot; done
Delete Application Log Files
If you’ve used your Mac for some time, it may contain lots of application log files. In some cases, these files can end up consuming multiple gigabytes of storage. You can check and delete them by heading over to the Logs folder within the Mac’s user library.
1. Open Finder. Then, select Go > Go to Folder.
2. Type ~/Library/Logs/ and press Enter.
3. Check for any oversized log files and delete them. To make things easier, you can switch to List view (from the top of the Finder window) and use the Size column to sort the log files by size.
Delete Connection Log Files
Application logs aside, your Mac may also contain massive connection log files related to the Mail app. It’s best to check and get rid of them.
1. Open Finder. Then, select Go > Go to Folder.
2. Type the following folder path and press Enter:
~/Library/Containers/com.apple.mail/Data/Library/Logs/Mail
3. Delete any large connection log files inside the directory.
Delete System and Application Cache
Both the operating system and the various applications that run on your Mac frequently cache lots of files. That helps speed things up, but sometimes, the application and the system caches can balloon out of control and ramp up the “System” reading. Try clearing out any large file caches.
Tip: For a complete walkthrough, check how to clear the Mac cache.
1. Open Finder. Then, select Go > Go to Folder.
2. Type ~/Library/Caches/ and press Enter to open the application cache.
3. Switch to List view and sort the files and folders using the Size column. Then, delete any oversized items within the directory.
Note: If Finder doesn’t display folder sizes in List view, open View on the menu bar, select Show View Options, check the box next to Calculate all sizes, and select Use as Defaults.
4. Restart your Mac. If everything looks good, clear the Trash.
5. Repeat steps 1–4, but use the path /Library/Caches/ (which opens the system cache) in step 2 instead.
Enter/Exit Safe Mode
Booting into Safe Mode can help remove redundant or obsolete system-related files on your Mac. To do that, start by turning off your Mac. Power it back on, but immediately press and hold the Shift key until you see the Apple logo.
After your Mac boots into Safe Mode, go to Apple menu > About This Mac > Storage. Wait for a couple of minutes until the storage indicator updates itself completely. Then, restart your Mac normally and see if that helped.
Rebuild Spotlight Index
Sometimes, your Mac may display an incorrect “System” storage reading due to a broken Spotlight Search index. Try rebuilding it to help reduce system storage on Mac.
1. Open the Apple menu, choose System Preferences, and select Spotlight.
2. Switch to the Privacy tab. Then, drag and drop the system drive from your desktop inside it.
Note: If the system drive is not visible on the desktop, open Finder, and select Preferences on the Finder menu. Then, check the box next to Hard disks.
3. Select OK to confirm that you want Spotlight Search to stop searching the system drive.
4. Wait for a moment. Then, select the system drive that you just added and remove it using the Delete ( — ) button.
That should prompt Spotlight Search to re-index the system drive.
Too Complicated? Use Onyx
If the methods above to reduce system storage on your Mac seem too tedious, try using Onyx. It’s a completely free application that can quickly delete local Time Machine snapshots, remove outdated log files, clear the application and system caches, and rebuild the Spotlight index.
Onyx also works as a junk removal tool. If you keep running into storage-related issues on your Mac regularly, we highly recommend that you use it. Here’s a complete Onyx walkthrough.