Since timemachine is enabled for Mac, the Mac disk space used for a period of time has been greatly reduced, so du-D1 (disk usage and depth is one) is used) command to view the usage of/directory space, and found that a directory uses 20 GB, this directory is. mobilebackups, in Linux/Unix. by default, files starting with "hide" are hidden. This directory does not exist if timemachine is not enabled.
The mobilebackups directory stores local snapshots of timemachine. The local snapshots on the official website of Apple are described as follows:
OS X lion and later versions of time machine include a feature called "local snapshot. When your backup drive is unavailable, this feature retains copies of the files you create, modify, or delete on the built-in disk.
When your regular backup drive is unavailable, you can create a local backup on the boot disk to supplement the regular Time Machine backup stored on an external disk or time capsule. When you have no external backup disk or time capsule but accidentally deleted a file at hand, this feature provides you with "security protection ". After your general backup drive is restored, time machine copies the local snapshot content from the boot disk to the general backup drive.
On a Mac laptop, When you enable the time machine, the local snapshot is automatically enabled. A daily snapshot is stored every 24 hours, counted from the time you start or restart your computer. Likewise, a weekly snapshot is stored every week. If you want the time machine to stop storing local snapshots, turn on the Time Machine preference settings and slide the switch to the "off" position. When you enable the time machine again, the snapshot is restored.
Does a local snapshot occupy disk space?
Time machine is used to store local snapshots only when a disk has a large amount of available disk space. This means that you can continue to use the available disk space as needed.
If the disk space is insufficient, the time machine stops creating new snapshots. The system may delete some or all of the snapshots to free up space for the application. If you obtain sufficient disk space again, time machine continues to create local snapshots. This means that if time machine is not enabled, the available disk space is the same as the actual size. Time machine uses the following rules to determine whether to stop or delete an existing snapshot.
Under 20% Available disk space |
When the available space of your boot disk does not reach 20% of the total available space, time machine deletes the snapshot from the earliest snapshot. Then it will delete the new snapshot as needed, so as to retain the latest snapshot until the last one is deleted. If the available drive space reaches 20% again later, the time machine stops deleting snapshots. |
10 to 20% Available disk space |
If the available space of your boot disk is less than 10% of the total available space or less than 5 GB, the snapshots are preferentially deleted on the Mac. When the available space is 10%-20% of the total available space, the task of deleting a snapshot still has a normal priority. |
Under 10% Available disk space |
If time machine cannot release enough space to reach the threshold of 10% or 5 GB, time machine deletes all snapshots (only the latest snapshots are retained) and stops creating new snapshots. When the available space exceeds this threshold, the system will create a new snapshot and delete the previous snapshot. |
View available disk space
You can view the space occupied by local snapshots in the "about local machines" window.
- Select "about local computer" from the Apple menu ".
- In the displayed window, click "More information.
- Click the "storage space" tab to view available and used disk space.
The space occupied by the local snapshot is marked as "backup ".
Note: You may notice that the available space data in the disk tool, finder, and display overview checker is inconsistent. Data inconsistency is a normal phenomenon and can be safely ignored. The available disk space displayed in the finder does not include local snapshots, because local snapshots can be used to release disk space as needed.
Set timemachine to automatically back up snapshots to a local device
1 2 3 4 5
|
# Disable automatic backup Sudo tmutil disablelocal
# Enable Automatic Backup Sudo tmutil enablelocal |
After the automatic backup is disabled and mobilebackups is deleted, DF-H (display free disk space in human-readable style) shows the space, increasing by 20 GB.
For more articles, go to xiaopengxuan.
Introduction to mobilebackups under OSX