I am performing a test migration from old server to new one. Part of the procedure involves cleaning up the old server of any traces of passwords, php scripts and custom configurations while remotely connected.

While connected on ssh, I managed to rename /etc, /var, /root without the system making much of a complaint. Does it mean I am able to shred these directories without dismounting the root file system?

1 Answer 1


You can shred everything while it's mounted. Once you shred the contents of, say, /lib, you're not going to be able to do much else with the machine afterwards, but the existing shred process should be able to keep running no matter what you apply it to. Shredding /etc will stop you logging in again, but the basic tools should keep working in your current session.

Note that shred doesn't necessarily do much for you — it's very filesystem-dependent whether overwriting in that fashion actually masks the old contents, and modern filesystems often do things differently.

  • Thank you. There may still be bits and pieces of data left somewhere for file system that employs journalling. Would it help if I fill the entire disk with zeros after shredding and then shutting down the system to clear the RAM? Aug 24, 2014 at 4:24
  • Yes. Note that shred /dev/sda is also a valid approach, if you're planning to blank the whole thing anyway. Just how useful it is depends on what your threat model is. Someone with physical access and enough time can likely get some old content off regardless. Aug 24, 2014 at 4:32
  • I think the kernel would panic before shred /dev/sda can complete. My intention is to avoid shredding specific folders that are needed to keep the system running. Aug 24, 2014 at 6:37
  • Yeah, I wouldn't do sda with it mounted (or at least not rely on its completion). Zeroing will be pretty much the same, though, just quicker. Aug 24, 2014 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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