LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   How to set permission of DVD mounted by udev (http://www.linuxquestions.org/questions/linux-hardware-18/how-to-set-permission-of-dvd-mounted-by-udev-639751/)

pumpump 05-04-2008 04:41 AM

How to set permission of DVD mounted by udev
 
I am using Slackware 12.1, KDE 3.5.9, udev 118, hal 0.5.10.

My PC has 1 IDE ATAPI DVD-ROM drive under /dev/hdb, and 1 SATA DVD writer under /dev/sr0. Both are not in /etc/fstab.

When I try to put a DVD-R into my DVD-ROM drive, KDE can auto-mount it to /media/<DVD LABEL>. The /.hal-mtab under /media shows:

Quote:

/dev/hdb 1000 0 udf nosuid,nodev,uhelper=hal,uid=1000 /media/<DVD LABEL>
But the directory permission is 000
Quote:

d--------- 2 me root 172 2008-04-14 23:25 /media/<DVD LABEL>
Same thing for the DVD writer.

I tried to look through the /etc/udev/rules.d/, but was not sure which rule mounts it to /media/<DISK LABEL>, or sets the permission. I tried to add my own rule to /etc/udev/rules.d/10-local.rules with the following entries:
Quote:

SUBSYSTEM=="block", KERNEL=="hdb", SYMLINK+="dvd", GROUP="cdrom"
SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="dvdrw", GROUP="cdrom"
But seems it does not work, the alias dvd and dvdrw still points to sr0
Quote:

lrwxrwxrwx 1 root root 3 2008-05-05 00:10 /dev/dvd -> sr0
lrwxrwxrwx 1 root root 3 2008-05-05 00:10 /dev/dvdrw -> sr0
Does anyone knows how to properly configure HAL and UDEV so that normal user can open the mounted DVD?

Smedley 05-04-2008 06:02 AM

Is the user in the CDROM group?

pumpump 05-04-2008 07:47 AM

Quote:

Originally Posted by Smedley (Post 3142008)
Is the user in the CDROM group?

Hi. Yes, I am in cdrom group.

mdjenkins 05-04-2008 09:06 AM

If the drives are showing up in /dev then I don't see what creating a udev rule is going to do besides giving us consistent /dev names for the device.
I'm not certain what daemons/groups KDE uses to handle HAL events but I would start by looking there. A quick google for KDE, HAL and Daemon returned this page - http://wiki.kde.org/tiki-index.php?p...US+for+KDE+3.x Which should help despite being a few years old. Of course, you do not want to blindly follow the instructions on this page but they should give you a good idea of how HAL and Dbus should work on KDE.

You could try placing a line in fstab to supercede how and where these devices get mounted. Personally I would rather get dbus and hal working like their supposed to. good luck

pumpump 05-04-2008 09:54 AM

Thanks. Yeah, upon more searching I think hal is handling the removable media, but still not sure how to get it fixed. I tried to put the two devices in fstab, but after doing that KDE mounting dialog hangs, kded uses 100% CPU (on one core of my Pentium D), although the mount actually succeeded behind the scene. After clicking Cancel of the mount dialog, kded still runs at 100% CPU.

Killing of kded showed the following trace:

(no debugging symbols found)
...
(no debugging symbols found)
[KCrash handler]
#5 0xb64d91af in ?? () from /usr/lib/libdbus-1.so.3
#6 0x00000000 in ?? ()


Trying fstab way under XFCE works though.

And I just tried the same thing (auto-mounting without fstab) under my Ubuntu 8.04 and got the same error (permission is set to 000). So it is not a KDE and Slackware specific problem.

mdjenkins 05-04-2008 11:00 AM

digging a bit further it looks like KDE uses a combination of ivman, pmount, dbus and hal to automount:
http://gentoo-wiki.com/HOWTO_ivman
you may want to check what version of ivman you are using.
I also found a possible solution on the ubuntu forums
http://ubuntuforums.org/showpost.php...42&postcount=8

onebuck 05-04-2008 12:32 PM

Hi,
Quote:

Originally Posted by pumpump (Post 3142066)
Hi. Yes, I am in cdrom group.

What about the other groups;

Code:

floppy audio video cdrom plugdev
Especially the 'plugdev' group.

pumpump 05-04-2008 09:17 PM

Quote:

Originally Posted by mdjenkins (Post 3142216)
digging a bit further it looks like KDE uses a combination of ivman, pmount, dbus and hal to automount:
http://gentoo-wiki.com/HOWTO_ivman
you may want to check what version of ivman you are using.
I also found a possible solution on the ubuntu forums
http://ubuntuforums.org/showpost.php...42&postcount=8

Thanks. Slackware does not use ivman (at least there is no such package).
I will try the ubuntu forum solution tonight and update.
Update - tried the ubuntu forum way. Added a rule to /etc/hal/fdi/policy. Does not work.

<match key="volume.fstype" string="udf">
<merge key="volume.policy.mount_option.umask" type="string">0000</merge> <!-- or whatever you desire -->
</match>

pumpump 05-04-2008 09:18 PM

Quote:

Originally Posted by onebuck (Post 3142287)
Hi,


What about the other groups;

Code:

floppy audio video cdrom plugdev
Especially the 'plugdev' group.

Thanks onebuck, yes my user is in all those groups, including plugdev.

pumpump 05-05-2008 11:31 AM

I found something. The problem is not due to hardware or software, it is related to the DVD. Somehow when I put in a DVD(+R) disk burnt using K3B (somemore with more than 4gb file), it has this problem. If I put in a CD-ROM, a normal DVD, or a DVD+R burnt under Windows, it can be mounted with right permissions (when device is not in fstab, didn't try the other way).

The DVD was burnt using k3b with the following settings:

Does anyone know what setting caused this problem? Thanks.

pumpump 05-06-2008 11:11 AM

Another update. I found some other similar problem reports.

e.g. http://bugs.gentoo.org/show_bug.cgi?id=213399
http://support.zenwalk.org/viewtopic.php?f=6&t=14373

So confim I am not alone :)

If the DVDs I burnt (using k3b and cdrtools 2.1.1a38) are mounted using iso9660 type, the permissions are ok. If mounted using udf, the permission is "d---------".

I am not sure whose problem is this... cdrtools? mount? or something else?

But before that is solved, anyone knows how to instruct hal to mount the DVDs using iso9660 instead of udf? As I said above, if I put the dvd drives into fstab with type iso9660, kded (kde mediamanager) will hang at mounting time, so cannot do that.

ActiveMan 07-24-2008 05:33 PM

The same problem here
 
Hello, I'm also using Slackware 12.1, KDE 3.5.9 and I'm having the same problem. If I mount it manually with:

$ sudo mount -t iso9660 /dev/cdrom /mnt/cdrom
$ ll -d /mnt/cdrom
dr-xr-xr-x 2 root root 2048 2008-07-24 23:00 /mnt/cdrom/

It is correctly mounted. However, by default, KDE mounts it as UDF and the same problem appears:

$ ll -d /mnt/cdrom
d--------- 2 root root 184 2008-07-24 23:00 /mnt/cdrom/

In my Mac OS X I have the same problem because OS X mounts the DVD by default with UDF.

In my opinion, this is due to a problem in K3B burning options.

ActiveMan 08-03-2008 04:42 AM

How I solved it
 
Hello I have found that K3B uses growisofs to create and burn the DVD and there is the problem. Specifically, growisofs calls mkisofs without the -r option, hence the UDF iso is created without permissions.

To solve it I have done it manually:

1) Create a UDF iso image with the -r to allow reading and the -V option for the DVD title:

