Permanently Mounting a shared drive in Ubuntu 8.04

If we are going to use a shared drive for data then we must ensure that it is permanently mounted. The mounting points in all major flavours of Linux are defined in /etc/fstab and and the convention is that the mount points are in /media. We therefore need to set modify /etc/fstab to set up to mount points in /media and we must also create the directories for them using sudo to make them owned by root and set the permissions so they are accessible to all users – I cheat and open the file manager in a terminal by using gksudo nautilus to allow be to use a GUI to create the directories and set permissions. It is best to make these directories identical to those created by mounting from ‘Places’ which is derived from the partition label if it is set – see below. The procedure for modifying /etc/fstab is the same as it was for Dapper except that it is now recommended to use the drives UUID rather than the device’s location ie append lines to /etc/fstab looking like:

# /dev/sda1
UUID=F006-E8EA /media/SYSTEM vfat iocharset=utf8,umask=000 0 0
# /dev/sda5
UUID=706B-4EE3 /media/DATA vfat iocharset=utf8,umask=000 0 0
# /dev/sdb7
UUID=EEC0-FA2D /media/SHARED vfat iocharset=utf8,umask=000 0 0

Note – these strings are for FAT32 partitions and differ for NTFS partitions for which two examples follow, the first of which I have used:

# /dev/sda7
UUID=ABCD-EFGH /media/VIDEO ntfs nls=utf8,umask=0222 0 0
# /dev/hda8
UUID=ABEF-CDGH /media/VIDEO2 ntfs defaults,locale=en_GB.utf8 0 0

The UUID can be found by typing sudo blkid in a terminal – typical output looks like:

pcurtis@dimension-ubuntu:~$ sudo blkid
/dev/sda1: LABEL=”SYSTEM” UUID=”F006-E8EA” TYPE=”vfat”
/dev/sda5: LABEL=”DATA” UUID=”706B-4EE3″ TYPE=”vfat”
/dev/sdb5: TYPE=”swap” UUID=”b7c865a1-e4b6-447f-a89b-0b4deb3ba302″
/dev/sdb6: UUID=”731adef2-0cdf-44c0-b6e1-006a90a14949″ TYPE=”ext3″
/dev/sdb7: UUID=”EEC0-FA2D” TYPE=”vfat” LABEL=”SHARED”

After modifying /etc/fstab and rebooting the three Windows Drives are mounted and appear on the desktop in addition to being in ‘Places’ – they can not be unmounted without root privileges which is just what we want.

1 Comment

  1. Jacki

    Big help, big help. And suvatleripe news of course.


Leave a Comment

Your email address will not be published. Required fields are marked *