Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
70-persistent-cd.rules not working??
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1800

PostPosted: Sun Nov 25, 2012 3:59 pm    Post subject: 70-persistent-cd.rules not working?? Reply with quote

Wow...this one's had me ripping my hair out for hours...I just don't get it.

My 70-persistent-cd.rules have apparently stopped working entirely on all my gentoo boxes. I'm not getting any of my /dev/cdrom, /dev/dvd etc symlinks...just /dev/scd0, /dev/scd1 etc.

I'm also confused about stuff I keep reading about 70-persistent-cd.rules getting auto generated. I thought maybe I need to regenerate that and edit it, but if I move it somewhere and reboot, it doesn't get generated.

Looking at the wiki:

http://wiki.gentoo.org/wiki/Udev

I noticed that I in fact didn't have a few of those kernel options set...the block layer sg one and the devtmpfs. However enabling them didn't help, and I'm sure I never had them set in the past and had no issues.

I have three machines with the same problem, and I'm getting nowhere. I'm not clear when this changed, as I actually don't do a lot of things that require those links.

Any help would be appreciated.

Tom
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1800

PostPosted: Sun Nov 25, 2012 5:30 pm    Post subject: Reply with quote

Unreal. My 70-persistent-cd.rules file had several auto generated entries for each of my drives, much like what's shown in this (apparently unresolved) post:

https://forums.gentoo.org/viewtopic-t-891630.html

Mine looked like this:

Code:
# This file was automatically generated by the /lib/udev/write_cd_rules
# program, probably run by the cd-aliases-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line
# and set the $GENERATED variable.

# PIONEER_DVD-RW_DVR-111D (pci-0000:00:1f.1-ide-1:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-1:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-1:0", SYMLINK+="dvd", ENV{GENERATED}="1"
# SAMSUNG_CD-RRW_SW-248F (pci-0000:00:1f.1-ide-1:1)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-1:1", SYMLINK+="cdrom2", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-ide-1:1", SYMLINK+="cdrw", ENV{GENERATED}="1"
#  (pci-0000:00:1f.1-scsi-1:0:0:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-1:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-1:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
#  (pci-0000:00:1f.1-scsi-1:0:1:0)
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-1:0:1:0", SYMLINK+="cdrom2", ENV{GENERATED}="1"
ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-1:0:1:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
# LaCie_DVD_Drive_USB2 (pci-0000:02:02.2-usb-0:2:1.0-scsi-0:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="LaCie_LaCie_DVD_Drive_USB2_10000E0008441C1E", SYMLINK+="cdrom3", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="LaCie_LaCie_DVD_Drive_USB2_10000E0008441C1E", SYMLINK+="cdrw3", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="LaCie_LaCie_DVD_Drive_USB2_10000E0008441C1E", SYMLINK+="dvd3", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="LaCie_LaCie_DVD_Drive_USB2_10000E0008441C1E", SYMLINK+="dvdrw3", ENV{GENERATED}="1"

# SAMSUNG_CD-R_RW_SW-248F (pci-0000:00:1f.1-scsi-0:0:1:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:1:0", SYMLINK+="cdrom4", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:1:0", SYMLINK+="cdrw4", ENV{GENERATED}="1"

# PIONEER_DVD-RW_DVR-111D (pci-0000:00:1f.1-scsi-0:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", SYMLINK+="cdrom5", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", SYMLINK+="cdrw5", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", SYMLINK+="dvd5", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:1f.1-scsi-0:0:0:0", SYMLINK+="dvdrw5", ENV{GENERATED}="1"


No matter what I did, NONE of the above pci related entries would work. The only way I seem to be able to get my symlinks is with very simply entries like this, creating links based on the existing sr0 and sr1 names:

Code:
SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="dvd", GROUP="cdrom", ENV{GENERATED}=1
SUBSYSTEM=="block", KERNEL=="sr0", SYMLINK+="cdrom", GROUP="cdrom", ENV{GENERATED}=1
SUBSYSTEM=="block", KERNEL=="sr1", SYMLINK+="cdrom2", GROUP="cdrom", ENV{GENERATED}=1


What's really unusual is that, when I tried plugging in a USB dvd burner I have, it automatically added three lines to my 70-persistent-cd.rules:
Code:

