[aklug] Re: Automounting to the directory of your choice

From: Greg Madden <gomadtroll@acsalaska.net>
Date: Sun Apr 05 2009 - 15:47:11 AKDT

On Sunday 05 April 2009, barsalou wrote:
> This is sort of a follow-up to the udev stuff that was posted a while
> back.
>
> My particular goal was to ensure that the external harddrive I was =20
> using was always mounted the way I wanted.
>
> Here are a list of my criteria:
>
> - needed to be mounted uid 'mbarsalou'
> - needed to be mounted gid 'shared'
> - wanted to ensure that world couldn't write to it
> - needed to mount it on a mountpoint called '/media/My Book'
>
> The udev discussion we had before allows us to "rename" the actual =20
> device name if we want to. This can help us make specific device =20
> names and mount them to specifica locations with specific =20
> settings...the ultimate in control.
>
> Cases that might need this include having multiple external HD's or =20
> devices that cause other devices names to change.
>
> In my case I only have the one external HD and the device name that is
> =20 given to it is /dev/sda. The partition I need is /dev/sda1.
>
> I'm doing some samba sharing here because of the need to use my iTunes
> =20 library across multiple disparate machines, but that is out of
> scope =20 for this message.
>
> Also, notice the mount point '/media/My Book' has a space in the name.
> =20 I could change this by relabling the drive, however, I have =20
> discovered in a previous try that it would erase the entire volume.
>
> Here is what my fstab looks like:
>
> /dev/sda1 /media/My\040Book auto
> umask=3D0002,uid=3Dbarsalou,gid=3Dsha= red
>
> Notice the '\040'? That is an octal space character.
>
> Hopefully this helps someone.
>
> Mike B.
Mike, have you considered using UUID instead of /dev/sda1. ? FYI, UUID is
a distintive identifier for each drive or maybe file system ? If you use
externel usb devices the same device gets mounted the same place each
time, no switching of sda to sdb etc.

UUID=06e2f9c4-046b-46fa-b49c-7ae18bccc7cf /media/usbdisk xfs user,rw 0 1
UUID=4eb66a47-7b39-42c7-97ee-f81ebd173d88 /media/usbkey4gb ext2
user,rw 0 1
UUID=4559-03C1 /media/usbkey1gb vfat user,rw 0 0

-- 
Peace
Greg Madden
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Sun Apr 5 15:46:38 2009

This archive was generated by hypermail 2.1.8 : Sun Apr 05 2009 - 15:46:38 AKDT