9

In setting up a new Time Machine, how can I limit how much disk space Time Machine has access to? I am only interested in answers relevant to Big Sur's change to AFPS for Time Machine.

I have no reason to expect this has changed, other than hearsay this summer. I am asking this question because I cannot find any sources that directly address the issue of limiting Time Machine's size in Big Sur. The change in file format seems like a big enough update that it could change how Time Machine operates.

I am looking for an answer that "definitively" answers how to limit Time Machine in Big Sur. Even if the answer is the same as in Mojave and Catalina, that is still valuable information.

With Time Machine's support of APFS destinations in Big Sur, how can I limit the size of Time Machine data on the external drive?

8
  • I’ve tried to clean this up with a minor edit, but there seem to be a few side questions here deeper than “is this old command effective anymore?” (Which I think the answer is “nope”) . What precisely are you seeking to limit? APFS has copy on write and deduplication and sparse files so the size of a file on disk is not necessarily in any way as direct a link to causing a reduction in usable space on disk as in the past. Even deleted files take space now while they are in a snapshot. Can you sharpen this - perhaps with specific limit you seek to enforce based on specific disk sizes?
    – bmike
    Jan 14 '21 at 11:36
  • Also, if my comment is actually the answer you seek, I could expand on “don’t do that anymore - instead do this”.
    – bmike
    Jan 14 '21 at 11:44
  • In my case a limit is needed as on a shared disk I do not want TM to grow to take it all. When it hits a limit it should delete older backups. I don't need a complete history
    – mmmmmm
    Jan 14 '21 at 12:24
  • @bmike I have no idea what this means: “ APFS has copy on write and deduplication and sparse files”
    – Unrelated
    Jan 14 '21 at 17:55
  • Exactly. Which is why this is more a back and forth to pin down what you are trying to do IMO and not even answerable based on the details.. questions like “teach me a lot about X are hard to do so no judgement, just I’m not even sure I can help you here yet.
    – bmike
    Jan 14 '21 at 18:53
4

Yes it's possible, but not by the Disk Utility, because you can't set a role to your Volume by this way. But the diskutil command by the terminal application do it very well.

For example, i've a Container of 80 Go and i want create a Time Machine volume how will not exceed 20 Go :

xxxxxxx ~ % diskutil ap list disk4

|
+-- Container disk4 8C53B410-FC36-4221-9F13-F528C24CA4EC
    ====================================================
    APFS Container Reference:     disk4
    Size (Capacity Ceiling):      80000000000 B (80.0 GB)
    Capacity In Use By Volumes:   121966592 B (122.0 MB) (0.2% used)
    Capacity Not Allocated:       79878033408 B (79.9 GB) (99.8% free)
    |
    +-< Physical Store disk3s5 D6E20B9A-34FF-462E-8AEE-5648523C1E5D
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk3s5
    |   Size:                       80000000000 B (80.0 GB)
    |
    +-> No Volumes

In the following command

APFSX is for the APFS Case-sensitive format (for the saves TM)

-quota 20g limits growth to 20 Go for this volume

-role T indicate that the volume is a "Backup TM"

xxxxxxx ~ % diskutil ap addvolume disk4 APFSX Time_Machine_BS -quota 20g -role T

Will export new APFS (Case-sensitive) Volume "Time_Machine_BS" from APFS Container Reference disk4 with a 20000000000-byte quota
Started APFS operation on disk4
Preparing to add APFS Volume to APFS Container disk4
Creating APFS Volume
Created new APFS Volume disk4s1
Mounting APFS Volume
Setting volume permissions
Disk from APFS operation: disk4s1
Finished APFS operation on disk4

Then

xxxxxxx ~ % diskutil ap list disk4

|
+-- Container disk4 8C53B410-FC36-4221-9F13-F528C24CA4EC
    ====================================================
    APFS Container Reference:     disk4
    Size (Capacity Ceiling):      80000000000 B (80.0 GB)
    Capacity In Use By Volumes:   122675200 B (122.7 MB) (0.2% used)
    Capacity Not Allocated:       79877324800 B (79.9 GB) (99.8% free)
    |
    +-< Physical Store disk3s5 D6E20B9A-34FF-462E-8AEE-5648523C1E5D
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk3s5
    |   Size:                       80000000000 B (80.0 GB)
    |
    +-> Volume disk4s1 8E6FC6CF-149A-4A8C-BD4E-228953A8C07F
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk4s1 (Backup)
        Name:                      Time_Machine_BS (Case-sensitive)
        Mount Point:               /Volumes/Time_Machine_BS
        Capacity Consumed:         704512 B (704.5 KB)
        Capacity Reserve:          None
        Capacity Quota:            20000002048 B (20.0 GB) (0.0% reached)
        Sealed:                    No
        FileVault:                 No

If there is no volume selected for Time Machine saves, immediately TM proposes to use this volume.

