public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "David M. Fellows" <fellows@unb.ca>
To: gentoo-user@lists.gentoo.org, Mark Knecht <markknecht@gmail.com>
Subject: Re: [gentoo-user] Re: 4 machines - no /dev/cdrom or /dev/dvd anymore
Date: Sat, 05 Jan 2013 19:00:46 -0400	[thread overview]
Message-ID: <201301052300.r05N0ltV016453@iapetus.its.unb.ca> (raw)
In-Reply-To: <CAK2H+ec+5wA0D2vLYMnmnDY29qP+JYFvVCSVfmo0b7Fhnvm74Q@mail.gmail.com>

On Sat, 5 Jan 2013 12:44:07 -0800 
Mark Knecht wrote -
> On Sat, Jan 5, 2013 at 11:53 AM, Mark Knecht <markknecht@gmail.com> wrote:
> > I think I touched on this a couple of weeks ago but never had time to
> > dig in. At that time I thought this problem was only on one machine
> > but now I see it's on every machine I've looked at this morning. Not a
> > single machine has /dev/cdrom anymore, nor /dev/dvd or any of the
> > other incantations that have existed forever.
> >
> <SNIP>
> 
> OK, this is solved using udevadm and changing the
> 70-persistent-cd.rules file to key off a different identifier.
> 
> Old way:
> #SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
> ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-0:0:0:0", SYMLINK+="cdrom",
> ENV{GENERATED}="1"
> 
> New way:
> SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
> ENV{ID_MODEL}=="Optiarc_DVD_RW_AD-7241S", SYMLINK+="cdrom",
> ENV{GENERATED}="1"


I had the same problem. Came to a different solution. Following for 
your amusement and edifcation are my notes taken as I debugged.
------------
==2012-11-26

udev is not creating /dev/cdrom symlinks so all my scripts that use
/dev/cdrom  or attempt to moun /dev/cdrom fail.
Not sure when this actually started happening. I last burned a dvd on Oct
23 so it was OK then. /etc/udev/roules.d/70-persistent-cdrom.rules is dated
Oct 30. It looks plausible.

Documentation implies that removing said file and rebooting will cause udev
to recreate it "correctly". I was unable to cause it to be rebuilt,
correctly or otherwise, in this manner.  

==2012-11-27
Created /dev/cdrom -> /dev/sr0 symlink manually because burn script wants
to mount /dev/cdrom on /mnt/cdrom.

This time the backup copy/burn went flawlessly. I think udev is also
causing problems.

70-persistent-cd.rules may be wrong for my current kernel
I don't think the ID_PATH has scsi as a path anymore.

==2012-12-04
I syncd on Friday(Dec 1), but did not do emerge.

Doing the regular upgrade emerge.
  new virtual/udev-171  I guess this is prep for the proposed udev fork.
  open-rc goes from 0.11.5 to 0.11.6  This might bear on cd.rules issue.
  But apparently not, there seems to be no change.

  No config files
  revdep-rebuild was clean
  udev should be restarted. (reboot might be better)

On reboot 70-persistent-net.rules was created. It was the same as the old
one. No cd rules file.

I then inserted my memorex usb stick that has a "cdrom" partition on it.
Lo! a 70-persistent-cd.rules file appeared with 2 lines for the memorex.
plus /dev/cdrom /dev/cdrw symlinks to sr1.

If I pull the stick sr1, cdrom, and cdrw go away. They come back if I
reinsert it. 70*cd.rules remains unchanged.

Note: Running udevadm control --log-priority=info
puts copious amounts of stuff into /var/log/everything/current
Debug even more
Remember to reset it to err when not experimenting.

Findings:

/lib/udev/rules.d/75-cd-aliases-generator.rules
invokes

/lib/udev/write_cd_rules 
to actually write the /etc/udev/rules.d/70-persistent-cd.rules file.

for usb cdroms it calls it with "by-id" as an arg. Non usb device no arg 
which defaults to "by-path" in the callee.

