[SATLUG] mounting in /media on debian/ubuntu

Tweeks tweeksjunk2 at theweeks.org
Thu Jul 17 02:08:39 CDT 2008


On Monday 14 July 2008 08:27:48 am tsuehpsyde wrote:
> Using labels or UUIDs are also a bit more safe when mounting devices via
> /etc/fstab since sometimes, the kernel likes to either change the naming
> scheme (/dev/hda to /dev/sda comes to mind as of late), or if you have
> multiple /dev/sdX devices and any of them include an add-in card, they will
> ennumerate differently on different reboots (always fun). Labels are a
> safer bet, and I've started using them. For example, Ubuntu uses UUIDs to
> mount things (just a bit more unique than a label). Just don't put two of
> the same labels in a system, or things will be not so fun.
>
> Also, I assume the /media mount points are being handled by udev. I'd have
> to look into it, but I'm not awake yet.

UDev and HALd.

If you want your different thumb drives to have different mount point names, 
then just change the vfat volume name of the thumb drive.  If you remember 
back to your MSDOS days.. FAT volume names were 11 characters max.  For 
example.. I make mine:
	ThomasWeeks
	Tweeks-4GB
	Tweeks-Keys
	Tweeks-Cam
	Cam-512M
	Cam-1GB
etc.. (using mkfs.vfat -n)

Then your auto-created mount points end up being:
	/media/ThomasWeeks
	/media/Tweeks-4GB
	/media/Tweeks-Keys
	/media/Tweeks-Cam
	/media/Cam-512M
	/media/Cam-1GB

For some of them.. I also form symlinks starting with "USB".. like this:
	$ ls -la USB*
lrwxrwxrwx 1 tweeks tweeks 19 2008-03-15 01:52 
USB-ThomasWeeks -> /media/ThomasWeeks/

The cool thing is.. in most GUIs.. the link will only appear when it's not 
broken (e.g. that drive is mounted).. Pretty sweet system for making all my 
media appear right in my home dir. :)

Anyone else have similar useful tricks?

Tweeks


More information about the SATLUG mailing list