Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-10-2013, 07:01 PM   #1
Registered: Mar 2013
Posts: 555

Rep: Reputation: Disabled
Why are all partitions owned by the root user?

I am on Debian 7, I have two 500GB partitions. One partition is for the system itself and the other is for Backing up data. The problem I have is that after I type the root password to mount the partition it seems that the root user is the owner of the partition and I need to constantly use the terminal to store files.

The way I would fix this on CentOS is that I would format the parition and select something like "Own this partition". However GParted requries root access and then formats it as thchown -R user /path/to/dire root user. If there is a way to open up GParted and format the partition as the regular user that would be great.

(Add. Ifo)
I have tried chown -R user /media/PARTITIONNAME and I pretty much like the way it works, its a bit more secure meaning that I still need root access to mount the partition, I can access the files/folders that I made when I changed the chown to my user and then to make new folders I need to make them as root or chown the partition again. However this involves too much work and I was wondering if theres just a way to do it like I posted above.
Old 07-10-2013, 07:05 PM   #2
Ser Olmy
Senior Member
Registered: Jan 2012
Distribution: Slackware
Posts: 2,477

Rep: Reputation: Disabled
Partitions don't have owners, but file systems and device nodes do.

You need permissions to access the device node (/dev/something) in order to mount the file system. Once mounted, you need the proper permissions on the mounted file system to read and write data.

You can have the system mount the partition(s) automatically by adding the proper entries to /etc/fstab.
Old 07-10-2013, 07:27 PM   #3
Registered: Mar 2013
Posts: 555

Original Poster
Rep: Reputation: Disabled
Wow I just found the Disk Utility program on Debian lolfail. I think I will leave it as is as its a bit more secure this way. THanks though, lock this.
Old 07-13-2013, 12:13 AM   #4
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2
Posts: 316

Rep: Reputation: 76
A mountable device gets permissions based on who mounted it.

When a memory stick is mounted by root, it is available for read by all users, but they cannot write to it nor delete. For everyone to use the device, it is mounted R/W using mount flags.

Unmount that memory stick and have a user mount it, then it has read and write permission for that user.

See the mount command for more options.
See fstab for putting those options upon mounting directories.
I have a directory setup for each special device that I commonly use.
I then mount that directory, and through fstab it finds the device that should be mounted to it.

Make a directory /cdrom.
You could use the /Media/cdrom that is provided, but some other install programs use it, and also I do not like typing that long of a name to get to a root device.

Create a fstab line for the cdrom
/dev/cdrom /cdrom auto user,rw 0 0

>> mount /cdrom
This will find the entry with /cdrom and mount the device /dev/cdrom, with the filesystem "auto" (which is autodetect) using the flags "user,rw"
The cdrom will be mountable by users and will have R/W permissions.

Pay attention to the permissions of the directory used to mount a device.
It could restrict access if it is a restricted directory.

Last edited by selfprogrammed; 07-13-2013 at 12:27 AM.


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
setuid program owned by non-root user hmadhi Linux - Security 4 11-22-2011 02:33 AM
User Home Directory now owned bt Root AndeAnderson Linux - Newbie 4 10-09-2009 04:52 PM
How can I have a script owned as root and run as root by a user: setuid? stickey bit? abefroman Linux - Newbie 9 04-19-2008 06:15 PM
smbmount- everything is owned by root? can I make it another user? Rotwang Linux - Networking 2 10-03-2007 12:42 AM
Make a file owned by root owned by a user sharpie Linux - Newbie 2 02-26-2004 02:26 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:15 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration