Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-14-2013, 01:42 AM
|
#1
|
Member
Registered: Apr 2012
Location: Russia
Distribution: Slackware64-current
Posts: 272
Rep:
|
My CD/DVD drives is locked when disc inserted
Hi to all!
I have a problem with locking my CD/DVD drives.
Code:
# sdparm --get LOCK /dev/sr{0,1}
/dev/sr0: TOSHIBA CD/DVDW SDR5372V TU11 [cd/dvd]
LOCK 1 [cha: n, def: 1]
/dev/sr1: LG CD-ROM CRD-8522B 1.02 [cd/dvd]
LOCK 1 [cha: n, def: 1]
# cat /etc/sysctl.conf
dev.cdrom.lock=0
dev.cdrom.autoclose=0
# sysctl -q dev.cdrom.lock
dev.cdrom.lock = 0
My question is why the sysctl parameters isn't applied? Thanks.
UPD: When I try to change it with sdparm, I get:
Code:
# sdparm --clear=LOCK /dev/sr{0,1}
/dev/sr0: TOSHIBA CD/DVDW SDR5372V TU11 [cd/dvd]
change_mode_page: page offset failed: given response length too small, offset=8 given_len=8 bd_len=0
/dev/sr1: LG CD-ROM CRD-8522B 1.02 [cd/dvd]
change_mode_page: failed setting page: CD/DVD (MM) capabilities and mechanical status (MMC)
UPD2: I cannot eject disks from drives by button on drive... 
Last edited by yars; 05-14-2013 at 03:27 PM.
Reason: update
|
|
|
05-14-2013, 06:41 PM
|
#2
|
Senior Member
Registered: Sep 2004
Distribution: slackware
Posts: 4,758
|
Is udev running?
|
|
|
05-14-2013, 06:44 PM
|
#3
|
Member
Registered: Jul 2012
Posts: 234
Rep: 
|
After you placed the entried in:
Did you do a try a:
To reload the entries in /etc/sysctl.conf?
I understand you cannot eject disks by button, however does it eject when you use the command:
|
|
|
05-14-2013, 11:56 PM
|
#4
|
Member
Registered: Apr 2012
Location: Russia
Distribution: Slackware64-current
Posts: 272
Original Poster
Rep:
|
Quote:
Originally Posted by rkelsen
Is udev running?
|
Yes, and it works fine. I'm can't find out the udev rule that enable, disable or override the sysctl settings.
Quote:
To reload the entries in /etc/sysctl.conf?
|
Yes, entries in sysctl.conf is applied, but does not work. For experience, I try:
Code:
# cat -A /etc/sysctl.conf
dev.cdrom.lock=0$
$
# sysctl -p
dev.cdrom.lock = 0
# cat /proc/sys/dev/cdrom/lock
0
Quote:
however does it eject when you use the command
|
Yes, I know and so far doing so...
Last edited by yars; 05-15-2013 at 12:24 AM.
|
|
|
05-15-2013, 03:46 AM
|
#5
|
Member
Registered: Apr 2013
Distribution: Slackware
Posts: 81
Rep: 
|
Probably a stupid question, but does not some app automount drive after a disc is inserted ?
Can you see anything related in an output of mount command ?
|
|
|
05-16-2013, 08:42 AM
|
#6
|
LQ Veteran
Registered: May 2008
Posts: 7,136
|
It's udev: lib/udev/rules.d/60-cdrom_id.rules
Code:
# media eject button pressed
ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode", GOTO="cdrom_end"
# import device and media properties and lock tray to
# enable the receiving of media eject button events
IMPORT{program}="cdrom_id --lock-media $devnode"
I comment both of those out on my systems, but doing so mgiht stop the removable-volume management features of the desktop environment from working with cdroms: I use an autofs mapping for removable media, so this side-effect doesn't bother me.
|
|
1 members found this post helpful.
|
05-16-2013, 10:14 AM
|
#7
|
Member
Registered: Apr 2012
Location: Russia
Distribution: Slackware64-current
Posts: 272
Original Poster
Rep:
|
GazL, thanks you, I need to continue to be careful. I was looking through this rule, but did not notice anything similar to the one shown you. Also thanks to all for answers. The problem is solved:
Code:
# cp /lib/udev/rules.d/60-cdrom_id.rules /etc/udev/rules.d/60-cdrom_id.rules
# sed 's/IMPORT/#
IMPORT/' /etc/udev/
rules.d/60-cdrom_id.rules
#kill -HUP $(pidof `which udevd`)
Last edited by yars; 05-16-2013 at 10:20 AM.
|
|
|
05-16-2013, 10:17 AM
|
#8
|
LQ Veteran
Registered: May 2008
Posts: 7,136
|
Quote:
Originally Posted by yars
I was looking through this rule, but did not notice anything similar to the one shown you
|
Ah, yes. I often forget that I'm running 'current'. Sorry about that.
|
|
|
12-19-2013, 10:39 AM
|
#9
|
Member
Registered: Apr 2012
Location: Russia
Distribution: Slackware64-current
Posts: 272
Original Poster
Rep:
|
Hi all again. I decided to go back to this problem again. Removing in the /etc/udev/rules.d/60-cdrom_id.rules from line
Code:
IMPORT{program}="cdrom_id --lock-media $devnode"
the "--lock-media" parameter makes able to eject the media when it is mounted, so it is not a good solution. I tried to number experiences with udev, but cannot get the DISK_EJECT_REQUEST event. I have enabled the in-kernel-polling by placing into a /etc/udev/rules.d/60-persistent-storage.rules line
Code:
# enable in-kernel media-presence polling
ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", ATTR{parameters/events_dfl_poll_msecs}="2000"
+ ACTION=="add", ATTR{removable}=="1", ATTR{events_poll_msecs}=="-1", ATTR{events_poll_msecs}="2000"
that is disabled by default. And that is works same as when in-kernel-polling is disabled: when disc is inserted, but not mounted, I can eject a disc by pressing the button on a drive, when disc is mounted, drive is locked, and events from that button is not received. /sys/block/sr0/events contains:
Code:
cat /sys/block/sr0/events
media_change eject_request
Why this contain a two records? Any ideas? Thanks again.
|
|
|
All times are GMT -5. The time now is 07:24 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|