LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-03-2020, 04:18 AM   #1
Nuuk
Member
 
Registered: May 2020
Posts: 62

Rep: Reputation: Disabled
Mounting a second drive


I have a PC dedicated to playing music, the operating system on an SSD, and the music on another drive.

I am trying to get the second drive to mount automatically without luck. After much researching, I got the UUID number of the drive, and then I modified the fstab file as follows:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=42007db2-50af-46ae-9f4c-8b87b87c893f / ext4 rw,errors=remount-ro 0 1

# /dev/sdb
UUID=3b754aac-49bb-46fd-b3fc-e253449a1f62 /media ext4 rw,errors=remount-ro 0 1



If I mount the drive manually, it goes to the media folder, but it is still not mounting automatically. Can anybody advice what else I have to do please?

EDIT - a lot later -

Rather than read all through this rather long thread, you can go to my post on page 9 and see a summary of what worked for me.

Last edited by Nuuk; 05-06-2020 at 06:13 AM.
 
Old 05-03-2020, 04:28 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,970

Rep: Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334Reputation: 7334
it may depend on how is it formatted. Would be nice to check /var/log probably you will find some related logs.
Also [in general] you need to mount /dev/sdb1 or similar (the number is missing), but you need to know what do you want to mount.
Oh yes, change the 1 at the end to 0.
 
Old 05-03-2020, 04:33 AM   #3
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by Nuuk View Post
# /dev/sdb
UUID=3b754aac-49bb-46fd-b3fc-e253449a1f62 /media ext4 rw,errors=remount-ro 0 1



If I mount the sdrive manually, it goes to the media folder, but it is still not mounting automatically. Can anybody advice what else I have to do please?
Did you reboot after changing the line in /etc/fstab. Entries in /etc/fstab are normally only mounted after a reboot.
The entry looks OK, although the errors= clause normally wouldn't be needed for anything else then the / partition. And I probably would keep the /media directory free for auto-mounting sticks etc, so would be using /mnt/disk2 (but make sure that mount dir already exists!).
 
Old 05-03-2020, 05:20 AM   #4
Nuuk
Member
 
Registered: May 2020
Posts: 62

Original Poster
Rep: Reputation: Disabled
pan64, how do I add a number to the second drive? That drive was copied from another drive in another computer. Do I need to format it, start again, and then copy all the 300gb of music?
 
Old 05-03-2020, 05:23 AM   #5
Nuuk
Member
 
Registered: May 2020
Posts: 62

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ehartman View Post
Did you reboot after changing the line in /etc/fstab. Entries in /etc/fstab are normally only mounted after a reboot.
The entry looks OK, although the errors= clause normally wouldn't be needed for anything else then the / partition. And I probably would keep the /media directory free for auto-mounting sticks etc, so would be using /mnt/disk2 (but make sure that mount dir already exists!).
Yes, I did reboot after editing fstab.

I'll take out the 'errors= clause', and mount to mnt as you suggest. When naming the mount dir does it have to be the same name as the drive that is being mounted? Mine comes up as Music.
 
Old 05-03-2020, 05:53 AM   #6
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
The media folder is often used as the parent folder for mounting external disks and some systems assume if a mount point is not empty it is probably an error and will not mount without specific permission. For those reasons I would stay away from the /media folder. When I am going to do something similar to what you are doing, first when formatting the partition (I use gparted) I label the partition rather than using the UUID to something simple and descriptive, then I create a directory to be used only for it. For my purposes the default options are almost always sufficient which also simplifies things. So then my fstab entry might look something like this:
Code:
LABEL=music  /xmusic  ext4  defaults  0 0
The command to manually mount is
Code:
sudo mount -L xmusic
It is not necessary to reboot after changing fstab. Just run
Code:
sudo fstab -a
Any unmounted directory that would normally be mounted during boot will be mounted. If you unmount it manually and run the command again it will be mounted again. Directories already mounted will not be disturbed.
 
Old 05-03-2020, 05:55 AM   #7
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
Quote:
Originally Posted by Nuuk View Post
pan64, how do I add a number to the second drive?
pan64 probably means /dev/sdb in the comment. The point is moot anyway as you're mounting by UUID, and not by device name.

Last edited by shruggy; 05-03-2020 at 06:36 AM.
 
Old 05-03-2020, 05:57 AM   #8
Nuuk
Member
 
Registered: May 2020
Posts: 62

Original Poster
Rep: Reputation: Disabled
Now when I modify fstab, it won't let me save it, and at the top of the gedit window it says read only.

