Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Would running (rm deliberately broken)

sudo r m -rf / 

Wipe out any USB-attached external hard drives being used for time machine backups?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

It might do that much damage - but it isn't a good area for experimentation.

I have seen a machine crippled because someone executed 'rm -fr /' as root - although it was done slightly less directly than shown. Fortunately, it was a brand new machine with no users on it and backups made already. At least they knew the backups worked.

The answer is not completely simple. For a start, you can't remove the mount points of directories leading to them. However, anything underneath a mount point (such as your Time Machine backups) could be removed if the system keeps running long enough. Secondly, it is hard to review what's left over afterwards; there aren't any commands left to let you do much. You'd have to boot off a CD of some sort and then inspect the residue. Thirdly, MacOS X has some settings which prevent even root from modifying some things sometimes - until you've adjusted the extended attributes etc.

But it will do a lot of damage. And you are advised not to try it on a machine where you care about the data on any of the attached disks. Unmount and detach the disks first - at least.

share|improve this answer
    
I was hoping that the command of doom would unmount the hard drives rather than delete the contents. Oh well... –  Andrew Grimm Apr 11 '10 at 5:01

AFAIK when you specify -r with rm it works from the bottom of the hierarchy up, so that the contents of the drives would go before their mount point was deleted.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.