VectorLinux
September 02, 2014, 11:02:23 am *
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: changing permissions with 'chmod' every bootup  (Read 2127 times)
vector2007
Member
*
Posts: 4


« on: November 12, 2007, 05:28:39 pm »

Hey all, i've only started using Linux recently and i'm really enjoying Vector Linux. I've got an external USB dvd-rewriter which i would like to use to watch films. the drive is known as /dev/sr0 for me. now as root i have no problem playing dvds in xine when the dvd device is set to /dev/sr0. but as normal user i no longer have the right permissions to do this. now after some reading i figured out how to change permissions. so if i log in as root then type "chmod 777 /dev/sr0" in the command prompt and then log in as a normal user i have the correct permissions to allow me to watch dvds once again. now the problem is that each bootup the system forgets the changes i have made to the permissions. so my question is this: how do i get the system to do "chmod 777 /dev/sr0' every time it starts up so when i log in as a normal user i have the right permissions to watch dvds on my external dvd drive.

many thanks in advance
« Last Edit: November 12, 2007, 05:33:41 pm by vector2007 » Logged
saulgoode
Vectorite
***
Posts: 340



« Reply #1 on: November 12, 2007, 06:09:36 pm »

The preferred method would be to add your user to the group 'cdrom'; the device should already allow members of that group to have Read and Write access. I believe you would use VASM to add yourself to a group (I am not on VL machine right now).
Logged

A complex system that works is invariably found to have evolved from a simple system that works.
bigpaws
Vectorian
****
Posts: 1847


« Reply #2 on: November 12, 2007, 08:37:44 pm »

You can also edit /etc/fstab and make it like this:

/dev/cdrom     /mnt/cdrom auto noauto,users,rw 0 0

HTH

Bigpaws
Logged
vector2007
Member
*
Posts: 4


« Reply #3 on: November 13, 2007, 01:37:31 am »

hey, unfortunately i had already tried editing fstab and it didn't fix the problem. i tried editing the /dev/cdrom line as you suggested (to give users read-write access) and then tried the same with the /dev/cdwriter, /dev/dvdrom, /dev/dvdwriter lines with no success. tried adding a /dev/sr0 line (since my external dvd writer is called /dev/sr0) and that didn't work either. only solution i have found is to manually do the command 'chmod 777 /dev/sr0' from root then log in as normal user. so if you got a way of making the system execute 'chmod 777 /dev/sr0' on each startup even when i log in as a normal user and not root then i would be grateful Smiley thanks in advance
Logged
Freston
Vectorite
***
Posts: 165


« Reply #4 on: November 13, 2007, 03:29:11 am »

That _is_ strange. You should not have to use chmod in the /dev directory.

But I do think I know the reason adding the /dev/cdrom line to fstab doesn't work. /dev/cdrom and all the others like /dev/dvd /dev/dvdwriter are symbolic links to devices. Issuing a file command let's you know to which one. Try:
Code:
file /dev/cdrom

Just checking. Have you tried with this literally in /etc/fstab?
/dev/sr0     /mnt/cdrom auto noauto,users,rw 0 0

Can you post the contents of your fstab here?
Code:
cat /etc/fstab

The reason I go on about fstab is because these things need to be done from there. You know, you can always put <chmod 777 /dev/sr0> in /etc/rc.d/rc.M, but I wouldn't recommend it.
Logged
vector2007
Member
*
Posts: 4


« Reply #5 on: November 13, 2007, 04:31:25 am »

hey, thanks for your reply, i have tried the line you suggested in fstab (/dev/sr0     /mnt/cdrom auto noauto,users,rw 0 0), however my system doesn't ever mount /dev/sr0 as anything other than /mnt/vl-hot/sr/vol0, which it does automatically if there's a dvd in the drive when the pc boots up. it's mounted similarly to my usb pen drive /dev/sda which gets mounted to /mnt/vl-hot/sda/vol. anyway long and short of it is i can't see how else i can edit fstab to help me in this situation. it may be of significance i got a dvd drive in my laptop as well but i prefer to use the external usb one because its a better drive. anyhow i did try adding chmod 777 /dev/sr0 to my /etc/rc.d/rc.M and that did the trick, but if that's an inelegant solution i would love to find a more elegant one Smiley cheers in advance

