LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-01-2017, 07:42 AM   #1
Grabby
Member
 
Registered: Feb 2016
Posts: 65

Rep: Reputation: Disabled
How to change the permissions for a disk partition?


I have created and formatted a disk partition with GParted. The problem is that this new partition is marked as read-only by default, so I am not able to write on it. To be more precise, it appears to be read-only for all except the root user. I have found a drop-down menu in the file manager to change permissions, but when I try to apply the change it does go through, probably because I am not running the file manager as root. And yet, when I ran it as root, that partition is not even listed in the file manager. What is going on? I am sure that the partition is there, no doubt about it.

In short, how can I change the partition's permission to make it accessible and writable by anyone?
Please suggest some easy solution, possibly one that does not involve the command line.

Thanks

Last edited by Grabby; 04-01-2017 at 07:45 AM.
 
Old 04-01-2017, 08:07 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 3,242

Rep: Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882Reputation: 882
Formatting the partition has created a filesystem. You need to mount the filesystem for it to show up in Nautilus and to be able to read and write files. If you have the Gnome Disk Utility you can used it to mount the filesystem.

https://www.liberiangeek.net/2014/01...r-desktop-gui/
 
Old 04-01-2017, 08:18 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Grabby View Post
In short, how can I change the partition's permission to make it accessible and writable by anyone?
Please suggest some easy solution, possibly one that does not involve the command line.
gnome-disks
 
Old 04-01-2017, 08:58 AM   #4
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Rep: Reputation: Disabled
Quote:
Originally Posted by Grabby View Post
In short, how can I change the partition's permission to make it accessible and writable by anyone?
Please suggest some easy solution, possibly one that does not involve the command line.

Thanks
That's gonna be difficult as I've had to use the command line to get permissions on my newly created partition.
But the thing is, all you need to do is cut and paste the correct command on the command line.

Hopefully, you've assigned a label (name) to the partition.
Open the terminal as root and use this command:
Code:
lsblk -o name,mountpoint,label,size,uuid
This should list all your partitions including your newly created partition. As an example, let's say it's sda9.

Now mount the new partition to your 'user' directory (as opposed to the root directory).
Code:
mount /dev/sda9 /home/user/Public
Of course, you would use your own username instead of 'user'.
Also, 'Public' is an empty folder on my file manager. You may want to create a new empty file so your new partition appears under that file.

Now give user ownership to the newly mounted partition. Where it says 'user', you'll be putting in your user name.
Code:
chown user -R /home/user/Public
This should now give you read/write permission for the new partition.
This is a quick and easy method and you'll have to do it every time you boot up.
There is a more permanent method by adding the partition to your fstab file.

If you want to unmount the new partition, then it's simply:
Code:
umount /home/user/Public
Again, 'Public' is an example directory I'm using.

Last edited by trumpforprez; 04-01-2017 at 12:45 PM.
 
Old 04-01-2017, 09:10 AM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by Grabby View Post
I have created and formatted a disk partition with GParted.
Fixed or Removable please?

There's no "easy answer" if you don't understand the principles, or methods involved.

Last edited by Habitual; 04-01-2017 at 09:14 AM.
 
Old 04-01-2017, 10:37 AM   #6
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,725

Rep: Reputation: 255Reputation: 255Reputation: 255
Determine the partition's mount point. Then with the partition mounted run as root:

Code:
# chmod 766 <mount point>
If you are running one of the *buntus use sudo instead:

Code:
 sudo chmod 766 <mount point>
 
Old 04-01-2017, 10:44 AM   #7
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,417

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by Grabby View Post
I have created and formatted a disk partition with GParted. The problem is that this new partition is marked as read-only by default, so I am not able to write on it. To be more precise, it appears to be read-only for all except the root user. I have found a drop-down menu in the file manager to change permissions, but when I try to apply the change it does go through, probably because I am not running the file manager as root. And yet, when I ran it as root, that partition is not even listed in the file manager. What is going on? I am sure that the partition is there, no doubt about it.

In short, how can I change the partition's permission to make it accessible and writable by anyone?
Please suggest some easy solution, possibly one that does not involve the command line.

Thanks
If it's a fixed disk, it sounds like root owns it, and therefore that would explain why it's read-only. So you would (as others have said), need to assign the appropriate permissions to it. In that case you would assign them to the mount point it is mounted to, but in that case I would also recommend you create a folder somewhere (and mount your new partition to that folder) and assign the appropriate permissions to that. And then add it to /etc/fstab

This thread should help: https://www.linuxquestions.org/quest...on-4175600831/

And well done trumpforprez for sharing what you have learned here, yourself!

Last edited by jsbjsb001; 04-01-2017 at 11:28 AM. Reason: added fstab bit/fixed spelling mistakes
 
Old 04-02-2017, 01:14 PM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,994
Blog Entries: 1

Rep: Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846Reputation: 846
It is how it's mounted that determines it's permissions. And basic unix permissions apply beyond that, for unix based filesystems. You can use umask when you mount it as root to give permissions to others. You can put it as an entry in /etc/fstab and when a user mounts it, that user has access to it. I find it simpler to just make directories on the / of the partition and assign them owners:groups that are usable by the users.

$ sudo mount /dev/sda3 /mnt
$ sudo mkdir /mnt/lookoverhere
$ sudo chown user:user /mnt/lookoverhere
$ cat /proc/cpuinfo > /mnt/lookoverhere/look_ma_I_can_write.txt

Otherwise

$ sudo mount -o umask=0000 /dev/sda3 /mnt

umask is kind of an odd one, it's the permissions you don't want available. So, umask=0222 means that it cannot be written to. Where 4=read, 2=write, and 1=execute, so rwx = 111 in binary or 7 in decimal. But for umask it would be the xor / binary opposite so rwx=0.
 
Old 04-02-2017, 02:28 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: FreeBSD/Slackware-14.2+/ Win10
Posts: 9,493

Rep: Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024Reputation: 2024
you too can if it is just for your use instead of 766 if root created it then only root can still read write and execute within it.

you need to chown and give it a user and a group that if you want more than one to be able to read,write, and execute out of it too.

Then the others are added to that group that is attached to that partition giving them all of the permissions attached to that group within it, or you can set it up for directories within that partition too. All depending on how you want to slice and it a dice it.

For the entire Partition.

Code:
#mount /dev/sdxx /mount/point
#chown userName:GroupName /mount/point -R

# <-- indicates root user, not a comment.

https://www.linode.com/docs/tools-re...ers-and-groups

Last edited by BW-userx; 04-02-2017 at 02:35 PM.
 
  


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
Change permissions on partition Fixit7 Linux Mint 3 07-19-2016 06:55 PM
[SOLVED] How can I change file permissions in windows ntfs partition.Even root can't change it e3399 Linux - Newbie 3 03-02-2011 11:54 PM
LVM - what if disk partition change causes the PV device file to change? catkin Linux - General 9 12-19-2008 07:43 PM
Can't change permissions of Windows partition Dimension User Fedora 5 06-05-2005 03:17 PM
How to change permissions of a mounted partition seran Linux - General 2 08-13-2004 02:43 AM

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

All times are GMT -5. The time now is 05:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration