1

I'm planning a clean install of my MacBook Pro with OS X 10.6 and I want to make a partition (among others) only for the sleepimage file.

Here's the problem: the partition's size.

I know that this file is exactly the same of my RAM amount: 4 GB.

However the Finder's "Show information" panel says that it's arount 4.3 GB! Which one do I have to trust to?

And if it isn't enough, I know that each partition retains a 10% of its size (even if it's tunable in a second moment with tunefs); so I'm able to use (by default) only up to 90% of it.

I'm not expert enough to know if the HFS+ journaled filesystem will place any additional (hidden) file, but I suppose that I'm on the right way… can you tell me something more?

I really appreciate any help you can provide.

3
  • 1
    This seems like a really bad idea. Why are you trying to do this? And are you aware of what'll be necessary to get it to work (e.g. you not only have to get the OS to store the sleepimage on another partition, you also have to get the booter to load it from that location...) Jun 3 '13 at 18:00
  • I can think of no good reason to try to give the sleep image it's own partition. It's using temp space that the system periodically reclaims... I think you are more likely to cause yourself a headache doing this, then fix any perceived 'problem' you have.
    – demure
    Jun 3 '13 at 18:07
  • A 4 GB (up to 8 GB if I increase the RAM) file is likely to became highly fragmented and a partition won't only reduce fragmentation, but also reduce the hard disk's physical movement performing a faster I/O operation when I need to use that file.
    – dezzeus
    Jun 3 '13 at 18:44
3

The sleep image file gets created to store the contents of RAM, so you should be able to make things fit by checking the math carefully.

So, once you've made sure you don't have errors in powers of 2, you can make a small allowance for the filesystem overhead and try using a partition to store this one file. You will want to also consider that the OS will take control of this file on a very low level and perhaps cause the file to be written to the root filesystem even if you take pains to properly mount the auxiliary filesystem. Also, since swap files get written to this same directory, your plan might cause unintended consequences, so be sure you have a good backup and can recover any file should the machine run out of space for /private/var/vm and freeze out whatever app you have running.

4
  • Did you know wich power (2 or 10) Disk utility use when I set the partition size ? P.S.: Swap files will be placed into another (and outer) partition ;) I've also read that I can "tweak" the path by using the wait4path shell command. :)
    – dezzeus
    Jun 3 '13 at 18:57
  • Finder and Disk Utility use power of 2 (so that a 200 GB drive shows up as containing less space than expected).
    – bmike
    Jun 3 '13 at 18:59
  • But the link you posted says: "In Mac OS X v10.6 Snow Leopard and later, storage capacity is displayed […] using the decimal system (base 10).[…]"; so… are you sure?
    – dezzeus
    Jun 3 '13 at 19:08
  • If you want precise control, you can also use diskutil partitionDisk or diskutil resizeVolume to fine tune allocations down to individual 512 byte blocks for most drive sizes and partition schemes.
    – bmike
    Jun 3 '13 at 20:22

You must log in to answer this question.

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