LinuxQuestions.org
Help answer threads with 0 replies.
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 03-01-2017, 11:58 AM   #16
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511

... Another suggestion, I mount things under my home directory (usually under /home/rick/mnt/) in order to avoid ownership and permission issues and to ensure I retain full control over the mounts.

Cheers.
 
1 members found this post helpful.
Old 03-01-2017, 12:18 PM   #17
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,499

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Quote:
I then used the GUI to open up the partition and a dialog box asked for root password
Exactly how did you 'open up the partition'? I don't use Debian but, but I believe the standard methods for opening a file manager on xfce would be either: gksu thunar or pkexec thunar from a terminal. You should be prompted for your root password and that opens the thunar file manager. If you close this instance of thunar and open another, the second instance will be an ordinary user.

Given the ls -l output you posted, the simplest way to enable yourself access to the partition as a normal user is to use the chown command suggested above.
 
Old 03-01-2017, 12:35 PM   #18
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Rickkkk View Post
Here's what I think it happening:

- You created the partition with root, so it is owned by root (confirmed by your ls -l output as mentioned in my previous post)

- You currently have no fstab entry specifying the appropriate options, so when you use the GUI tool in xfce to access the partition, you are asked for the root password. This is as expected.

- The GUI then dutifully "opens" the partition. What has actually happened here is that you have mounted the partition as root.

- When you try to actually write to the now root-mounted partition with the xfce GUI, you are attempting to do that under your regular user id session (assuming you're not logged in as root). Again, that you are not permitted to do this is normal.
Yes, it would seem although the GUI allows mounting the partition as root, it flips back to 'user' when doing other actions (like copying files).

Quote:
There are also options that can be used when manually mounting a partition that will give certain or all users rwx permissions, but in your situation, I don't see that as the most efficient solution.
Yes, I think simply using the command line is better for me as the partition wont be used often.
 
Old 03-01-2017, 01:07 PM   #19
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
Exactly how did you 'open up the partition'? I don't use Debian but, but I believe the standard methods for opening a file manager on xfce would be either: gksu thunar or pkexec thunar from a terminal. You should be prompted for your root password and that opens the thunar file manager.
It's a simple case of double-clicking on a folder icon on the xfce desktop and it opens up the thunar file manager. You don't need to open a terminal.
When I click on the new partition icon on the file manager, a box opens asking for root password which then allows access to the partition.
But this is read-only when using the desktop (GUI).

Quote:
If you close this instance of thunar and open another, the second instance will be an ordinary user.
This is very interesting. When using the GUI file manager to initially mount the partition, root password is needed.
But it's then necessary to open a second instance of the file manager to complete the copy action.
If the second instance of the file manager is 'user' then the copy action may not work because both file manager instances aren't root.

Quote:
Given the ls -l output you posted, the simplest way to enable yourself access to the partition as a normal user is to use the chown command suggested above.
Let's say I mount the partition called 'movies' using the GUI and it mounts by default to /media/movies.
If I then use the command:
Code:
 chown -R user:user /media/movies
will this give permanent user ownership of the partition?

The reason I say this is because it doesn't require creating a separate mount point or an entry in etc/fstab.
 
Old 03-01-2017, 04:23 PM   #20
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,364

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by trumpforprez View Post
... Let's say I mount the partition called 'movies' using the GUI and it mounts by default to /media/movies.
If I then use the command:
Code:
 chown -R user:user /media/movies
will this give permanent user ownership of the partition?

The reason I say this is because it doesn't require creating a separate mount point or an entry in etc/fstab ....
... I believe the answer to this is no. The /media folder, as previously explained, is usually used to mount removeable devices (ex. USB) and the mount points are transitory. Your best bet is the following in my opinion:

- Add a line in your fstab to mount the partition to a mount point (directory) that you have previously created under your /home/<your_user_id>/ directory (so your user id is permanent owner). Specify the option noauto so that the partition will only mount on demand (for instance when you click on it in Thunar).

- If you absolutely do not want to add anything to your fstab, I would still advise manually mounting to a mount point previously, and permanently created in your user id home directory, to avoid permission problems. Also, mount using the command line as opposed to the terminal so that you can specify this mount point. I strongly recommend the fstab option though, given that the disk is permanently attached to the system.

Cheers.
 
2 members found this post helpful.
Old 03-01-2017, 05:37 PM   #21
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
An example:-
Code:
/etc/fstab
# /dev/sda5
UUID=fd2d39a7-5feb-48c5-ad61-a1a361e18bd8	/mnt/video	ext4	rw,errors=remount-ro	0	2
(Where /mnt/video could be /media/video, if you prefer).
 
1 members found this post helpful.
Old 03-01-2017, 06:00 PM   #22
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,499

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
Quote:
When I click on the new partition icon on the file manager, a box opens asking for root password which then allows access to the partition.
But this is read-only when using the desktop (GUI).
I don't know why you would not have write access if you need to enter the root password but then I don't use Debian. I don't see that behavior on the Linux systems I use.

Quote:
This is very interesting. When using the GUI file manager to initially mount the partition, root password is needed.
But it's then necessary to open a second instance of the file manager to complete the copy action.
If the second instance of the file manager is 'user' then the copy action may not work because both file manager instances aren't root.

If you use the options I mentioned in my earlier post to open the file manager, you should have root access to write to any partition.

Simpler to create a mount point in /mnt directory and manually mount since you won't want it mounted at all times. Either that or an fstab entry with the noauto option.
 
Old 03-02-2017, 04:25 PM   #23
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Rickkkk View Post
- Add a line in your fstab to mount the partition to a mount point (directory) that you have previously created under your /home/<your_user_id>/ directory (so your user id is permanent owner). Specify the option noauto so that the partition will only mount on demand (for instance when you click on it in Thunar).
I have done this. However, on a previous member's recommendation, I put the mount point for the new partition in root.
This is because I wanted to manually mount the partition as root. I then added 'noauto' and 'user' as options for the partition in /etc/fstab.
Thankfully, after I've mounted the partition as root, I then have rwx permission as 'user'.
 
Old 03-02-2017, 04:38 PM   #24
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JeremyBoden View Post
An example:-
Code:
/etc/fstab
# /dev/sda5
UUID=fd2d39a7-5feb-48c5-ad61-a1a361e18bd8	/mnt/video	ext4	rw,errors=remount-ro	0	2
(Where /mnt/video could be /media/video, if you prefer).
Thank you, I wanted to know the correct code to put in /etc/fstab. I initially left out the digits for 'dump' and 'pass'.
This is how it eventually appears:
Code:
#  This is the movies partition
#    <file system>                             <mount point>    <type>  <options>  <dump>  <pass>
UUID=f354c845-f1dc-xxxxx-c2318023b4be        /moviepartn      ext4   noauto, user      0       0
The bit with 'rw,errors=remount-ro' are the options that appear for the partition of the OS. I don't know what it means so I left it out.
 
Old 03-04-2017, 07:59 AM   #25
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Quote:
Originally Posted by trumpforprez View Post
The bit with 'rw,errors=remount-ro' are the options that appear for the partition of the OS. I don't know what it means so I left it out.
These options mean basically that, if there is an error mounting the partition, it will be mounted as read-only. This could be caused by (but not limited to) a damaged file system/corrupted file system, etc.

See the following, for more information: http://askubuntu.com/questions/70711...emount-ro-mean
 
  


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
How can i give permission for AD OU keysys Linux - Networking 4 12-22-2012 11:34 PM
Installed slackware-try to access FAT32 file partition-permission denied-? linus72 Slackware 10 03-23-2009 08:23 AM
Give the root Permission to other user for manage File/Directory shipon_97 Linux - Newbie 2 01-28-2007 11:46 AM
how to give 'guest' rwx permission on a file/directory RH9Linux Linux - Software 3 06-27-2005 08:59 PM
How to give permission to /home partition Micro420 Linux - General 3 05-09-2005 05:49 PM

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

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