# LaCie_DVD_Drive_USB2 (pci-0000:02:02.2-usb-0:4:1.0-scsi-0:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="LaCie_LaCie_DVD_Drive_USB2_10000E0008441C1E", SYMLINK+="cdrom3", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="LaCie_LaCie_DVD_Drive_USB2_10000E0008441C1E", SYMLINK+="cdrw3", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="LaCie_LaCie_DVD_Drive_USB2_10000E0008441C1E", SYMLINK+="dvd3", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_SERIAL}=="LaCie_LaCie_DVD_Drive_USB2_10000E0008441C1E", SYMLINK+="dvdrw3", ENV{GENERATED}="1"


...yet for the life of me I could NOT get it to generate that stuff for my ide drives. Honest to God...has udev just gotten this buggy??

Tom
Back to top
View user's profile Send private message
toofastforyahuh
Apprentice
Apprentice


Joined: 18 May 2004
Posts: 164

PostPosted: Wed Nov 28, 2012 9:18 am    Post subject: Reply with quote

1. Yes, I also see that udev-171 does not regenerate persistent CD rules upon reboot.
I was about to try udev-189, but upon emerging it a notice appeared saying all persistent network and CD rule generation scripts were removed upstream. (!!) So apparently we need to write our own rules from now on anyway. I promptly gave up on udev-189 without even trying it.

2. I'm no udev rule expert, but I guess "ID_PATH" may be the culprit, even though its values for PCI bus and SCSI ID are correct. My fresh gentoo install had the following rules from somewhere.
Code:

# ATAPI_iHAS124_C (pci-0000:00:11.0-scsi-5:0:0:0)
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-5:0:0:0", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-5:0:0:0", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-5:0:0:0", SYMLINK+="dvd", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_PATH}=="pci-0000:00:11.0-scsi-5:0:0:0", SYMLINK+="dvdrw", ENV{GENERATED}="1"


and this simply did NOT work.

I saw no such ID_PATH variables in the output of this command.

Code:

udevadm  info --query=all --name=/dev/sr0


But there were plenty of other hooks to try. I chose to key off of "ID_MODEL" instead, since I only have one of these optical drives, and it will therefore be unique.

Code:

SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_MODEL}=="ATAPI_iHAS124_C", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_MODEL}=="ATAPI_iHAS124_C", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_MODEL}=="ATAPI_iHAS124_C", SYMLINK+="dvd", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{ID_MODEL}=="ATAPI_iHAS124_C", SYMLINK+="dvdrw", ENV{GENERATED}="1"


and this finally worked.

Quote:

has udev just gotten this buggy??


As a gentoo user since 2004, udev's been buggy since day 1. I still disagree with the whole concept.
Back to top
View user's profile Send private message
jchau
n00b
n00b


Joined: 15 Mar 2007
Posts: 74

PostPosted: Thu Jan 03, 2013 5:33 am    Post subject: Reply with quote

Thanks, toofastforyahuh. I've had the same problem.
Back to top
View user's profile Send private message
gsom
n00b
n00b


Joined: 07 Mar 2012
Posts: 15

PostPosted: Fri Mar 01, 2013 5:17 pm    Post subject: Reply with quote

My version, seems to be more unique:
Getting info from udevadm info --query=all --name=/dev/sr0

Code:
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", DEVPATH=="/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/ata7/host6/target6:0:0/6:0:0:0/block/sr0", SYMLINK+="cdrom", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", DEVPATH=="/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/ata7/host6/target6:0:0/6:0:0:0/block/sr0", SYMLINK+="cdrw", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", DEVPATH=="/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/ata7/host6/target6:0:0/6:0:0:0/block/sr0", SYMLINK+="dvd", ENV{GENERATED}="1"
SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", DEVPATH=="/devices/pci0000:00/0000:00:1c.4/0000:03:00.0/ata7/host6/target6:0:0/6:0:0:0/block/sr0", SYMLINK+="dvdrw", ENV{GENERATED}="1"
Back to top
View user's profile Send private message
jchau
n00b
n00b


Joined: 15 Mar 2007
Posts: 74

PostPosted: Fri Mar 01, 2013 7:21 pm    Post subject: Reply with quote

I think the main idea though is that you don't want "sr0" to be in your match rules because that's not static/persistent. If the kernel decides to name your CD/DVD drive "sr1" instead (because it decided to call another CD/DVD drive "sr0"), the rules you have would break since "sr0" would no longer be on that devpath. As a result, you would have no cdrom, cdrw, dvd, or dvdrw symlinks (not even to the second drive that's now called "sr0" since the new "sr0" may not be on the same devpath).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum