Not strictly a Mac question, so if it’s not appropriate here, just let me know or delete the thread.
That said…. several years ago I installed Ubuntu on an old Macbook. I’ve used it lightly for casual web browsing over the years (works great by the way), nothing involving anything secure (bank, etc.). My collection of old laptops is getting out of control so I’d like to pass the machine along to someone else.
My question is… did the Ubuntu install erase the hard drive sufficiently so that I can safely pass this along? Again, nothing I’ve done with it since the Ubuntu install would be considered a security issue.
No guarantee. If you didn’t explicitly overwrite the entire drive, then it is likely that data still exists in disk blocks not used by any files.
That having been said, you can still wipe it if you want to.
Put the computer into target disk mode. Then connect it to another computer and use your favorite utility to write zeros to every disk block. Then you can install macOS so the new owner will get something usable.
(There have been some news articles about researchers using a magnetic force microscope to see after-images of data after a drive has been wiped, but I’ve never seen a single article about anyone actually recovering data using this technique. So I wouldn’t worry about that.)
If you want to pass it along with the Ubuntu install intact, just bring up a terminal and type
cat /dev/zero > zero.file
sync
rm zero.file
This is likely not 100% guaranteed to wipe everything that a high-stakes adversary might be able to get, particularly if the storage is solid state, but unless you’re protecting state secrets or terrorism plots, this is likely to be quick, easy, and more than sufficient.
Thanks David – Ideally I’d like to pass the machine on with Ubuntu intact. It’s a very old machine and won’t support any recent Mac OS, making it essentially useless without the Linux OS (which works great by the way)
Even easier. If it’s already running Linux, install and use the zerofree utility. It writes zeros to all unused disk blocks on a volume.
In order to do this, however, the file system must be either unmounted or mounted read-only. So boot from a “live CD” Linux image, so you can unmount the volume first. or boot into single user mode - the default boot-loader configuration mounts the root file system as read-only (switching it over to writable later in the boot process, so it will be read-only when booted into single-user mode.
This will work, but it temporarily consumes all space on the drive. So if any processes (maybe in the background) are trying to write to files, it may cause them to fail.
Also, Linux (like all Unixes) reserves a small amount of free space for the system. So you’ll have to do this via sudo or from a root shell.
The first line (cat /dev/zero > zero.file) creates a file (named zero.file) and writes nothing but zeros to it until the drive runs out of free space.
The second line (sync) forces the writes to be flushed to the storage media.