by-path requires $ID_PATH variable to have a value. Turns out that 
   udevadm info --query=all --name=/dev/sr0
shows that for the built -in drive there is no BY_PATH variable set.
(it is set for sr1 the usb stick!)
So it looks like the write_cd_rules script bails with return code of 1
without actually writing anything.

Solution to try:
Copy /lib/udev/rules.d/75-cd-aliases-generator.rules to /etc/udev/rules.d 
and edit it there to invoke /write_cd_rules with "by-id" in both cases 
and see what happens.

==2012-12-05
Yess!
Did above and it "just worked".
----------------
My 70-persistent-cd.rules file now contains:

# HL-DT-ST_DVDRAM_GH22NS70 ()
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="HL-DT-ST_DVDRAM_GH22NS70_K24B5GJ2632", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="HL-DT-ST_DVDRAM_GH22NS70_K24B5GJ2632", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="HL-DT-ST_DVDRAM_GH22NS70_K24B5GJ2632", SYMLINK+="dvd", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="HL-DT-ST_DVDRAM_GH22NS70_K24B5GJ2632", SYMLINK+="dvdrw", ENV{GENERATED}="1"

# TD_ID_UFD_301B (pci-0000:00:1d.0-usb-0:1.2:1.0-scsi-0:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="Memorex_TD_ID_UFD_301B_07630E9000EB-0:0", SYMLINK+="cdrom1", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="Memorex_TD_ID_UFD_301B_07630E9000EB-0:0", SYMLINK+="cdrw1", ENV{GENERATED}="1"

Modifying 75-cd-aliases-generator.rules has an advantage over Mark's solution 
in that it will automatically catch all installed cdrom- type devices and it 
should add the dvd rules as appropriate to the device's capabilities.

Dave F


  reply	other threads:[~2013-01-05 23:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-05 19:53 [gentoo-user] 4 machines - no /dev/cdrom or /dev/dvd anymore Mark Knecht
2013-01-05 20:36 ` J. Roeleveld
2013-01-05 20:46   ` Mark Knecht
2013-01-05 20:37 ` Randy Barlow
2013-01-05 20:44 ` [gentoo-user] " Mark Knecht
2013-01-05 23:00   ` David M. Fellows [this message]
2013-01-06 11:19   ` Mick
2013-01-06 15:55     ` Mark Knecht
2013-01-07  1:22       ` Dale
2013-01-07  1:44         ` Mark Knecht
2013-01-07  1:53           ` William Kenworthy
2013-01-07  2:06             ` Mark Knecht
2013-01-07  2:08             ` Dale
2013-01-07  2:29               ` Dale
2013-01-07  4:53                 ` Mark Knecht
2013-01-07  7:35                   ` Dale
2013-01-07 22:53                     ` Mick
2013-01-08  7:09                       ` J. Roeleveld
2013-01-08  7:49                         ` Mick
2013-01-08 11:53                       ` Dale
2013-01-07 15:18         ` Grant Edwards
2013-01-07 17:37           ` Mark Knecht
2013-01-07 23:25             ` Alan McKinnon
2013-01-08  1:05               ` Mark Knecht
2013-01-08  1:15                 ` Michael Mol
2013-01-08  6:42                   ` Mick
2013-01-08  9:21                 ` Alan McKinnon
2013-01-08 20:26                   ` Mark Knecht
2013-01-08 21:12                     ` Alan McKinnon
2013-01-08 21:31                       ` Michael Mol
2013-01-09  3:22                     ` Dale
2013-01-11 14:31                       ` Mark Knecht
2013-01-11 14:58                         ` Dale
2013-01-06  4:01 ` [gentoo-user] " Dale

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201301052300.r05N0ltV016453@iapetus.its.unb.ca \
    --to=fellows@unb.ca \
    --cc=gentoo-user@lists.gentoo.org \
    --cc=markknecht@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox