# How necessary is it to reserve 15% disk space?



## Viro (Feb 19, 2005)

I read the thread at http://www.macfixitforums.com/php/s...570808&page=0&view=collapsed&sb=5&o=7&fpart=1

It seems to be written by someone who works at Micromat and he/she claims that you need to reserve 15% of your disk space free or else your disks might get corrupted.

I've never heard of such a thing with other file systems and it instantly makes me suspicious that HFS+ would be so ... unreliable. Anyone know how reliable this information or if there are any official documents from Apple that support this claim? 15% of my hard drive is 9 GB which is a *lot* of wasted space.


----------



## HateEternal (Feb 19, 2005)

I have heard a few different sizes, I think I have a MacWorld somewhere that says 8%. The only thing I can think that this would be used for is swap/vm space.


----------



## Ceroc Addict (Feb 19, 2005)

Definitely necessary to keep some space free (at least 5+ GB) if you do want to burn DVDs.

Kap


----------



## chevy (Feb 19, 2005)

Yes, a few GB is useful for temporary data your system is generating. It is not a question of % but an absolute value. And the 5GB are of course needed to burn a 4.7 GB DVD !!!

The more programs you open at the same time, the more free space you need.


----------



## Viro (Feb 19, 2005)

That's all fine and helpful, but how much space is necessary? 2x RAM? 8% hard drive capacity? 15%? I've got so many different responses and I'd like to know which is accurate.

Btw, I don't burn DVDs so I don't need 4.7 GB free, thankfully.


----------



## chevy (Feb 19, 2005)

In this case, as long as you stay above 1 GB you should be ok. But this depends on the software you use... as the programs are the ones who reserve size for virtual memory. You can check your memory usage with the Activity Monitor (in Utilities folder). Right now I have 4.7 GB of virtual memory open, 700 MB for the system, 400 MB for Firefox, 200 MB for the windows server, 12 other thread use between 100 MB and 200 MB each (System server, Skype, Finder, Mail, Safari, ...). If you have less HD available, virtual memory will be reduced and data will need to be created again more often (the nice rotation beach ball, you know...).


----------



## scruffy (Feb 19, 2005)

2 or 3x RAM is a good place to start.  Depending on what programs you use, that might be enough or not.  If it's not, you'll get warning messages that you're starting to run out of disk space.

Master of Orion 3 burns through swap space like there's no tomorrow...


----------



## adambyte (Feb 20, 2005)

I'd keep at least 5GB free at all times, just to be safe.


----------



## mdnky (Feb 20, 2005)

Personally, I keep at least 25% free.  The number you pick, of course, would depend on your HD/system config and the stuff/apps you run, but I'm figuring on a 40GB one with the iBook.  25% or more free, the iBook runs great.  Slightly slower down to 15% or so, then anything less and it slows down noticeably.


----------



## RacerX (Feb 20, 2005)

Viro said:
			
		

> I've never heard of such a thing with other file systems and it instantly makes me suspicious that HFS+ would be so ... unreliable. Anyone know how reliable this information or if there are any official documents from Apple that support this claim? 15% of my hard drive is 9 GB which is a *lot* of wasted space.


That is a very real safety limit. And what is worse, I've seen (and had to repair) the damage caused by not following that limit.

It is a soft limit though. You can run at less than 15%, but I wouldn't do it for very long. And if you are running at less than 5% I would suggest making sure you have your data backed up.

The types of problems that come from this are in the HFS catalog section of the disk. They can make a disk unmountable or even strip away the hierarchal file system (basically explode all the folders so all your files are on the root level of the drive).

It is not fun to clean up, and you may need expert help in salvaging the info on the disk. At any rate, reformatting is the only real way to bring the disk back to a completely usable state.

As for how long this 15% free space limit has been around, it has been well known in the Mac service community for years (I first heard about it in 2000). My first experience with it came in 2001 with an AppleShare IP system that was running at over 97% full for a few weeks. As it had exploded tons of flight checked QuarkXPress project folders on an 80 GB drive, most of those folders were never put back together.


----------



## Randman (Feb 21, 2005)

With the price of external HDs so low (and dropping each day), space shouldn't really ber a problem.
  After ram, I'd say the second-most important aftermarket purchase should be an external for backups and saving space. (iPods are also good for this).


----------



## Viro (Feb 21, 2005)

