(SOLVED) Removing un-needed Mountpoints (?)

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Boca
Level 5
Level 5
Posts: 691
Joined: Sun Feb 15, 2015 5:02 am

(SOLVED) Removing un-needed Mountpoints (?)

Post by Boca »

Hi,
within /media, I see various usb sticks which I have used in the past but are no longer connected

Code: Select all

tony@tony-Latitude-E6430 /media $ dir
root  shireusb	tony  usbdrive
tony@tony-Latitude-E6430 /media $ cd usbdrive
tony@tony-Latitude-E6430 /media/usbdrive $ dir
tony@tony-Latitude-E6430 /media/usbdrive $ 
I believe what I am seeing are mountpoints?
I have checked Fstab but cannot see these listed.
Is it safe to remove these and, if so, how do I do this please?

Tony

Code: Select all

tony@tony-Latitude-E6430 /media/usbdrive $ specs
System:    Host: tony-Latitude-E6430 Kernel: 4.15.0-42-generic x86_64 (64 bit gcc: 5.4.0)
           Desktop: MATE 1.18.0 (Gtk 3.18.9-1ubuntu3.3) Distro: Linux Mint 18.3 Sylvia
Machine:   System: Dell (portable) product: Latitude E6430 v: 01
           Mobo: Dell model: 0CPWYR v: A00 Bios: Dell v: A07 date: 10/08/2012
CPU:       Dual core Intel Core i5-3210M (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9966
           clock speeds: max: 3100 MHz 1: 1814 MHz 2: 1604 MHz 3: 1710 MHz 4: 1678 MHz
Graphics:  Card: Intel 3rd Gen Core processor Graphics Controller bus-ID: 00:02.0
           Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa)
           Resolution: 1366x768@60.01hz, 1024x768@60.00hz
           GLX Renderer: Mesa DRI Intel Ivybridge Mobile GLX Version: 3.0 Mesa 17.2.8 Direct Rendering: Yes
Audio:     Card-1 Intel 7 Series/C210 Series Family High Definition Audio Controller
           driver: snd_hda_intel bus-ID: 00:1b.0
           Card-2 Generalplus driver: USB Audio usb-ID: 003-004
           Sound: Advanced Linux Sound Architecture v: k4.15.0-42-generic
Network:   Card-1: Intel 82579LM Gigabit Network Connection driver: e1000e v: 3.2.6-k port: f080 bus-ID: 00:19.0
           IF: eno1 state: up speed: 100 Mbps duplex: full mac: <filter>
           Card-2: Intel Centrino Ultimate-N 6300 driver: iwlwifi bus-ID: 02:00.0
           IF: wlp2s0 state: down mac: <filter>
Drives:    HDD Total Size: 3320.6GB (82.4% used) ID-1: /dev/sda model: TOSHIBA_MK3261GS size: 320.1GB temp: 36C
           ID-2: USB /dev/sdb model: My_Passport_07A8 size: 1000.2GB temp: 0C
           ID-3: USB /dev/sdc model: Elements_25A2 size: 2000.4GB temp: 0C
Partition: ID-1: / size: 282G used: 90G (34%) fs: ext4 dev: /dev/sda1
           ID-2: swap-1 size: 12.75GB used: 0.00GB (0%) fs: swap dev: /dev/sda5
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 53.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 211 Uptime: 4 days Memory: 4674.9/11882.9MB Init: systemd runlevel: 5 Gcc sys: 5.4.0
           Client: Shell (bash 4.3.481) inxi: 2.2.35 
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat

Re: Removing un-needed Mountpoints (?)

Post by WharfRat »

Get yo your /home with cd ~ and sudo rm -r /media/usbdrive

Naturally check to make sure nothing is mounted to it :wink:
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Removing un-needed Mountpoints (?)

Post by Flemur »

WharfRat wrote: Sat Dec 15, 2018 10:18 am Get yo your /home with cd ~ and sudo rm -r /media/usbdrive
Naturally check to make sure nothing is mounted to it :wink:
Would it be safer to

Code: Select all

rmdir /media/usbdrive
because that fails if the directory (mountpoint) isn't empty...?
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mute Ant

Re: Removing un-needed Mountpoints (?)

Post by Mute Ant »

If you made the folders yourself, it's fine to remove them too.

I would avoid the -r option, you can do a lot of damage really quickly.

If the OS made the folders and they are still there, it suggests you are not using "Safely Remove Drive", or you are using it and not waiting long enough for the buffered data to be written. Auto-mount-points are supposed to vanish when the drive is ejected.

My habit is not to rm anything, ever, I just rename it. In this case...

### Put the existing /media folder out of the way under /var/tmp/ with a random name...
sudo mv /media /var/tmp/$(uuidgen)

### Make a new empty /media folder to be used in future.
sudo mkdir /media

For files and folders that are unwanted, I move them to live under /tmp/ where they will be deleted by the OS during the next boot.
User avatar
Boca
Level 5
Level 5
Posts: 691
Joined: Sun Feb 15, 2015 5:02 am

Re: Removing un-needed Mountpoints (?)

Post by Boca »

thank you for your various responses.

@MuteAnt, I do not recall making these folders myself. It is possible that I impatiently removed the USB before they had fully un-mounted. I didn't see your response until after I had deleted the folders... but thank you for your suggestions anyway.

@Wharfrat, thank you for your suggestion; which would have been fine as those USB have not been connected for several months.

@Flemur, although I knew that the USB were not connected; I decided to use your option which has removed the offending folders.

Thanks all,

Tony
hcentaur13

Re: (SOLVED) Removing un-needed Mountpoints (?)

Post by hcentaur13 »

A mountpoint itself is nothing without the media it points to when the media is mounted. It is the logical path to the partition it is mounted to. umount it and the systzem knothing aboiut the medium.

Linux needs to mount a partition to get logical access to it. That starts with / n- the mountpoint into the partition the system itself is mounted on.

A mounted mountpoint is a logical bridge to the physical location it is mounted to and contains physically nothing as the physical location hoilds any data.
So a mountpoint hides its content (when ther is any) from any possible access because it is the logical address of the root of the partition it is mounted to.

/etc/fstab is list of commands to mount partitions. This list gets worked by mount at boot time or when the program gets started manually .....
/etc/mtab is the list of currently mounted devices. You should NOT modify it!
Locked

Return to “Beginner Questions”