$ mkisofs -udf -r -V DVD75 -o dvd75.iso /home/flh/DVD75

2) Burn the CD logged as root:
# cdrecord -scanbus
Cdrecord-ProDVD-ProBD-Clone 2.01.01a38 (i686-pc-linux-gnu) Copyright (C) 1995-2008 Jörg Schilling Linux sg driver version: 3.5.27
Using libscg version 'schily-0.9'.
scsibus2:
2,0,0 200) 'ATA ' 'HTS541080G9SA00 ' 'MB4O' Disk
2,1,0 201) *
2,2,0 202) *
2,3,0 203) *
2,4,0 204) *
2,5,0 205) *
2,6,0 206) *
2,7,0 207) *
scsibus1000:
1000,0,0 100000) 'MATSHITA' 'DVD-RAM UJ-832S ' '1.00' Removable CD-ROM
1000,1,0 100001) *
1000,2,0 100002) *
1000,3,0 100003) *
1000,4,0 100004) *
1000,5,0 100005) *
1000,6,0 100006) *
1000,7,0 100007) *

# cdrecord -v dev=1000,0,0 dvd75.iso #It works

If I make use of growisofs to burn the CD, it is written without permissions:

# growisofs -Z /dev/dvd=dvd75.iso # It fails

jiml8 08-03-2008 12:41 PM

Quote:

Originally Posted by ActiveMan (Post 3225391)
In my opinion, this is due to a problem in K3B burning options.

You are no doubt aware that you can set the burning options that K3B uses?


All times are GMT -5. The time now is 05:14 PM.