LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 07-15-2018, 03:32 PM   #1
dmcgarrett@optonline.net
LQ Newbie
 
Registered: Jun 2010
Location: Long Island, NY
Distribution: PCLOS, Mint,
Posts: 26

Rep: Reputation: 0
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.
 
Old 07-15-2018, 03:51 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,510

Rep: Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491
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.
 
Old 07-15-2018, 09:48 PM   #3
dmcgarrett@optonline.net
LQ Newbie
 
Registered: Jun 2010
Location: Long Island, NY
Distribution: PCLOS, Mint,
Posts: 26

Original Poster
Rep: Reputation: 0
Here is the entire fstab:

# Entry for /dev/sda6 :
UUID=80790976-f729-4ff5-8ae3-3c3a1e6b24d4 / ext4 defaults 1 1
# Entry for /dev/sda2 :
UUID=67354859-78e0-4832-b5b2-73f0ca29c38b /boot ext4 defaults 1 2
# Entry for /dev/sda3 :
UUID=221a3243-142d-4b00-b511-17bffb48c3f1 /home ext4 defaults 1 2
none /proc proc defaults 0 0
# Entry for /dev/sda5 :
UUID=0ef821ed-8585-4bc3-92db-3b85bdf81007 swap swap defaults 0 0
# Entry for /dev/sda7 :
UUID=8c13a80e-939a-43e0-9ecb-90f9b5a6eae2 swap swap defaults 0 0
none /dev/pts devpts defaults 0 0
# Entry for /dev/sdb9
UUID=f257b89f-c268-4560-bd89-33c08e8fb940

***********************************************************
In gparted, it appears that there is no longer a "label" option, if that matters.

This is not an external drive. It is in the PC case with /dev/sda, where PCLOS lives. There is no other OS on the machine.

Here is a section I have copied, eliminated mistyped lines. There should be a directory in that partition called merlesmusic, but it doesn't show.

[root@linux1 doug]# mkdir /media/sdb9
[root@linux1 doug]# cd /media/sdb9
[root@linux1 sdb9]# ls -la
total 8
drwxr-xr-x 2 root root 4096 Jul 15 22:33 ./
drwxrwxr-x 10 root root 4096 Jul 15 22:33 ../
[root@linux1 sdb9]# ls -la
total 8
drwxr-xr-x 2 root root 4096 Jul 15 22:33 ./
drwxrwxr-x 10 root root 4096 Jul 15 22:33 ../
[root@linux1 /]# mkdir /mnt/sdb9
[root@linux1 /]# cd /sdb9
bash: cd: /sdb9: No such file or directory
[root@linux1 /]# cd /mnt/sdb9
[root@linux1 sdb9]# ls -la
total 8
drwxr-xr-x 2 root root 4096 Jul 15 22:35 ./
drwxr-xr-x 3 root root 4096 Jul 15 22:35 ../

I can't believe that I've been using Linux for about 20 years and I can't get this straight

If I open the file manager (Dolphin) and select 129.6 hard drive, it shows merlesmusic. I'm confused!

Thanx for the input--doug
 
Old 07-15-2018, 10:30 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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.
Code:
sudo lsblk -f
df -hT
 
Old 07-16-2018, 12:23 PM   #5
dmcgarrett@optonline.net
LQ Newbie
 
Registered: Jun 2010
Location: Long Island, NY
Distribution: PCLOS, Mint,
Posts: 26

Original Poster
Rep: Reputation: 0
[root@linux1 doug]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 ext4 a9ef7ac9-5355-4a6b-ba04-c109924a8a3f /media/a9ef7ac9-5355-4a6b-ba04-c109924a8a3f
├─sda2 ext4 67354859-78e0-4832-b5b2-73f0ca29c38b /boot
├─sda3 ext4 221a3243-142d-4b00-b511-17bffb48c3f1 /home
├─sda4
├─sda5 swap 0ef821ed-8585-4bc3-92db-3b85bdf81007 [SWAP]
├─sda6 ext4 80790976-f729-4ff5-8ae3-3c3a1e6b24d4 /
└─sda7 swap 8c13a80e-939a-43e0-9ecb-90f9b5a6eae2 [SWAP]
sdb
├─sdb1 ntfs 099AECF06FAAC2BB /media/099AECF06FAAC2BB
├─sdb2 vfat D26C-CF7C /media/D26C-CF7C
├─sdb3
├─sdb5 ext4 809fd892-ab93-410b-8a43-07f86e69e671 /media/809fd892-ab93-410b-8a43-07f86e69e671
├─sdb6 ext4 df4f1ab1-7682-43aa-b7ba-f1620cbc4b8a /media/df4f1ab1-7682-43aa-b7ba-f1620cbc4b8a
├─sdb7 swap 422594ad-aa6d-4bd7-8c88-c5149a8b2f57
├─sdb8 ext4 0096d25a-0ea7-4ec3-a90c-fcb5885f8ae3 /media/0096d25a-0ea7-4ec3-a90c-fcb5885f8ae3
└─sdb9 ext4 f257b89f-c268-4560-bd89-33c08e8fb940 /media/f257b89f-c268-4560-bd89-33c08e8fb940 <<<<<This one
sr0
sr1


will look at the man page for fstab again.
Thanks--doug
 
Old 07-16-2018, 01:24 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
https://www.cyberciti.biz/faq/rhel-c...rtition-label/
 
Old 07-16-2018, 03:16 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
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.
 
Old 07-17-2018, 01:26 PM   #8
dmcgarrett@optonline.net
LQ Newbie
 
Registered: Jun 2010
Location: Long Island, NY
Distribution: PCLOS, Mint,
Posts: 26

Original Poster
Rep: Reputation: 0
I went over the man page for fstab, and it looks to me like the copy I pasted is incomplete. Here is the complete file:

root@linux1 etc]# cat fstab
# Entry for /dev/sda6 :
UUID=80790976-f729-4ff5-8ae3-3c3a1e6b24d4 / ext4 defaults 1 1
# Entry for /dev/sda2 :
UUID=67354859-78e0-4832-b5b2-73f0ca29c38b /boot ext4 defaults 1 2
# Entry for /dev/sda3 :
UUID=221a3243-142d-4b00-b511-17bffb48c3f1 /home ext4 defaults 1 2
none /proc proc defaults 0 0
# Entry for /dev/sda5 :
UUID=0ef821ed-8585-4bc3-92db-3b85bdf81007 swap swap defaults 0 0
# Entry for /dev/sda7 :
UUID=8c13a80e-939a-43e0-9ecb-90f9b5a6eae2 swap swap defaults 0 0
none /dev/pts devpts defaults 0 0
# Entry for /dev/sdb9
UUID=f257b89f-c268-4560-bd89-33c08e8fb940

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
 
Old 07-17-2018, 03:04 PM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,510

Rep: Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491
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.

https://help.ubuntu.com/community/Fstab

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.

Quote:
UUID=f257b89f-c268-4560-bd89-33c08e8fb940 /media/sdb9 ext4 defaults 1 2
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I change the UUID of a partition? widget Debian 9 08-30-2012 02:12 AM
[SOLVED] Getting the UUID of a swap partition eldiener Linux - Software 11 07-30-2012 05:38 PM
how is partition uuid generated? robertchen Linux - Software 3 02-10-2012 05:02 PM
Help - Cant access second hard drive partition rflook Linux - Hardware 2 10-20-2010 02:56 PM
hard drive partition access and more! hodogg Linux - Hardware 2 04-15-2005 05:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration