Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to clear out an old ubuntu installation on a different partition (sda5). I'm currently running ubuntu from sda1 partition.

  1. Is it safe to do the following (just checking):

root@my-laptop:/media/sda5# rm -R /media

I'm only asking because:

root@my-laptop:/media/sda5# ls -R /media

obviously shows a lot of files referenced in there...


PS: Is there anything that needs saving from that partition??? (I've got the old /home directory on a different partition.) I've heard about some /home encryption files being stored within /var (doesn't apply to me anyway). Are the mysql data there by default? Any other issues?


The question was really about: if I delete the contents of sda5 with rm -R, do the symbolic links to media/ also lead to deleting content on those linked partitions (in the same way as ls -R does give me the files even on the other partition)? I don't think so, but would like to be assured. I.e. the question is not how to delete directories on one partition, but whether this can be done using rm -R without deleting linked content.

share|improve this question

migrated from Sep 26 '10 at 20:23

This question came from our site for professional and enthusiast programmers.

Why aren't you just reformatting the partition? Seems to me like it'd be faster and easier in the long run. – MBraedley Sep 26 '10 at 23:42

It should be safe to remove files WITHIN /media, because they are usually generated when a device is mounted (e.g. inserting a CD-ROM creates /media/cdrom0 in Ubuntu). There may be some folders you created yourself which you will want to keep, but other than that it SHOULD be safe, but take my advice with a pinch of salt - it's an rm command, and you must know the forum rule - be wary around posts containing rm! :)

Hope this helps

share|improve this answer
Actually, I ashamedly went and removed /media via GUI (nautilus), and no problem there... - But I'd rather do it with 'rm' from the terminal in future... – ajo Sep 26 '10 at 20:39
ah ok. If you do encounter problems, just run "sudo mkdir /media" (minus quotes) should you want to re-create it when Ubuntu hasn't for you :) – Bojangles Sep 27 '10 at 17:49

Your Answer


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.