0

How can I reserve an specified amount of space for root on macOS?

I want to stop user applications and myself from unknowingly making the disk full, and always have some free space available.

  • Linux does this on the file system level (5% is reserved for the root user, keeps regular users from filling hard drive and making recovery hard/impossible). Some googling does not return similar information on OS X, HFS+, or APFS... – ivanivan Apr 5 '18 at 15:46
1

The easiest way I can think of would be to actually partition your hard drive (https://support.apple.com/kb/ph5845?locale=hu_HU). Put room for OS X and however much space you always want spare on one partition, then use the other for everything else.

This will require a full reinstall and everything will be erased, so you'd need to ensure everything was backed up. Don't partition your disk unless you know what you're doing.

  • Alternatively, you could probably just write a script that runs once a day scheduled that checks free disk space. I'm not sure how exposed those numbers are on OS X, but I'm sure it's doable. This wouldn't physically block you from using the space, but could at least give you a warning when it's close. To be completely honest, it sounds like you just need a bigger hard drive... – Rathlord Apr 5 '18 at 13:59
  • @Rathlod You can't upgrade Macbook's drives, and I already have the biggest drive they offer without a build-to-order device (512). The script won't work, since I just want to reserve like 500 MB, which can get filled quickly between script runs. Partitioning is too expensive a procedure. This really sucks, since rm doesn't work with a full partition. – HappyFace Apr 6 '18 at 20:36
  • Have they changed something on recent Macbooks? Because I've changed drives on relatively recent Macbooks, and as of last time there were optical drives you could also remove that to put a second HD in... On another track, keeping only 500 MB of free space is going to lead to poor performance, especially in that SSD... you might also consider cloud storage or an external drive for infrequently used files, or that you can keep at your normal workspace. – Rathlord Apr 7 '18 at 22:52
  • Also, can you clarify what you mean by partitioning being too expensive? – Rathlord Apr 7 '18 at 22:53
  • Thanks! Yes, no upgradeability: bgr.com/2016/10/31/macbook-pro-2016-ram-ssd-upgrades – HappyFace Apr 9 '18 at 13:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.