here's my fstab (without any of the lines i've tried to get /dev/sr0 my external usb dvd drive to work):

# The Linux partitions
/dev/hda6 / ext3  defaults  0  1
/dev/hda8 /home ext3 defaults  0 2

# Shared Windows/Linux partition
#/dev/hda1   /mnt/dos  msdos  umask=0   0  0
/dev/hda5   /mnt/win  vfat   fmask=111,dmask=0,quiet,shortname=mixed,user,rw  0  0   <----- i edited this to let me read/write to my fat32 shared windows/linux partition
#/dev/hda1   /mnt/win  ntfs   umask=0   0  0

# Floppy disks
# The 'noauto' option indicates that the file system should not be mounted
# with 'mount -a' 'user' indicates that normal users are allowed to mount
# the file system.
/dev/fd0   /mnt/floppy   auto   defaults,noauto,user   0 0
#/dev/fd1  /mnt/floppy   auto   defaults,noauto,user   0 0

# If you have a ls-120 floppy drive, it could be on /dev/hda b c d etc.
#/dev/hdd   /mnt/ls120   auto   defaults,noauto,user   0 0

# CDROM, CDWRITER, DVD
/dev/cdrom   /mnt/cdrom   iso9660      users,noauto,ro
/dev/cdwriter   /mnt/cdwriter   iso9660      users,noauto,ro
/dev/dvd   /mnt/dvd   iso9660      users,noauto,ro
/dev/dvdwriter   /mnt/dvdwriter   iso9660      users,noauto,ro

# NFS file systems:
#linux01.gwdg.de:/suse/6.3/i386.de  /mnt/nfs  nfs  defaults  0 0

# proc file system:
proc   /proc   proc   defaults   0 0

# Unix98 devpts filesystem:
none  /dev/pts  devpts  gid=5,mode=666  0 0

# Shared memory filesystem:
tmpfs   /dev/shm    tmpfs defaults 0  0

# Basic USB filesystem
sysfs  /sys  sysfs  defaults  0 0

# example of a VFAT USB pendrive
#/dev/sda1  /mnt/pendrive vfat   fmask=111,dmask=0,noauto,user,quiet,shortname=mixed 0 0


# Swap partitions
# The 'sw' option means auto activating with 'swapon -a'.
/dev/hda7   none   swap   sw   0  0
Logged
bigpaws
Vectorian
****
Posts: 1847


« Reply #6 on: November 13, 2007, 07:11:27 am »

Ok I missed the external DVD part, oops.

Make an entry in /etc/fstab:

/dev/sr0 /mnt/dvd auto noauto,users,rw 0 0

see if that works. That should mount to /mnt/dvd and then as long
as media player looks at that location it should be good.

Bigpaws
Logged
vector2007
Member
*
Posts: 4


« Reply #7 on: November 13, 2007, 02:32:39 pm »

yeah sadly the problem is that whatever i try to mount /dev/sr0 as in fstab it will always end up mounting it automatically as /mnt/vl-hot/sr/vol0 - and that is still problematic for my dvd player. editing /etc/rc.d/rc.M with 'chmod 777 /dev/sr0' worked a treat tho, not sure if it has any downsides. still a bit wierd that there is something that can mount /dev/sr0 other than as instructed by fstab tho.
Logged
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #8 on: November 13, 2007, 02:56:47 pm »

It seems the drive is detected as a mass storage device when media is inside on plugging in. So udev calls vl-hot and it will dutifully mount it. You can blacklist devices in such a situation, using the vl-hot-config application in the System menu. In the "Mount" tab, "Device selectivity", "Exclude" text box, try sr* or sr0.

Strange that a vl-hot mount is not accessible to normal users, I suppose the filesystem is not one of those recognized and so mounts with default parameters. It wasn't really intended to mount removable media like that. If you can, post the output of the "mount" command with a CD and a DVD inside, so I can add support for them.
« Last Edit: November 13, 2007, 02:59:52 pm by Joe1962 » Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
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!