After the first save (small because i'm on a test Big Sur install) the result is :

xxxxxxx ~ % diskutil ap list disk4

|
+-- Container disk4 8C53B410-FC36-4221-9F13-F528C24CA4EC
    ====================================================
    APFS Container Reference:     disk4
    Size (Capacity Ceiling):      80000000000 B (80.0 GB)
    Capacity In Use By Volumes:   6738415616 B (6.7 GB) (8.4% used)
    Capacity Not Allocated:       73261584384 B (73.3 GB) (91.6% free)
    |
    +-< Physical Store disk3s5 D6E20B9A-34FF-462E-8AEE-5648523C1E5D
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk3s5
    |   Size:                       80000000000 B (80.0 GB)
    |
    +-> Volume disk4s1 8E6FC6CF-149A-4A8C-BD4E-228953A8C07F
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk4s1 (Backup)
        Name:                      Time_Machine_BS (Case-sensitive)
        Mount Point:               /Volumes/Time_Machine_BS
        Capacity Consumed:         6616440832 B (6.6 GB)
        Capacity Reserve:          None
        Capacity Quota:            20000002048 B (20.0 GB) (33.1% reached)
        Sealed:                    No
        FileVault:                 No

The limitation is that it's impossible, to my knowledge, to modify the quota without suppress and re-create the TM volume.

0

The answer you linked to of setting an APFS volume quota is the only strategy I've found.

Note that this is not partitioning the drive, but rather a volume within an APFS container. The APFS container is the partition on the disk, then within are APFS volumes which can be added and removed at will.

Disk space is shared between APFS volumes on a container, so you can create a new volume within a container and move files from one volume to another without needing double the disk usage. As files are moved from one volume to another, the total size of files in the container does not increase, as one volume gets smaller at the same time as the other volume gets larger.

This makes it very easy to move your Time Machine backup to a new APFS volume with a quota set, within the same APFS container. No disk partitioning required.

1
  • 1
    Problem is when I did this - I set the quota in Disk Utility and it showed. Then when I chose that volume in Time Machine it redid the quota back to the whole diak (I have other volumes which do keep the quota)
    – mmmmmm
    Jan 13 '21 at 23:51
0

Apple still supports HFS+ Destination disks so the old method will still work on Big Sur. With macOS 11 you are correct that APFS is preferred and Apple explicitly shows how to split an APFS disk so that not all the disk is used for backup space.

Note: The entire APFS disk is reserved for Time Machine backups. If you want to store files other than the Time Machine backup on the same physical device, use Disk Utility to create an additional APFS volume on the disk. The two volumes then share the available space.

In the above linked pay attention to the two fields - reserve and quota:

If you want to manually manage APFS volume allocation, click Size Options, enter values in the fields, then click OK.

  • Reserve Size: The optional reserve size ensures that the amount of storage remains available for this volume.
  • Quota Size: The optional quota size limits how much storage the volume can allocate.

You could reserve 100 GB so that no other container deprives your backup space of a minimum of 100 GB and you could also or just add a Quota of 500 GB to make sure your Time Machine volume never consumes more than 500 GB of space from the shared container.

3
  • 1
    Yes I have done that but..... The issue is that that is two different documents both are individually correct. The problem that exists is that setting up a Time Machine removes the quota from the Time Machine volume. Yes if you have one and only one other volume you can set its Reserve Size and hope that stops the TM
    – mmmmmm
    Jan 14 '21 at 20:16
  • I’ll see if I can reproduce that @mmmmmm if so I’ll certainly file a bug. Seems reasonable for quotas to not get removed. I personally always have two drives for Time Machine so the idea of a quota isn’t helpful to me, but I can see how you and others really depend on it.
    – bmike
    Jan 14 '21 at 21:31
  • Oh I might have two drives - they are just so much bigger than the SSD
    – mmmmmm
    Jan 14 '21 at 22:51
0
+25

You can use the same strategy you would use with any of the other drive formats, namely creating a new partition.

Create a new APFS partition (aka container) with a single volume (as opposed to creating a new volume within an existing APFS container.) Time Machine will expand the volume such that it uses the entire container, but it cannot use any space not belonging to the container in which its volume resides.

-1

I tend to prefer sparsebundles for TimeMachine backups, because they are more flexible. For instance, they can be encrypted without having to encrypt the entire partition or use them on a USB drive and later copy them to a NAS server. Also they can reside on drives with different file systems, such as exFAT.

Sparsebundle images can be limited in size or resized easily, as discussed here for example. That means you can use Disk Utility (click on Images > Resize) or the Terminal:

hdiutil resize -size 30g ~/Documents/filename.sparsebundle
5
  • 1
    Any TM backup can be encrypted, TM even reminds you about this the first time you run a backup on a new disk.
    – nohillside
    Jan 14 '21 at 9:22
  • @nohillside Thanks for the comment, I changed my answer a bit.
    – n1000
    Jan 14 '21 at 9:37
  • I have used Sparsebundles ona NAS - they corrupt every few months
    – mmmmmm
    Jan 14 '21 at 12:22
  • @mmmmmm I have no experience if this occurs more often than on regular backup disks. Normally I make a copy of the empty sparsebundle image at the beginning and keep it around. Once the main image is full or gets corrupted, I archive & replace it.
    – n1000
    Jan 14 '21 at 12:32
  • Not sure of the downvote :( This is a viable method to limit the backup size. It may come with tradeoffs, but I would argue it answers the question. Also, I have been using this method for years and only once had a corrupted sparsebundle.
    – n1000
    Aug 12 '21 at 15:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .