Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed Ubuntu 64-bit 12.04 over Ubuntu 32-bit 32-bit on the same partitions. In my /media directory I have what appear to be duplicate entries. I had found a similar issue on an Ubuntu discussion forum but wanted to make absolute certain that it would okay in my situation.

The suggestion I found was to "sudo rm -r /media/" for each one in question. I'm a relative newbie to Linux and don't want to break anything.

How can I safety remove these extraneous entries without breaking anything?

jdphenix@jdphenix-A770E:~$ ls -l /media
total 42
dr-x------ 2 jdphenix jdphenix  548 Feb  2 15:42 D3C1.0.0
drwx------ 3 jdphenix root     4096 May 18 01:39 linux-data
drwxr-xr-x 3 jdphenix root     4096 May 17 18:43 linux-data_
drwx------ 2 jdphenix root     4096 May 17 19:24 UDF Volume
drwx------ 2 jdphenix root     4096 May 17 19:24 USB
drwx------ 1 jdphenix jdphenix 4096 May 25 03:11 USB_
drwx------ 2 jdphenix root     4096 May 17 19:24 win7-data
drwx------ 1 jdphenix jdphenix 8192 May 25 03:12 win7-data_
drwx------ 1 jdphenix jdphenix 8192 May 25 03:11 win7-os

The entries for linux-data, win7-data, USB and "UDF Volume" are the ones I'm interested in.

jdphenix@jdphenix-A770E:~$ ls -l /media/win7-data
total 0
jdphenix@jdphenix-A770E:~$ ls -l /media/win7-data_
total 840
drwx------ 1 jdphenix jdphenix   4096 May 17 22:57 Boot
-rw------- 1 jdphenix jdphenix 383562 Jul 13  2009 bootmgr
drwx------ 1 jdphenix jdphenix      0 May 17 20:41 boot-sav
-rw------- 1 jdphenix jdphenix   8192 May 17 22:57 BOOTSECT.BAK
drwx------ 1 jdphenix jdphenix  12288 May 21 21:53 Display.Driver
drwx------ 1 jdphenix jdphenix      0 May 21 21:53 Display.Optimus
drwx------ 1 jdphenix jdphenix   4096 May 21 21:53 Display.Update
drwx------ 1 jdphenix jdphenix   4096 May 18 01:16 Documents
drwx------ 1 jdphenix jdphenix   4096 May 22 23:22 Downloads
... 

jdphenix@jdphenix-A770E:~$ ls -l /media/linux-data
total 4
drwxr-xr-x 4 jdphenix jdphenix 4096 May 18 18:56 World of Warcraft
jdphenix@jdphenix-A770E:~$ ls -l /media/linux-data_
total 16
drwx------ 2 root root 16384 May 17 18:43 lost+found

jdphenix@jdphenix-A770E:~$ ls -l /media/USB
total 0
jdphenix@jdphenix-A770E:~$ ls -l /media/USB_
total 0
drwx------ 1 jdphenix jdphenix 0 May 18 19:23 $RECYCLE.BIN
drwx------ 1 jdphenix jdphenix 0 May 19 04:11 System Volume Information
jdphenix@jdphenix-A770E:~$ ls -l /media/"UDF Volume"
total 0
share|improve this question
    
I am curious what the commands df -HT and mount return. Usually "directories" in /media are mount points. If that is the case here you want to understand what actually happened before you burn any bridges with rm -r. –  irrational John May 27 '12 at 18:50

1 Answer 1

up vote 1 down vote accepted

You should not use rm -r unless you are sure it is correct to do so. ReMoving something recursively will delete the directory and everything in it, even if it's got real data in it that you need.

/media is where all external drives are mounted automatically. You don't need to make the mount point first.

I suggest that you safely unplug or unmount all external hard drives and then remove all directories that have been made under /media/

Just

sudo rm /media/directory_name

would be safest and easiest.

Chris

share|improve this answer
    
The only time it will be safe to rm /media/ directories would be when they are unmounted, and therefore empty. Don't use the -r option. By the way, is there a reason it is important to get rid of these directories? –  John S Gruber May 27 '12 at 2:23

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.