LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-02-2022, 02:19 PM   #1
antonym
LQ Newbie
 
Registered: Nov 2021
Posts: 14

Rep: Reputation: Disabled
Auto Mount 2nd HDD


I have a second hard drive on latest Fedora Workstation that requires a password to mount.
Can someone please step me in the right direction for making this drive available with no pass required when logged in?
Thank you.
 
Old 01-02-2022, 05:22 PM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,426
Blog Entries: 1

Rep: Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219
Include an entry for it in /etc/fstab. Make its mount point a location with appropriate permissions for your login account. Add a user option in its fstab entry for passwordless mounting and unmounting. man fstab
 
Old 01-02-2022, 09:04 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,835
Blog Entries: 28

Rep: Reputation: 6331Reputation: 6331Reputation: 6331Reputation: 6331Reputation: 6331Reputation: 6331Reputation: 6331Reputation: 6331Reputation: 6331Reputation: 6331Reputation: 6331
Here's an excellent tutorial on fstab: https://www.cyberciti.biz/faq/linux-...-update-fstab/

It's the one that taught me how to use UUIDs in /etc/fstab.
 
Old 01-03-2022, 04:53 AM   #4
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: One main distro, & some smaller ones casually.
Posts: 5,829

Rep: Reputation: Disabled
When more than one disk, you need to use UUID, so that it will always mount to your chosen mount point.
 
Old 01-03-2022, 05:41 PM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,426
Blog Entries: 1

Rep: Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219
Quote:
Originally Posted by fatmac View Post
When more than one disk, you need to use UUID
May use, not need to use. I have hundreds of fstabs and not one of them in current use contains any UUIDs. LABEL is an option (that I use as an alternative to UUID) that is much easier for human brains to type and remember.
 
Old 01-04-2022, 05:32 PM   #6
antonym
LQ Newbie
 
Registered: Nov 2021
Posts: 14

Original Poster
Rep: Reputation: Disabled
Just getting to this now.....
I am ready to edit fstab - should I use UUID of disk or partition UUID?

Code:
/dev/sdb1: LABEL="HDD2" UUID="dcfb3e52-e7c8-4569-921b-7ed6e47bea4b" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="a28f670c-f56a-453e-ad79-cd79d8db552e"
 
Old 01-04-2022, 07:41 PM   #7
antonym
LQ Newbie
 
Registered: Nov 2021
Posts: 14

Original Poster
Rep: Reputation: Disabled
I gave it a go and added this line in fstab:

Code:
UUID=dcfb3e52-e7c8-4569-921b-7ed6e47bea4b /run/media/rosie/HDD2 ext4 default 0 0
Unfortunately adding this crashed my system. I was able to use terminal with live USB edit this line out and am back up and running again.

Could someone please tell me what I did wrong?
 
Old 01-04-2022, 07:48 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,644

Rep: Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280
Code:
UUID=dcfb3e52-e7c8-4569-921b-7ed6e47bea4b /run/media/rosie/HDD2 ext4 default 0 0
The correct syntax is defaults not default.

My preference would be to mount the drive at /media/HDD2 but it does not matter.
 
Old 01-04-2022, 08:08 PM   #9
antonym
LQ Newbie
 
Registered: Nov 2021
Posts: 14

Original Poster
Rep: Reputation: Disabled
The mount point is what how the installation of Fedora made it.

Could you please show me how you would make the entry in fstab for this drive?
 
Old 01-04-2022, 08:32 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,644

Rep: Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280Reputation: 6280
Many systems automatically mount to /run/media/username/... but you can mount it just about any where. /mnt or /media makes it eeasier. Just create a directory via mkdir and use that in the fstab file.
 
Old 01-04-2022, 09:46 PM   #11
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,426
Blog Entries: 1

Rep: Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219
/run/media is a system thing. For a personal use filesystem, put it in a convenient location of your choice, e.g. somewhere in /home/, /home/myuser/ or /home/myuser/bigdata/.
 
Old 01-04-2022, 10:24 PM   #12
antonym
LQ Newbie
 
Registered: Nov 2021
Posts: 14

Original Poster
Rep: Reputation: Disabled
Sorry to say but that is not really helpful.

Is it correct to say that it was my fstab edit and not the choice of mount point that was the problem?

I am not a Linux expert but I do know it is never useful to get pulled down the wrong path when troubleshooting any system.
 
Old 01-05-2022, 12:35 AM   #13
antonym
LQ Newbie
 
Registered: Nov 2021
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
The correct syntax is defaults not default.
So all I need to change is default to defaults...like this?

Code:
UUID=dcfb3e52-e7c8-4569-921b-7ed6e47bea4b /run/media/rosie/HDD2 ext4 defaults 0 0
 
Old 01-05-2022, 12:52 AM   #14
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,426
Blog Entries: 1

Rep: Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219Reputation: 2219
Yes, but I'd change it to this
Code:
UUID=dcfb3e52-e7c8-4569-921b-7ed6e47bea4b /home/rosie/HDD2 ext4 defaults 0 0
to improve access to its content, because less file manager navigation will be necessary to access it. Actually it's not what I would do. It's just a suggestion, since I use LABELs in all my own fstabs.
 
Old 01-05-2022, 09:53 AM   #15
antonym
LQ Newbie
 
Registered: Nov 2021
Posts: 14

Original Poster
Rep: Reputation: Disabled
Thank you, appreciate the advice.

Can the mount point be changed just like that in fstab or somewhere else first?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create 2nd slice and ufs filesystem into the 2nd HDD (after one existing msdos partition? vectrum *BSD 2 07-12-2020 05:26 AM
auto mount 2nd hdd, install aqualung, gksudo dolphin Fedora 15 KDE 64 bit OrangeShoes Linux - Desktop 5 07-10-2011 04:05 PM
Slackware as 2nd os on 2nd hdd chd_lad Linux - Newbie 7 04-05-2008 03:43 PM
How to auto mount a 2nd hdd Adam555 Linux - Newbie 2 01-22-2008 02:56 AM
How to format & mount 2nd hdd after FedCor1 has been installed on 1st hdd? clay394 Fedora 1 05-18-2004 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:01 AM.

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