Help answer threads with 0 replies.
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 11-12-2009, 08:10 AM   #1
Adam Sylvester
LQ Newbie
Registered: Nov 2009
Posts: 3

Rep: Reputation: 0
mkfs permissions

I'm working in SUSE 11 in an environment where unformatted USB drives will be plugged in and I want a non-rooot user to be able to format them via mkfs. I couldn't find any settings that allowed non-root to run mkfs (if there is such a setting or a group the user can be added to, please let me know). So, the way I was going to do this was to set up the sudo configuration to allow all users to run "sudo mkfs". This works fine, except that since this is run as root, they don't have permissions to write to the newly-formatted drive.

Is there an option in mkfs to set the initial ownership of the root of the new file system? Specifically, I'd like to just have the non-root user own it. I know I can just do a chmod/chown to set the permissions appropriately but since a non-root user will be doing the mkfs, this won't work. The only other solution I've come up with is to write a shell-script which does the mkfs followed by a chown and set up the sudo configuration to allow all users to run this. It seems like this will work, but I was hoping there was a cleaner solution.

Also, I was wondering if there was a C function call which did the equivalent of a mkfs. I couldn't find anything searching the man pages (though I assume I'd still have similar permissions issues as a non-root user wouldn't be allowed to call the function successfully).

Old 11-12-2009, 08:13 AM   #2
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 891

Rep: Reputation: 119Reputation: 119
did you try using sudo and is sudo setup on the account with proper permissions?


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
Difference between mkfs.vfat and mkfs.msdos? EmrldDrgn Linux - Newbie 6 07-23-2009 04:27 AM
Mkfs gone cthomas Linux - Software 2 02-03-2007 05:16 PM
mkfs blackzone Linux - Newbie 1 01-07-2005 12:52 AM
mkfs bmike1 Linux - Software 1 08-06-2003 02:30 AM
mkfs help SticklerThe1st Linux - Software 3 01-01-2003 06:45 AM > Forums > Linux Forums > Linux - Newbie

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