Mac operating system and reinstall

I have an iMac that I am getting ready for sale.  Once I return the unit to the beginning
how do I reinstall the OS?  I want to make sure that all of my data is removed.
thanks,
capreol
Richard ChristensenRetired computer technicianAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

serialbandCommented:
How old is it?

If it was purchased before Mountain Line came out, you may need to Use the installer DVD to wipe it.

If it was a more recent purchase or has any of the newer OS X, you can wipe boot into recovery mode and erase the disk, then install a new OS.  If you had also used filevault, then you don't also need to erase the disk or SSD.

  • Restart the Mac
  • Hold
  • Command r
  • Select Disk Utility and erase the disk.
  • Quit Disk Utility
  • Select Reinstall OS X
  • Reinstall

If you didn't use Filevault, then you can still do a "quick" wipe by writing zeros to the disk after you reinstall.

Open Terminal.app and run the following command
cat /dev/zeros >> zerofile ; rm zerofile

That should be sufficient to prevent normal recovery programs from retrieving data.  It will write zeros to the disk until it fills up, then it will remove that file.  It will take a few hours.

If you need it so that governments and dedicated data retrieval won't happen on a spinning hard disk, you will need to run a multipass DoD wipe, but that can take days.  SSDs work differently and I'm not sure a DoD multipass wipe will be useful.  It's best to have enabled Filevault to avoid needing to do a wipe.
Richard ChristensenRetired computer technicianAuthor Commented:
It is about 5 years old.
thanks,
capreol
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
If you truly desire data removed, use the scrub command line tool, to scrub all your user directories... well... except root.

I like scrub as it's free + can generate brutal destruction of files/directories/devices easily. There are many other tools like scrub, if you prefer.

Sequence...

1) Enable root access if it's off + login as root.

2) Run scrub on all /Users/* directories.

3) Run installer (either off download or DVD).

4) Select repartition disk.

5) Install OS.
Eoin OSullivanConsultantCommented:
Richard

Apple provide a fairly simple process to reset your mac to factory condition .. and will not require all the steps which David outlines which are more relevant to other Unix/Linux systems.

There is an excellent step-by-step guide online here - https://www.imore.com/how-to-prepare-mac-for-sale
It covers the pre-format tips to signout and decouple the Mac from your iCloud and Apple device management and other accounts before you begin the erase, reformat and reinstall OSX.

Assuming you've a backup taken .. logged out of all accounts and services the basic process is to power on the Mac while hold down the Command+R keys simultaneously. You're Mac will boot into macOS Recovery mode where you can erase and re-format the drive .. if you're paranoid you can do a secure multi-pass overwrite of the hard drive to purge any trace.  Then you can reinstall OSX from the Internet directly from Apple .. you clearly need a WiFi or Ethernet connection but this is the default method for all macs for many years now since they dropped DVD drives from their devices.

If you don't have Internet access you've be advised to create an external HD with the OSX installer on it .. plenty of tips online on how to do that also.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard ChristensenRetired computer technicianAuthor Commented:
Thanks to all the experts who contributed answers.  Much appreciated.
capreol
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.