Monday, June 16, 2008

Automatically Mount local partition at boot in Ubuntu

You could double-click the drive icon in the GUI and Ubuntu would mount and open a drive window but I needed to automatically mount a data partition so media players can access the drive.

Make the destination with
> sudo mkdir /media/data

Copy fstab before editing
> sudo cp /etc/fstab /etc/fstab.bak

Edit fstab adding the new mount point (using vfat for fat32)
/dev/sda3 /media/data vfat defaults 0 0
(SEE BELOW FOR PERMISSIONS NOTE)

Run command to refresh fstab
> sudo mount -a

To see mounted partition
> df -k

Ubuntu puts a drive icon on the desktop for the drive...

PERMISSIONS NOTE (Added 2008-06-22):
Previously clicking icon in "Computer" mounted drive with full permissions. I finally got around to copying data over with the fstab mount and realized drive was RO! Came up with the following solution for fstab entry:

/dev/sda3 /media/data vfat user,rw,exec,umask=000 0 0

No comments: