access second drive partition by a name, not UUID--how?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
access second drive partition by a name, not UUID--how?
The description says most of it already. I have a second drive, /dev/sdb and it has a
large partition of 129GiB. I found its UUID and added it to fstab, so it is mounted
at boot. (It is actually /dev/sdb9.) But in order to write to it, I need some way to
give it a name that the system recognizes, so I can just cd /media/somename/filename.
(I don't know where "media" came from--it seems to apply to the whole hard drive.)
This needs to work in PCLinuxOS, KDE5. Any assistance greatly appreciated.
--doug
PS: If there is a way of letting me know by email when this post is answered, I don't
know how to implement it, unless it is automatic.
If you have an entry in fstab, it should show the mount point which is where you would go to access it. If it is /media then navigate there. Is the second drive an external usb drive? If you have an entry in fstab you created you should know how to access it. A number of Linux systems will make external drives available in the /media directory. You can manually create a mount point such as sdb9 with the command as root: mkdir /mnt/sdb9 OR /mkdir /media/sdb9 or give it another name of your choosing. Might help if you indicated whether you have a mount point and what it is and also post the entry from fstab.
The fstab entry needs to supply a mountpoint - /mnt/sdb9 that you created should do fine. See "man fstab" for the options you'll need to supply.
You then reference it by the mountpoint. Any linux filesystem should allow you to assign a label. Let's see this output.
In addition, using /media is just a convention where desktops automatically mount removable media and filesystems. The system will create a subdirectories(s) under /media depending on distribution/version using the filesystems UUID or label.
I would generalize that all recent distribution/versions should recognize UUIDs or labels in the /etc/fstab so should not be a problem.
Obviously there is more information for the other partitions. I know what "defaults" means, but it seems there should be some "/name" then "ext4" before
an entry that says defaults, and then I don't understand the "1 2" after the other system partitions. (Yes, the file system is ext4.) Sorry that I'm such
a dope, but this is a bit beyond me. Thanx for your help and your patience! --doug
In your last post, #8, you posted your fstab contents. Look at your entry for sdb9 and compare it to the entries above for /, /boot, /home and note that you do not have the mount point listed nor the filesystem type or other otions. Options are explained in detail at the link below.
If you created the mount point you referred to earlier (/media/sdb9), change the line below to add it, the filesystem and options which you can set to your needs after reviewing the link above. You don't need to name it sdb9 or put it under /media. Historically the convention has been to put mount points in the /mnt directory but obviously, it is not required.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.