| Fedora This forum is for the discussion of the Fedora Project. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-31-2008, 07:31 PM
|
#1
|
|
Member
Registered: Oct 2004
Location: USA
Distribution: Fedora 18; Arch; Kubuntu; Debian
Posts: 686
Rep:
|
How can I get my USB Hard drive to always mount in the same place?
Perhaps I am remebering this incorrectly, but didn't Fedora stop using fstab about 1 or 2 releases ago? I think I remember hearing that the fstab was deprecated since CDs, Thumb drives, etc were just going to load into /media/volumename
However, I have a USB Hard drive which I need to always go into /media/usbdisk, which is what it was called back around Fedora 5 or 6 or so. I have a lot of scripts, programs, etc that expect certain files to be at /media/usbdisk. For now, I need to always also mount it at /media/usbdisk, but I'm growing weary of this after having done it for the past year or two. How can I have this happen automatically?
Also, I seem to have noticed that it's not always /dev/sdx sometimes it may be /dev/sdy (where x and y are any letter of the alphabet) so if I do put this into fstab, how can I refer to it such that the computer knows that I'm talking about no matter what /dev/sdx it is. I think in my Ubuntu computer I saw it using a volume name or something like that.
Thanks a lot!
|
|
|
|
01-31-2008, 07:38 PM
|
#2
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
If you create a label for the disk of "usbdisk" it will be mounted that way. A possible gotha is that it may be mounted as "USBDISK", so you may need to modify your scripts but after that it should be constant.
An alternative is to create an fstab entry. Instead of using the device name, use the uuid number of the filesystem. If you use the "uid=" option and the "users" option in your entry, you will be able to mount it as a regular user without needing to use sudo.
You can determine the uuid of the filesystem with the command:
udevinfo -q env -n /dev/sdX
where X is the device letter where it is currently mounted. Now the UUID number is used instead of the device node that may change on you the next time you plug it in.
If you right-click on the disk icon, is there an option to determine how it will be mounted? This may be the easiest method.
Another option is to modify your udev or hotplug or hal rules.
---
As a general rule, I use /mnt for items in fstab and leave /media to HAL/Udev automounted devices.
Last edited by jschiwal; 01-31-2008 at 07:40 PM.
|
|
|
|
01-31-2008, 08:23 PM
|
#3
|
|
Member
Registered: Oct 2004
Location: USA
Distribution: Fedora 18; Arch; Kubuntu; Debian
Posts: 686
Original Poster
Rep:
|
Thanks for the quick reply.
Ok, if I do sdb, I get
Code:
[e@mario ~]$ udevinfo -q env -n /dev/sdb
DEVTYPE=disk
ID_VENDOR=Maxtor
ID_MODEL=OneTouch
ID_REVISION=0200
ID_SERIAL=Maxtor_OneTouch_Y3K2RLGE-0:0
ID_SERIAL_SHORT=Y3K2RLGE
ID_TYPE=disk
ID_INSTANCE=0:0
ID_BUS=usb
if I do sdb1, I get:
Code:
[emesa@mario ~]$ udevinfo -q env -n /dev/sdb1
DEVTYPE=partition
ID_VENDOR=Maxtor
ID_MODEL=OneTouch
ID_REVISION=0200
ID_SERIAL=Maxtor_OneTouch_Y3K2RLGE-0:0
ID_SERIAL_SHORT=Y3K2RLGE
ID_TYPE=disk
ID_INSTANCE=0:0
ID_BUS=usb
ID_PATH=pci-0000:00:10.4-usb-0:3:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=9aa4aac3-eb2f-425b-8e6f-7c27897a7911
ID_FS_UUID_ENC=9aa4aac3-eb2f-425b-8e6f-7c27897a7911
ID_FS_LABEL=
ID_FS_LABEL_ENC=
ID_FS_LABEL_SAFE=
Which of teh UUIDs do I use? ID_FS_UUID or ID_FS_UUID_ENC?
Thanks!
|
|
|
|
01-31-2008, 10:28 PM
|
#4
|
|
Member
Registered: Apr 2004
Distribution: Ubuntu Jaunty
Posts: 62
Rep:
|
Quote:
Originally Posted by DJOtaku
Thanks for the quick reply.
Ok, if I do sdb, I get
Code:
[e@mario ~]$ udevinfo -q env -n /dev/sdb
DEVTYPE=disk
ID_VENDOR=Maxtor
ID_MODEL=OneTouch
ID_REVISION=0200
ID_SERIAL=Maxtor_OneTouch_Y3K2RLGE-0:0
ID_SERIAL_SHORT=Y3K2RLGE
ID_TYPE=disk
ID_INSTANCE=0:0
ID_BUS=usb
if I do sdb1, I get:
Code:
[emesa@mario ~]$ udevinfo -q env -n /dev/sdb1
DEVTYPE=partition
ID_VENDOR=Maxtor
ID_MODEL=OneTouch
ID_REVISION=0200
ID_SERIAL=Maxtor_OneTouch_Y3K2RLGE-0:0
ID_SERIAL_SHORT=Y3K2RLGE
ID_TYPE=disk
ID_INSTANCE=0:0
ID_BUS=usb
ID_PATH=pci-0000:00:10.4-usb-0:3:1.0-scsi-0:0:0:0
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=9aa4aac3-eb2f-425b-8e6f-7c27897a7911
ID_FS_UUID_ENC=9aa4aac3-eb2f-425b-8e6f-7c27897a7911
ID_FS_LABEL=
ID_FS_LABEL_ENC=
ID_FS_LABEL_SAFE=
Which of teh UUIDs do I use? ID_FS_UUID or ID_FS_UUID_ENC?
Thanks!
|
I'm pretty ignorant on this subject, but they look identical to me. 
|
|
|
|
02-01-2008, 01:02 AM
|
#5
|
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 12.3_64-KDE, Ubuntu 12.04, Fedora 17, Mint 14, Chakra
Posts: 3,517
Rep: 
|
|
|
|
|
02-01-2008, 03:10 PM
|
#6
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Use the value from ID_FS_UUID. They are the same so it doesn't matter which value you use. Maybe they would be different if you had an encrypted filesystem.
You can also look in /dev/disk/by-uid/. The filesystem uuid will also have a symbolic link there (that was created by hal). You could use this to verify the number. ( ls -l /dev/disk/by-uuid/ )
|
|
|
|
02-01-2008, 05:23 PM
|
#7
|
|
Member
Registered: Apr 2003
Posts: 128
Rep:
|
can you cheat?
can you just make a symlink with the name you want it to be ?
from the directory it's in try "ln -s mountpointname mountpointnameyouwant " (without the quotes)
|
|
|
|
02-01-2008, 05:39 PM
|
#8
|
|
Senior Member
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079
Rep:
|
I'm pretty sure fedora still uses fstab, I know in Fedora 7 they still used it, I don't understand how you could mount partitions on a harddisk without it.
|
|
|
|
02-01-2008, 07:42 PM
|
#9
|
|
Member
Registered: Oct 2004
Location: USA
Distribution: Fedora 18; Arch; Kubuntu; Debian
Posts: 686
Original Poster
Rep:
|
Thanks for the help guys. I've changed it and I'll give it a test on my next reboot.
|
|
|
|
02-01-2008, 10:44 PM
|
#10
|
|
LQ Newbie
Registered: Aug 2007
Posts: 10
Rep:
|
I _really_ dislike the gobbledygook of the UUID stuff!
and I _like_ the fstab.
Of course, I'm an old codger who once thought System/360's JCL was pretty clever.
And I was good at it.
What was the reason for changing my hdx references to sdx?
The last SCSI bus device I used was on a Mac.
|
|
|
|
02-02-2008, 04:31 AM
|
#11
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
The kernel module that used to be used had problems and wasn't being the best maintained. The UUID entry is needed because it is a removable drive. A different device node may be used the next time the device is plugged in. By using the UUID of the filesystem, you will be able to mount it even when that happens.
You can have entries for pendrives as well. If your the fstab entry uses the UUID number, and you use the options uid, gid, users & noauto, you can mount it as a normal user and with the right fmask and dmask options you will have exclusive access on that machine.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:35 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|