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.

What forces a file manager to show unmounted partitions in the left pane?

That is - what process is it that causes filemanagers to show drives - it's not fstab - I can show that here, I know that inserting a mountable volume makes it show.

I'm trying to understand what it is that actually gives the filemanager the signal to show the partition in the first place.

share|improve this question
    
My impression is that it shows all partitions that have a filesystem and are not already mounted by the fstab. You can find this partitions in /dev and they are named in the pattern sdxn where x is a letter (describing the physical drive) and n is a number (describing the partition number on that drive). E.g. if you only have a sda drive and plug in an USB-Stick you can see an sdb drive showing up in /dev. –  André Stannek Jul 10 '12 at 9:55
    
I know that. I am trying to find WHAT causes them to show, not what they might get called ;) –  Elfy Jul 10 '12 at 11:42
    
Like I said: I think it's if they have a filesystem and are not already mounted. Or are you looking for the events/system calls that lead nautilus to show new devices when they are plugged in? EDIT: I see you've edited your question. Now it's clear what you mean ;-) –  André Stannek Jul 10 '12 at 14:05
    
All that's been edited today is tags ;) –  Elfy Jul 10 '12 at 16:02
    
Oh, must have read it wrong then. Sorry! –  André Stannek Jul 10 '12 at 16:13
show 2 more comments

2 Answers

up vote 9 down vote accepted
+50

The name of the program causing Nautilus to show partition in the left side bar is gvfs-gdu-volume. To kill this process, run this command to see the PID of the program

sudo ps -e | grep gvfs-gdu-volume

In my system, the output is

 6642 ?        00:00:00 gvfs-gdu-volume

So, I know the PID is 6642, it may vary by time to time.

Kill that process with

sudo kill -9 PID-of-gvfs-gdu-volume.

Or as a one liner, try this

sudo kill -9 `ps -e | grep gvfs-gdu-volume | cut -f 2 -d ' '`

Open nautilus to see the magic !

image of nautilus in Ubuntu 12.04

This image is from thunar in Xubuntu 12.04 LTS.

thunar file manager in Xubuntu 12.04

Note: The solution isn't permanent. Whenever you open a file in Gedit or something like that, The drive icon all appears again. To permanently disable this, follow the below work around.

Workaround to disable this permanently.

Open a terminal and do this command:

sudo mv /usr/lib/gvfs/gvfs-gdu-volume-monitor /usr/lib/gvfs/gvfs-gdu-volume-monitor.bak

This command renamed the culprit file to show the drive icon with adding a .bak extension. That's it.

If you want to revert the change, use this command

sudo mv /usr/lib/gvfs/gvfs-gdu-volume-monitor.bak /usr/lib/gvfs/gvfs-gdu-volume-monitor

Note: This is not a decent solution, but this works perfectly, and I am happy with this.

My drive icon has gone, How can I mount them now

Don't cry. Here is your trusted friend terminal. Open a terminal and do this command to mount /dev/sda1 partition. It will do what nautilus does.

udisks --mount /dev/sda1

To find the /dev/sdaX number of desired partition, do sudo blkid on the terminal.


Update for 12.10

It seems Ubuntu 12.10 is using udisks2 program and the responsible program for showing the drive icon is also changed. It is now gvfs-udisks2-volume. You should kill this process instead of older gvfs-gdu-volume program.

share|improve this answer
    
I use Xubuntu and thunar, grep for grep gvfs-gdu-volume gives nothing. –  Elfy Jul 10 '12 at 13:21
    
Which Xubuntu version are you using? Edit the question to reflect this. I checked on Xubuntu 12.04 with thunar. –  Anwar Shah Jul 10 '12 at 15:20
    
12.10 atm - but the question was raised with 12.04 - I booted it to see and got a response with grep gvfs-gdu-volume, when I have a bit more time I will boot to see if that works. –  Elfy Jul 10 '12 at 16:26
    
Thanks Anwar, looks like gvfs-gdu-volume is the answer to my question then :) –  Elfy Jul 11 '12 at 6:32
1  
@Elfy I just added information to handle 12.10 too. –  Anwar Shah Oct 4 '12 at 13:58
show 1 more comment

The partition has to be mountable by the user. In practice that means either on a removable volume or listed in the /etc/fstab.

share|improve this answer
    
Yes I understand that. Perhaps I didn't frame my question very well - it is kind of vague. What I'm trying to find out it is that actually causes the system to show it in nautilus for instance. I have a partition that I mount in fstab - because I use /mnt it doesn't show automatically. What part of the system is it that causes a drive to show in the filemanager before it is mounted? –  Elfy Mar 30 '12 at 16:01
add comment

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.