Wipeing RAM before shutdown

Discussion in 'MacBook Pro' started by ClassyPhillip, May 15, 2014.

  1. ClassyPhillip macrumors newbie

    May 15, 2014
    I'm trying to figure out a way to wipe my ram before shutting down, it is difficult to explain why, but it has nothing to do with the possibility of a cold boot attack.

    Currently I have a command I run in Terminal before I shutdown my computer

    diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nomount ram://8388608`; diskutil secureErase freespace 1 /Volumes/RAM\ Disk; diskutil unmount /Volumes/RAM\ Disk; purge; sudo shutdown -h now

    This creates a virtual "RAM Disc" and mounts it, after this it passes over the free space of the virtual disc with ones and zeros at random once, then it mounts the disc, purges and then shuts down. Could I improve this command to do more besides doing more passes? Could I make the virtual disc encrypted? Or could I just make a command that passes over the ram once like it does then just shuts down?
  2. Merode macrumors 6502


    Nov 5, 2013
    Warszawa, Poland
    You do realise that RAM is wiped as soon as you power off your Mac because of the way RAM works?
  3. simonsi macrumors 601


    Jan 3, 2014
    To be meaningful I think you would need to code such a routine in firmware, the OS can't do this, assuming you want the actual RAM zeroed out rather than a virtual representation of it.

    What are you trying to achieve?
  4. AndyK macrumors 65816


    Jan 10, 2008
  5. maflynn Moderator


    Staff Member

    May 3, 2009
    No need to worry about wiping ram before a shut down. Information stored in ram needs electricity, turn off the computer you remove the electricity and thus the info. To summarize what others stated. You shut it down, the ram gets wiped.

Share This Page