VectorLinux
April 24, 2014, 02:47:39 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: permissions for scsi tapes  (Read 1651 times)
frayja2002
Member
*
Posts: 16


« on: May 04, 2010, 06:03:05 am »

Hi all

How can I give the tape group write access to the tape drives on my system?

I have been trying to use the QIC drive under VL6 light but am getting permission denied errors when trying to use mt (or any command)

If I use sudo everything works ok, but I do not want to do this. I have added myself to the tape group but it does not have permission ?!?

Looking at the permissions of the tape st0 under dev it says

crw-rw---- root root

How can I change this permanently so it is root:tape

Thanks
Alex
Logged
Andy Price
Packager
Vectorite
****
Posts: 237


« Reply #1 on: May 04, 2010, 07:20:30 am »

Try the change group command e.g chgrp tape /dev/st0 and you should end up with tape as the group if it behaves as a normal file.
Andy
Logged
frayja2002
Member
*
Posts: 16


« Reply #2 on: May 04, 2010, 07:45:43 am »

you can do this but as soon as you reboot the permissions return to root:root

Alex
Logged
rbistolfi
Packager
Vectorian
****
Posts: 2265


« Reply #3 on: May 04, 2010, 11:02:57 am »

Maybe creating an udev rule, like:

Code:
KERNEL=="st*", BUS=="scsi", SYMLINK+="tape", OWNER="root", GROUP="tape", MODE="0664"

More on udev: http://reactivated.net/writing_udev_rules.html

HTH

EDIT: maybe you should add something to match against the device serial id.
« Last Edit: May 04, 2010, 11:05:12 am by rbistolfi » Logged

"There is a concept which corrupts and upsets all others. I refer not to Evil, whose limited realm is that of ethics; I refer to the infinite."
Jorge Luis Borges, Avatars of the Tortoise.

--
Jumalauta!!
Andy Price
Packager
Vectorite
****
Posts: 237


« Reply #4 on: May 04, 2010, 09:59:04 pm »

I found an old post on another forum discussing a similar problem to yours which also talked about udev: http://www.linuxforums.org/forum/suse-linux-help/67179-dev-ttys0-permissions-issue.html
Maybe there's already a udev rule if the tape drive is mounting correctly. If there is then you could edit the group and permissions on that.
Logged
frayja2002
Member
*
Posts: 16


« Reply #5 on: May 04, 2010, 11:50:35 pm »

Thank you Andy Price

I had a look through 50-udev-default.rules and found there was no reference to st or nst (even though the section was labeled as tapes). I added the following lines to the section labeled "# block, tapes, block-releated" and it seems to have done the trick...

KERNEL=="st[0-9]*",         GROUP="tape", MODE="0660"
KERNEL=="nst[0-9]*",         GROUP="tape", MODE="0660"

An "ls" of the dev dir now shows nst0 as being "crw-rw---- root tape"

Thanks for the help
Alex
Logged
Andy Price
Packager
Vectorite
****
Posts: 237


« Reply #6 on: May 06, 2010, 08:04:59 am »

And thanks to rbistolfi for the link about udev. Interesting reading. The great thing about Linux is that you can edit most config files easily, though understanding what you're doing is not necessarily so easy Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!