We’ve built a pretty robust media management system over the past few years, more of which we’ll share in a future post. For the purposes of this post, it’s sufficient to know that we archive our completed projects to drive sets. An archive set includes a main drive, which stays at our studio, and a backup of that drive, which lives offsite.

All hard drives are programmed to refresh data as the heads skim along the drive. But that only happens when the hard drive is powered up and operational, but these drives stay powered down more often than not. And why would you care? Well, the reason drives refresh data when they’re running is because the magnetic data stored on the drive fades, or loses it charge, over time causing you to lose all the data on that hard disk. This data can start to disappear as early as a year after the hard disk is powered off. Obviously this is, to say the least, undesirable.

The best way to avoid this from happening is to spin up the drive every so often – but, how would you know when all the data has been refreshed? Our solution is a simple command line technique that reads the entire disk. We perform it on each archive disk once a month.

  • make sure you are logged in as an Administrator
  • open Applications > Utilities > Terminal
  • at the terminal prompt, type: sudo cat /dev/rdisk0> /dev/null (note: there is a space AFTER “sudo,” “cat,” and the “>” sign)
  • replace ‘rdisk0’ with the number of the drive you wish to refresh. To find out the drive number, go into Disk Utility (in your Applications/Utilities directory). You will see all your mounted disks in the left column. This list is indented. It will say something like “232.9 GB Hitachi” and underneath that will be your volume name indented, like “Macintosh HD”. – Click on the top line (the “232.9 GB Hitachi” line in my example) – Click on the Info button – Read the “Disk Identifier” line. It will say something like “disk0″. Where Disk Utility is saying “disk0″ or “disk1″ or “disk2″, … put an “r” in front. This is the name you use in the command (/dev/rdisk0 in this case)
  • hit enter, and there it goes! You can see how fast the read is going by starting Activity Monitor.app (in your Applications/Utilities directory) and select “Disk Activity”. You will see lots of data read but none written.
How does this work?
  • sudo” is a command that says “run the following command with root (administrator) privileges. You need this privilege level to read the disk as if it is one big file (as opposed to reading each individual files).
  • cat” is a command that says copy the following file.
  • /dev/rdisk0” is the name of your primary disk. It is a file name just like a .mov but it happens to represent the entire disk. Since this follows “cat”, this is the file you are copying. (Note the use of the letter “r’ in front of the word “disk”.)
  • > /dev/null” says to copy the file (/dev/disk0) to the file named /dev/null /dev/null is a special type of device. Anything you write to it will be thrown away. It’s like copying things to a black hole.
  • so, essentially, you’re telling your machine to read the entire disk and copy it to nowhere. Simple and effective!
Some other notes…
  • you can cancel the current read by pressing Control+C
  • if you want to time how long it takes to do the read, you can change the command to sudo time cat /dev/rdisk0 > /dev/null When finished, the command will output in seconds how long the read took.

Leave a Reply


Your email address will not be published. Required fields are marked *