3

When I plug a external HDD into my Rasberry Pi (running Raspbian) it automatically mounts as

/media/2ad496774-3eb8-47bb-2bf5e-788f8eb89e54

where folder underneath it are then accessible by going

/media/2ad496774-3eb8-47bb-2bf5e-788f8eb89e54/folder/

I'd like to be able to access these folders by going to something like:

/media/storageDrive1/folder/

Is there a way to map the long path name to something shorter/more memorable/easier to work with?

I'm new to Linux so I don't understand the concept of mounting things (coming from plug+play windows machines)

  • I suppose Raspian is using some of these automagic automounters. I know nothing of these, the traditional way to mount things in Linux/UNIX is the mount command and I personally also use pmount for hotpluggable drives. If you want to keep using the automounter, perhaps it will use the LABEL of the filesystem if it is set. Try setting a label (tune2fs -L label for ext2/3/4). – njsg Jul 12 '13 at 14:38
4

These long strings of letters and numbers are what's called a UUID - Universally Unique Identifier. So changing the LABEL as one commenter above mentioned most likely won't solve this particular problem. You can see the UUID for mounted devices using the blkid command from a terminal window. In fact you can also see the LABEL for each device too:

$ blkid
/dev/sda1: LABEL="SYSTEM_DRV" UUID="20BF9FE3BE8FC134" TYPE="ntfs" 
/dev/sda2: LABEL="Windows7_OS" UUID="5CF293BFE1121C32" TYPE="ntfs" 
/dev/sda3: LABEL="Lenovo_Recovery" UUID="B43456A123456C54" TYPE="ntfs" 
/dev/sda5: UUID="4835b90f-1234-8321-9aca-fbcf1234123f" TYPE="ext4" 
/dev/sda6: UUID="av4XVa-12DA-5Vpm-0fGR-dsUd-aTtD-fG12LB" TYPE="LVM2_member" 

You can create a Unix links to this directory instead, which will probably end up being the easiest thing to do here.

$ sudo ln -s /media/2ad496774-3eb8-47bb-2bf5e-788f8eb89e54 /media/storageDrive1

This link is essentially a shortcut to the physical path.

LABEL?

On some implementations of the mounting of devices under the directory /media, I've seen that certain ones will actually use the LABEL if it's set. So you might want to still try that, but it's highly dependent on which distro of Linux you're using. The link (ln) method I suggested will work in all scenarios.

0

You can also try this approach which uses fstab to do what you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.