Mount a drive by UUID?
Posted: Mon 28 Oct 2013, 14:37
On my PC I have my music files on a usb stick that usually shows as sdc2 but 10% of the time shows up as sdd2 (this seems to be a legacy of the fact that this usb stick is hanging off a 7-port usb adapter, which is hanging off a pcmcia usb2 adapter card so detection time seems to vary a bit). I am wanting to automate the playing of the music files after boot (by setting it up to be automounted - there are various methods for this and I haven't decided which is the best option yet...) but cannot do so if the drive designation is varying.
The answer seems to be to use the UUID of the usb stick to identify it, and mount it using that UUID. I can find the UUID but I don't know WHERE/HOW to mount it. I can't afford to mount it as sdc2 because some other drive will probably be occupying that designation. The command I have found via google suggests to add the following to the fstab:
But does puppy even use the fstab? I've read that puppy does not mount in the same manner that other *nixes do... Would I need to make a new directory like /mnt/music and mount the device there?
The page I'm working from is:
http://centoscert.com/content/how-mount-drive-uuid
I could fiddle around with this and give it a try (normally I'm happy to tinker) but I'm not keen to fiddle with my filesystem structure without advice from someone more experienced.
I'm thinking I should not bother tinkering with the fstab, and possibly do the following:
1) create the /mnt/music directory
2) write a script to mount the uuid to that directory:
(ok - i'm just getting this WRONG i know it)
I don't want to use startmount or other "mount-all" solutions because they still suffer from the varying designation issue - it is just how/where to mount (and what to do with the fstab) that I can't figure. And if I do mount the drive in some manner, will it appear on the desktop? And how will puppy handle it if I remove / reinstall the drive - will it merely tack it onto the string of drives as sdx? (maybe this suggests that I SHOULD put it in the fstab so puppy knows what i want done with it...?)
Comment re puppy handling of fstab here:
http://mail.murga-projects.com/puppy/vi ... 6fdde2e829
These other sites seemed useful aswell:
http://www.cyberciti.biz/faq/linux-find ... ate-fstab/
http://administratosphere.wordpress.com ... x-by-uuid/
.
The answer seems to be to use the UUID of the usb stick to identify it, and mount it using that UUID. I can find the UUID but I don't know WHERE/HOW to mount it. I can't afford to mount it as sdc2 because some other drive will probably be occupying that designation. The command I have found via google suggests to add the following to the fstab:
Code: Select all
UUID=9263eae3-bdba-4707-89bb-a8e0fd4a1c29 /mnt/backups ext3 defaults 0 0
The page I'm working from is:
http://centoscert.com/content/how-mount-drive-uuid
I could fiddle around with this and give it a try (normally I'm happy to tinker) but I'm not keen to fiddle with my filesystem structure without advice from someone more experienced.
I'm thinking I should not bother tinkering with the fstab, and possibly do the following:
1) create the /mnt/music directory
2) write a script to mount the uuid to that directory:
Code: Select all
#!/bin/bash
UUID=9263eae3-bdba-4707-89bb-a8e0fd4a1c29 /mnt/music ext3 defaults 0 0
I don't want to use startmount or other "mount-all" solutions because they still suffer from the varying designation issue - it is just how/where to mount (and what to do with the fstab) that I can't figure. And if I do mount the drive in some manner, will it appear on the desktop? And how will puppy handle it if I remove / reinstall the drive - will it merely tack it onto the string of drives as sdx? (maybe this suggests that I SHOULD put it in the fstab so puppy knows what i want done with it...?)
Comment re puppy handling of fstab here:
http://mail.murga-projects.com/puppy/vi ... 6fdde2e829
These other sites seemed useful aswell:
http://www.cyberciti.biz/faq/linux-find ... ate-fstab/
http://administratosphere.wordpress.com ... x-by-uuid/
.