I bet that I am not the first person to get slightly annoyed at being denied permission to set up my own computer. How can I remove all the restrictions and denial of permissions?
 
Old 05-03-2020, 06:19 AM   #9
Nuuk
Member
 
Registered: May 2020
Posts: 62

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by agillator View Post
The media folder is often used as the parent folder for mounting external disks and some systems assume if a mount point is not empty it is probably an error and will not mount without specific permission. For those reasons I would stay away from the /media folder. When I am going to do something similar to what you are doing, first when formatting the partition (I use gparted) I label the partition rather than using the UUID to something simple and descriptive, then I create a directory to be used only for it. For my purposes the default options are almost always sufficient which also simplifies things. So then my fstab entry might look something like this:
Code:
LABEL=music  /xmusic  ext4  defaults  0 0
The command to manually mount is
Code:
sudo mount -L xmusic
It is not necessary to reboot after changing fstab. Just run
Code:
sudo fstab -a
Any unmounted directory that would normally be mounted during boot will be mounted. If you unmount it manually and run the command again it will be mounted again. Directories already mounted will not be disturbed.
Thanks agillator - that helps clarify things. But I still need to be able to edit the fstab file and save it.
 
Old 05-03-2020, 06:25 AM   #10
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,235

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Quote:
How can I remove all the restrictions and denial of permissions?
On linux, you do not remove permissions, this is one thing that give you security.

Usually this is an indication you ( the user issuing the command ) does not have authority to change what you are tyring to change. Almost all files on the root partition require root permissions, including fstab. Open a command prompt, and log in as root, or use su - and provide the root password, then you will have the permission necessary to modify your fstab file.
 
Old 05-03-2020, 06:55 AM   #11
Nuuk
Member
 
Registered: May 2020
Posts: 62

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by camorri View Post
On linux, you do not remove permissions, this is one thing that give you security.

Usually this is an indication you ( the user issuing the command ) does not have authority to change what you are tyring to change. Almost all files on the root partition require root permissions, including fstab. Open a command prompt, and log in as root, or use su - and provide the root password, then you will have the permission necessary to modify your fstab file.
Thanks camorri. I assumed that if I logged in with my user name and password, I would be the 'boss'. I'll try the su and password. By command prompt I assume that is the terminal?
 
Old 05-03-2020, 08:05 AM   #12
Nuuk
Member
 
Registered: May 2020
Posts: 62

Original Poster
Rep: Reputation: Disabled
This is going beyond tedious. An hour to install the OS and set up my DAC stc, and six days on I still can't mount the music drive.

When I type gedit /etc/fstab (after the su & password) I am told 'Failed to connect to the session manager. None of the authentication s protocols specified are supported'

I did manage to edit fstab in Gedit on the desktop, ans save it, but when I rebooted my extra line had disappeared.
 
Old 05-03-2020, 08:29 AM   #13
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,235

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Can you provide soem information on the distrobution, version and release you have installed? Did you do a full install?
 
Old 05-03-2020, 08:59 AM   #14
Nuuk
Member
 
Registered: May 2020
Posts: 62

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by camorri View Post
Can you provide soem information on the distribution, version and release you have installed? Did you do a full install?
It is called Audiophile Linux 2.1, and optimised for music playback. The start screen says Release: debian 1 - Edition Cinamon 32-bit. It was what I would call a full install, ie entering all the details of keyboard etc.

Last edited by Nuuk; 05-03-2020 at 09:00 AM.
 
Old 05-03-2020, 09:04 AM   #15
Nuuk
Member
 
Registered: May 2020
Posts: 62

Original Poster
Rep: Reputation: Disabled
I accept that a lot of the issues with Linux are due to it being a secure operating system. But how can it be a security issue that I can go to 'Computer' right click on the drive name, and then select, and mount it for that session, but not for all sessions. If I was going to steal information of it I could easily do it in a single session.

I think that Linux is missing a trick here. It could be made so much easier for non-technically minded people to use as well.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mount second drive and move Home to second drive edjenn1998 Linux - Newbie 9 07-08-2019 10:50 AM
Second Hard Drive Mounting Problems JC404 Linux - Newbie 16 07-11-2003 06:52 AM
Why does Redhat 8.0 access hard drive second by second? Cyclops Linux - Distributions 5 11-20-2002 07:34 PM
mounting a second hard drive evilRhino Linux - General 2 10-17-2002 01:22 AM
Questions regarding mounting partitions on the second hard drive HoHah Linux - General 15 04-16-2002 08:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:49 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