0

I have an internal 8tb harddrive which I want it to be mounted to all users on my machine some of the users are local and some are ldap users.

I've created a folder called 8tb in /media/8tb

Then I added the below to /etc/fstab

/dev/sda /media/8tb ext4 user,defaults 0 1

Now I wonder how to make this drive mounted to all users?

5
  • What do you mean by "mounted to all users"? Commented Apr 26, 2019 at 13:54
  • @Henrik I mean when any user (local or ldap) logins they have this drive mounted.
    – Tak
    Commented Apr 26, 2019 at 13:55
  • 1
    man mount: users Allow any user to mount and to unmount the filesystem.
    – Biswapriyo
    Commented Apr 26, 2019 at 13:57
  • Can it be mounted when no user is logged in? Then just remove the user option from the line in /etc/fstab. Otherwise you should change user to users, and add something to the login processes (where to do so depends on how your users log in, but you also have to hook into something that also allows you to hook into the logout process) that does the (un)mounting - and if you need to support several users logged in at the same time, some extra bookkeeping is needed. Commented Apr 26, 2019 at 14:15
  • @Henrik thank you. Now the drive is mounted automatically to all users. One problem now is that I have a program installed on this drive but when I try to run it from any user even admins it gives bash: /media/8tb/myprogramfolder/myprogram : Permission denied Any advice?
    – Tak
    Commented Apr 26, 2019 at 14:31

1 Answer 1

1

Now I wonder how to make this drive mounted to all users?

Speaking of any storage media, having it "mounted for all users" is misleading : a media is mounted on the system, OR is not mounted on the system. Whether it is accessible to none / some / all users is a different question.

So, as long as your 8TB drive is mounted, it is mounted for the operating system, and it will be there when users log in. Now, it's up to this operating system (and you), to grant access permissions to users. To do so, investigate Linux filesystem permissions (users, groups, and the like).

NB : you probably won't need that "users" directive in /etc/fstab

1
  • It is not really misleading, It is quite obvious the person wants to know how to have a drive mounted so that all logged in users can see and use the drive. So yes the folder permissions are actually important here, not the mounting. So the answer should be in to parts, where to mount the drive for all user access and how to set that up. Commented Apr 23, 2022 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .