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.

By default 'mounted volumes' are shown on the Ubuntu desktop. I usually disable this (gconf-editor or Ubuntu Tweak) because I don't want, for instance, my Windows partition on the Desktop.

However this would be a useful to display USB flash data sticks or memory cards, which are not permanently mounted volumes.

So is there some way to be selective about which volumes are shown on the Desktop?

(Image: three mounted volumes I don't want, and one USB flash data stick I do)

Desktop Screenshot

share|improve this question

4 Answers 4

up vote 7 down vote accepted
+50

Where are "40GB Filesystem", "80gb" and "backup" mounted?

My guess is under /media.

This is something that used to really annoy me, that Windows shares from the file server would appear as removable storage in my Places menu.

So I changed the mount point from /media/S to /mnt/S and now it is handled correctly as non removeable storage. Now the remote windows share :

  • does not appear in Places menu
  • does not get added to my "Disk Mounter" applet
  • does not get added as a volumes_visible icon on my desktop.

You can easily test this yourself by

  • ensure the volumes_visible option is checked in gconf-editor
  • create a mount point such as /mnt/backup/
  • edit your /etc/fstab file to use /mnt/backup instead of /media/backup
  • unmount /media/backup
  • mount /mnt/backup

I have just tested these steps and you wont have to log out to see the changes.

When you unmount the drives the icons will disappear and when you remount them under /mnt they wont reappear.

share|improve this answer
1  
I would recommend running mount -a instead of mount /mnt/backup, as it will let you know if there are any errors in your fstab file after your edit. Otherwise, if there are errors, you won't know about it until your next boot and you may have to boot from a live cd to fix it. –  tj111 Aug 18 '10 at 16:06
    
Thank you very much. This isn't quite what I'm looking for (also removing the volume from the Places nautilus sidebar) however now I think about it I'm not sure I need it in that sidebar! –  8128 Aug 18 '10 at 17:15
    
What I did afterwards was went to each location and added a bookmark. They now appear at the bottom of the list so you don't miss anything. –  Richard Holloway Aug 18 '10 at 18:48

The transparent nautilus folder that is shown on the desktop shows all user mounts, so if you mount those partitions at boot they won't be shown on the desktop.

You can mount them by adding a line for them to /etc/fstab, but the best mount options depend on what they are used for (and whether or not multiple people need to access them).

share|improve this answer
    
So can you edit your answer to elaborate on why I might not want to just add my hard drive partitions to fstab? –  8128 Aug 14 '10 at 19:26
    
Mounting and unmounting will require root access, that is the only downside as i see it. –  Source Lab Aug 14 '10 at 19:44
    
Adding the volumes to fstab has made no difference (after a restart) –  8128 Aug 15 '10 at 8:20

By adding the volumes to /etc/fstab you can make sure that they don't show up on the desktop, here are a couple of lines from my fstab

UUID=7244DE9322DE5A05 /winxp ntfs noauto 0 0
UUID=f6245825-06dc-4c97-87d3-dbe3c943247d /data ext4 errors=remount-ro 0 2
UUID=6493-8351 /share vfat defaults 0 0

Part 1 of the line is what to mount, part 2 is where to mount it, part 3 is file-system type, part 4 is mount options (add noauto if you don't want it to be mounted automatically) make sure that the user and owner options are not set!, part 5 is whather to dump the file-system if errors occur, and part 6 is the order in witch fsck will check the file systems.
Part 5 is always 0 (unless you know what you are doing) and part 6 is 0 for non-native volumes (ie. ntfs, vfat etc.), 1 for root file-system and 2 for everything else (mainly ext2, ext3, ext4).

To find the UUID of a disk you can open a terminal.

ls -l /dev/disk/by-uuid/
lrwxrwxrwx 1 root root 10 2010-08-14 20:40 1f6e83d2-c94a-4f94-9ef1-c556d8112691 -> ../../sda5
lrwxrwxrwx 1 root root 10 2010-08-14 21:40 6493-8351 -> ../../sdc1
lrwxrwxrwx 1 root root 10 2010-08-14 21:23 7244DE9322DE5A05 -> ../../sda1
lrwxrwxrwx 1 root root 10 2010-08-14 20:40 f6245825-06dc-4c97-87d3-dbe3c943247d -> ../../sdb1
lrwxrwxrwx 1 root root 10 2010-08-14 20:40 fb8fc815-fb39-4e7e-bc43-99027df044f6 -> ../../sda6

So the UUID of sda1 is 7244DE9322DE5A05, sdb1 is f6245825-06dc-4c97-87d3-dbe3c943247d and so on..
Now to find out what volumes are the ones that you want to add you can just mount them (by double clicking on the desktop icon) and the type mount in a terminal, this will list what is currently mounted where.

share|improve this answer
    
Adding the volumes to fstab has made no difference (after a restart) –  8128 Aug 15 '10 at 8:20
    
That's strange! it works here.. –  Source Lab Aug 15 '10 at 10:21
    
Ubuntu Luicd, 10.04? –  8128 Aug 15 '10 at 18:24
    
@fluteflute yep.. thats the one on here :) –  Source Lab Aug 15 '10 at 18:34
2  
If I'm reading the source right, volumes from fstab are shown except if they are not user mountable OR loopbak OR the string "/vol/" is not in the volume path. Flutefute check that your fstab doesn't include the user option in it's line. Source code on gnome-vfs2.sourcearchive.com/lines/2.8.4/… search for create_drive_on_mount_point –  Javier Rivera Aug 18 '10 at 10:53

sudo apt-get install pysdm

It's a GUI tool to edit fstab to tell the OS which drives you want mounted on bootup.

For a comprehensive guide on how to use it see this link.

To make a partition stop from auto-mounting on boot. Simply, click on the partition and hit the 'Remove' button. That way you won't have to disable auto-mounting for all drives in gconf.

To make the partition stop from showing up on your desktop, unmount it, change it's mount point to be /mnt instead of /media and re-mount or restart the OS.

share|improve this answer

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.