10

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

Bruno Pereira
  • 73,643
8128
  • 28,740

4 Answers4

9

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.

  • 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. – TJ L 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
0

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).

JanC
  • 19,422
0

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.

  • Adding the volumes to fstab has made no difference (after a restart) – 8128 Aug 15 '10 at 08:20
  • That's strange! it works here.. – LasseLuttermann Aug 15 '10 at 10:21
  • Ubuntu Luicd, 10.04? – 8128 Aug 15 '10 at 18:24
  • @fluteflute yep.. thats the one on here :) – LasseLuttermann 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 http://gnome-vfs2.sourcearchive.com/lines/2.8.4/gnome-vfs-volume-monitor-daemon_8c-source.html search for create_drive_on_mount_point – Javier Rivera Aug 18 '10 at 10:53
  • +1 for reading vfs source code :D Just added Javier Rivera's info to my answer. – LasseLuttermann Aug 18 '10 at 12:37
  • Thank you for your efforts!
    UUID=d8d9ff85-d0f3-4f6d-949d-382dc7a0c856 /media/backup   ext3    defaults        0       2
    
    

    Above is an example of a line in my fstab that is showing on the desktop. What do I need to change?

    – 8128 Aug 18 '10 at 17:06
  • I have used another answer instead, thank you for your efforts though. (changed that line to /mnt/backup) – 8128 Aug 18 '10 at 17:25
  • I have seen it. Now I'm really puzzled ;). Maybe it is a Ubuntu patch?. Maybe I should start another question? ;). – Javier Rivera Aug 18 '10 at 17:39
  • We could go and ask some developers... sorry I can't give you the bounty, looks like you tried hardest ;) – 8128 Aug 19 '10 at 06:31
0

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.

Evan Plaice
  • 1,916