LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting a second drive (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-a-second-drive-4175674482/)

Nuuk 05-03-2020 04:18 AM

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.

pan64 05-03-2020 04:28 AM

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.

ehartman 05-03-2020 04:33 AM

Quote:

Originally Posted by Nuuk (Post 6118647)
# /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!).

Nuuk 05-03-2020 05:20 AM

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?

Nuuk 05-03-2020 05:23 AM

Quote:

Originally Posted by ehartman (Post 6118656)
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.

agillator 05-03-2020 05:53 AM

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.

shruggy 05-03-2020 05:55 AM

Quote:

Originally Posted by Nuuk (Post 6118661)
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.

Nuuk 05-03-2020 05:57 AM

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?

Nuuk 05-03-2020 06:19 AM

Quote:

Originally Posted by agillator (Post 6118670)
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.

camorri 05-03-2020 06:25 AM

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.

Nuuk 05-03-2020 06:55 AM

Quote:

Originally Posted by camorri (Post 6118678)
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?

Nuuk 05-03-2020 08:05 AM

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.

camorri 05-03-2020 08:29 AM

Can you provide soem information on the distrobution, version and release you have installed? Did you do a full install?

Nuuk 05-03-2020 08:59 AM

Quote:

Originally Posted by camorri (Post 6118721)
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.

Nuuk 05-03-2020 09:04 AM

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.


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