LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-12-2009, 07: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).

Thanks.
adam
 
Old 11-12-2009, 07:13 AM   #2
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

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


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

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

All times are GMT -5. The time now is 03:24 PM.

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