Great..... so the danger is real. My 60 GB drive has about 21 GB free at the moment so the danger isn't imminent. However, if I were to add more stuff to my machine, I'll need more space since in reality if we took into account the 'safety limit' I actually have about 12 GB free!

Looks like I have to look into buying one of those 100 GB laptop drives. Or move to another OS that doesn't use such a bad FS .


----------



## Randman (Feb 21, 2005)

Again, why not get an external?


----------



## Viro (Feb 21, 2005)

Because that'll mean I need to lug an external drive with me. It works most of the time, but then there could be stuff on the external drive that I need but I forgot to bring along if I went to a conference or some far out place.

I've got a 60 GB external drive at the moment, and I'm only using that as a backup solution.


----------



## Randman (Feb 21, 2005)

You have a 60GB drive and you're worried about not having enough room? What are you keeping on it? Video? Music?


----------



## powermac (Feb 21, 2005)

I have never heard of a magic number. Certainly 5GB of space is a safe bet. I keep just what i need on my PB and everything else is on my external. An external drive, in my opinion, is necessary for a laptop owner.


----------



## Viro (Feb 21, 2005)

Randman said:
			
		

> You have a 60GB drive and you're worried about not having enough room? What are you keeping on it? Video? Music?



Well, I've got quite a bit of videos in DV format since it's uncompressed and there aren't any key frames that will just wreck the experiments that I run. This is easily about 10 GB. And it goes up quite quickly when I get new videos, but I can easily store these on external backups. Even so, there's a lot that still needs to be on my laptop when I go to conferences/workshops and demo them.

Then there's my development tools, which include MATLAB, Netbeans and Eclipse, and tonnes of documentation. Adds about 2 GB. Lots more applications that I can't just dump.

Then there are the games . Ideally, I won't want to ditch these as they take a long time to install. 

But yeah, I've got 22 GB free at the moment. But the hard limit means that really have about 13 GB free. Guess I'm just itching to have loads of free space.


----------



## Randman (Feb 21, 2005)

Ah, the games. Now we are getting somewhere. Do you have an iPod? Either store stuff on it, or keep your music on the external (made bootable via CCC) and you can save space.


----------



## Viro (Feb 21, 2005)

Nope. No iPod, but I have an external drive. For now, I'll just move my games to the external drive and run those from there.


----------



## scruffy (Feb 21, 2005)

This is why I would never run OS X as a production server that I relied on to make a living - if the log files can steal my swap space, this is a real problem.

Now, I've never worked with OS X server.  Maybe it has the option to partition things so that, for example, /var/vm and /var/log are on different partitions.  I don't know...


----------



## RacerX (Feb 21, 2005)

scruffy said:
			
		

> This is why I would never run OS X as a production server that I relied on to make a living - if the log files can steal my swap space, this is a real problem.


Curious... the worse case I've seen happened on a system running Mac OS 9 with AppleShare IP 6.3. This is an HFS+ issue and not a Mac OS X issue.

Further, I would never set up a Mac OS X Server system with the OS installed on a partition that was being used for file sharing... that is just asking for problems.

As for the reliability of Mac OS X Server, it is leaps and bounds beyond what I've seen with AppleShare IP and Windows NT servers. 

I have two Mac OS X Server systems (10.2.8) that have been running flawlessly for more than two years in a production environment. Now I know I have a ton more experience with Mac OS X Server than most people, but these systems are running unattended and are completely problem free.

I don't know what kind of work you do for a living, but I highly doubt it would tax Mac OS X Server.


----------



## Viro (Feb 21, 2005)

IMHO, Apple should ditch HFS+ and use UFS. Sure, UFS on OS X is slow, but that's because it's v1 (or something ) instead of V2 as used by FreeBSD. Also, there's ReiserFS that's free and performs very well. It's also B-Tree based so that should make it more similar to HFS+.


----------



## Convert (Feb 21, 2005)

I only have 6GB at the mo.

It's really odd. Everytime I wake up the laptop from it's forced sleep (still won't sleep when I close the lid) it's missing a few GB...


----------



## Mephisto (Feb 21, 2005)

RacerX is it a problem on HFS as well or just HFS+?  Does Apple admit to this problem? Is  the root cause known?  i.e. is it the autodefragging as an example.

It baffles the imagination that a problem of this nature has existed for years without correction or at least a safety net to prevent catastrophic data loss.  I have no reason to doubt it though, a little searching shows that it is a commonly held opinion.  Of course Apple does have a bit of history of ignoring problems in the hopes that they will go away. (iBook mainboard problems, the light spots on the LCD, etc...)


----------



## ElDiabloConCaca (Feb 21, 2005)

Convert said:
			
		

> I only have 6GB at the mo.
> 
> It's really odd. Everytime I wake up the laptop from it's forced sleep (still won't sleep when I close the lid) it's missing a few GB...



I think that's because Macintosh systems that support "deep sleep" operate similarly to Windows' "Hibernate" function -- that is, any data in RAM is written to the hard drive (so if you've got 1GB of RAM, I would assume about 1GB of data is written to disk, presuming all 1GB is being used) and electricity does not flow through certain systems (RAM, processor, etc.).  When you wake up, the data is read back into RAM from the disk, and I don't know if it's erased after that or remains around a while afterward...

Can anyone confirm this?


----------



## Viro (Feb 21, 2005)

Mephisto said:
			
		

> RacerX is it a problem on HFS as well or just HFS+?  Does Apple admit to this problem? Is  the root cause known?  i.e. is it the autodefragging as an example.
> 
> It baffles the imagination that a problem of this nature has existed for years without correction or at least a safety net to prevent catastrophic data loss.  I have no reason to doubt it though, a little searching shows that it is a commonly held opinion.  Of course Apple does have a bit of history of ignoring problems in the hopes that they will go away. (iBook mainboard problems, the light spots on the LCD, etc...)



If you refer to the thread I pointed to at the start of this topic, you'll see that HFS was even worse than HFS+. No idea if Apple thinks this is a problem or not. It definitely is inconvenient and I wish Apple would move to a different filesystem.


----------



## Mephisto (Feb 21, 2005)

I read it yesterday when you first posted it, then did further research to corroborate the statements. I saw the comments to the effect that HFS suffered from the same problems but saw little backing that up elsewhere.  Given the average Apple user's use of voodoo mechanics to diagnose errors I asked someone who seems to have experience and technical ability (RacerX) his opinion.  I do not doubt your technical ability but the fact that you asked the question tends to suggest to me that you have little useful to say in the matter. 

I would rather see Apple correct the problem than dump HFS+.  ReiserFS might be better but that does not mean porting the FS to Mac would not cause new problems.  I have never been fond of dumping a technology just because it has a likely fixable flaw.


----------



## Viro (Feb 22, 2005)

Yeap. I've got very little useful things to say on HFS+ since I've never really had reason to delve too deeply into the underlying kernel of OS X. What makes things more frustrating is the lack of documentation on Apple's part too. So unless someone goes through the Darwin source code, we may never know for certain.


----------



## RacerX (Feb 22, 2005)

Viro said:
			
		

> What makes things more frustrating is the lack of documentation on Apple's part too.


Maybe this will help on the documentation side of things.



			
				Viro said:
			
		

> IMHO, Apple should ditch HFS+ and use UFS. Sure, UFS on OS X is slow, but that's because it's v1 (or something ) instead of V2 as used by FreeBSD. Also, there's ReiserFS that's free and performs very well. It's also B-Tree based so that should make it more similar to HFS+.


The problem is legacy applications. Pretty much anything done using Carbon is going to require HFS+ (that includes the Finder). What is worse is that there is now enough mixing between Carbon and Cocoa that even Cocoa apps have enough Carbon calls to slow them down on anything other than HFS+.

As for the UFS that Apple is currently using, it was developed from NeXT's UFS. There were a number of versions, each different from the previous version. The first Rhapsody systems used a file system that was not compatible with OPENSTEP systems (and the PowerPC version was not compatible with the Intel version). Apple then made another step with the next release of Rhapsody, but hadn't gotten what they wanted (something like HFS+ was what they were aiming for). With the release of Mac OS X Server 1.0 (the first public version of Rhapsody) they ended development of their UFS and turned back to HFS+ with Mac OS X.

I love my Rhapsody systems (as most people know) but UFS (even after all of Apple's work with their version) is no where near as advanced as HFS+. I think Apple made the right choice. In the end the benefits of HFS/HFS+ far out weight the draw backs. 

When discussing this with other consultants, the thing we would like to see Apple add to Mac OS X for now is a space warning when the disk is starting to fill into that danger zone.

Having read the thread that was linked, I would concur with their assessment... keeping in mind that the 15% rule is a soft limit and not a hard barrier.

My main system is short on space, it has two drives, 8 GB and 4 GB, and I have to burn stuff off or move things to my servers regularly. Still, I have a wonderful system that has had a perfect performance record over the last two and a half years. I have not had to do any maintenance on it at all. Yes, I sometimes run short of the 15% limit, but I try to not do it too often or for too long.


----------



## Convert (Feb 22, 2005)

Down to 3GB this morning, now back up to 7GB. Rebooted to get a 'fresh' number, I have 4.13GB apparently. This is bugging me.


----------



## adambyte (Feb 22, 2005)

Viro said:
			
		

> How necessary is it to reserve 15% disk space?



How necessary is it that you have your data?


----------



## Viro (Feb 22, 2005)

adambyte said:
			
		

> How necessary is it that you have your data?



Now now, no need to be cheeky  it turns out that 15% is a soft limit anyway, more like a recommendation than a requirement.


----------



## ElDiabloConCaca (Feb 22, 2005)

Kind of like the speed limit, right?  You can go over it if you like, but you then you'd be out of place to complain when you're stopped and ticketed.


----------



## Natobasso (Feb 22, 2005)

I usually store my files on external drives so I can leave my working/internal drive with as much free space as possible. Seems to make things perform better.


----------



## ex2bot (Feb 22, 2005)

It looks like the solution is to keep the drive defragged, make backups, and leave a reasonable amount of free space.

Doesn't seem unreasonable.

Doug

EDIT: Or get a Windows machine, right Viro?  That'll solve ALL your problems.


----------



## RacerX (Feb 22, 2005)

dktrickey said:
			
		

> It looks like the solution is to keep the drive defragged, make backups, and leave a reasonable amount of free space.


I'd say defragging a drive is a bad idea. HFS+ (and Mac OS X) is designed to have a certain amount of disk fragmentation to protect against file fragmentation. Defrag utilities only care about making the drive _look_ good, your actual files it could care less about.

Yep, if you don't have problems now, defragging is as good a way as any to create some. 

Oddly enough, over the past 6 years the only people I work with who have had file system issues have been those who (against my recommendations) defrag their drives. Could be a coincidence... and then again.


----------



## Natobasso (Feb 22, 2005)

No need to defrag in OS X. That's the beauty of it! Just leave space.


----------



## ElDiabloConCaca (Feb 23, 2005)

I gotta agree with RacerX.  I think more problems than most think are created by being too proactive.  Defragging a drive is useful for media drives, like those used to store/capture large, high-quality video/audio files... access time can be sped up, and in some cases of very high-definition video, is beneficial.

However...

Defragging a system drive is a bad thing in my opinion.  The files that the system accesses aren't in sequential order on the disk drive, but OS X has built-in mechanisms to make sure that commonly used files are located together on the drive ("adaptive hot-clustering").  Defragging the drive screws up that system, leading to possibly decreased performance.  OS X will put the files where it likes them -- fragmented across the drive, if it feels the need.  Defragging the drive just puts the files somewhere else, and OS X starts the whole moving-files-around-the-boot-drive process again.  Why work against the OS?

OS 9 didn't have adaptive hot-clustering (or whatever), so defragging the drive could possibly lead to increased performance.  If you never copied any files or deleted any files, the drive would stay fairly unfragmented for quite a period of time afterward.  Not so in OS X.  Defrag an OS X drive, and you'll find it quickly reverts back to a more fragmented state in a matter of days.

Don't do it, people.  Repair permissions once in a while, repair the disk once in a blue moon, and use quality RAM.  While my experiences may be atypical, I use no anti-virus software, haven't repaired my drive in almost 8 months, repaired permissions only after a software update, reboot only when software updates require it, keep 15GB of a 40GB boot drive free, and I log out when I'm not using the computer (I also let it sleep all night, and run the daily/weekly/monthly cron jobs only about once every two months or so... maybe longer).  No problems, whatsoever, at all.


----------



## scruffy (Feb 23, 2005)

RacerX said:
			
		

> Curious... the worse case I've seen happened on a system running Mac OS 9 with AppleShare IP 6.3. This is an HFS+ issue and not a Mac OS X issue.



No, it's a partitioning scheme issue, completely independent of the filesystem used.

The problem is, swap space exists in the same filesystem as regular files - /var/vm is in the same disk partition as /var/log.  That means an attacker who could cause lots of logfile entries, could eventually cause you to lose that magic 10 or 15 percent of the disk - they could even cause the OS to be unable to allocate more memory, period.

In other Unix OS's, (including FreeBSD, incidentally), the swap space is completely separate from the filesystem space on the disk - it doesn't show up at /var/vm, or anywhere else either.

A typical partitioning scheme will also separate /var from the rest of the filesystem altogether (as /var is given to growing suddenly and unpredictably), an usually /home or /Users or whatever (as users' storage needs always grow and never shrink).

Now, as I mentioned, I don't know what partitioning options Server gives you.  If you can easily designate a separate disk partition to mount at /var/vm, great - no worries.

I'm sure your servers have been working fine for you, and for most or all of the thousands of other people who use OS X Server in production.  That's the thing with security - the problems don't show up at random, they only show up when someone reaches out and _makes_ them show up, which could be tomorrow or never.


----------



## Viro (Feb 24, 2005)

Is there any way to make /var/vm a partition on it's own? I remember on Windows I used to have the swap file on a different partition, and at a fixed size. If I could either a) fix the size of the swap file or b) more the swap file to a different partition, I'm certain this issue will be minimized and I won't have to worry about this 15% hard limit.


----------



## Randman (Feb 24, 2005)

No, no no. Macs aren't peecees and neither are iPods. Partition is almost never needed and can cause more problems than it could potentially cure (less you're a developer or the like).


----------



## Eakster (Feb 24, 2005)

RacerX said:
			
		

> I'd say defragging a drive is a bad idea. HFS+ (and Mac OS X) is designed to have a certain amount of disk fragmentation to protect against file fragmentation. Defrag utilities only care about making the drive _look_ good, your actual files it could care less about.
> 
> Yep, if you don't have problems now, defragging is as good a way as any to create some.
> 
> Oddly enough, over the past 6 years the only people I work with who have had file system issues have been those who (against my recommendations) defrag their drives. Could be a coincidence... and then again.



Yes its my experience too that after a defrag of MacOSX It runs slower and have more problems then before.

I have 2.5 gigs of ram and my swap files still take up up to 3gig+ that I noticed so a 5-10gig free space is a great recommendation


----------



## Viro (Feb 24, 2005)

Randman said:
			
		

> No, no no. Macs aren't peecees and neither are iPods. Partition is almost never needed and can cause more problems than it could potentially cure (less you're a developer or the like).



I develop software. Does that count?  Still doesn't address whether you can use a separate partition for the swap files though.


----------



## elander (Feb 25, 2005)

I ran the swap files on a separate partition in the early OSX-days, and it worked just fine. Didn't make anything faster or slower and didn't damage anything or give any performance enhancements or degradations.

My main gripe with partitions is that it leaves you with less available space, partly because some is wasted in creating the partitions in the first place, and partly because you will have some unused space on one volume, and some on another.

So, if you work with large files, chances are that you would end up with files that could fit in a space equal to the sum total of free space on your two partitions, but not in the free space on one of them, which essentially means you can't save your file anywhere... kind of sucks when you render video...


----------



## Natobasso (Feb 25, 2005)

You have the added drawback of having less space for music or document files, and you have to always remember where you're putting files you save, since you now have TWO user account folder locations, etc.


----------



## scruffy (Feb 25, 2005)

elander - how did you go about doing that?  Did you use different mount points, or symlinks, or what?

No, you shouldn't see any performance changes at all - unless the startup drive starts getting very full, perhaps because some app is malfunctioning and filling up log files.  Then you'd see a pronounced lack of dire trouble, as compared with not partitioning.

True about files not fitting in places - you're giving up some storage space for a little extra robustness.  Probably only a big issue on servers.


----------



## elander (Feb 26, 2005)

I don't remember exactly, but I think it required editing fstab, much like the hint on this page:
http://www.macosxhints.com/article.php?story=20031104150206554&query=swap+partition

As for your assumption on file fitting only a big issue on servers, guess again. Try "really annoying when you edit video/high definition images/audio"...

;-)


----------

