Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.hardware > #918 > unrolled thread

CDROM drive by UUID in fstab

Started byHaines Brown <haines@HistoricalMaterialism.info>
First post2011-12-21 15:37 -0500
Last post2011-12-23 22:37 -0500
Articles 11 — 5 participants

Back to article view | Back to comp.os.linux.hardware


Contents

  CDROM drive by UUID in fstab Haines Brown <haines@HistoricalMaterialism.info> - 2011-12-21 15:37 -0500
    Re: CDROM drive by UUID in fstab Bit Twister <BitTwister@mouse-potato.com> - 2011-12-21 21:49 +0000
    Re: CDROM drive by UUID in fstab J G Miller <miller@yoyo.ORG> - 2011-12-21 23:20 +0000
    Re: CDROM drive by UUID in fstab "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2011-12-21 20:00 -0500
      Re: CDROM drive by UUID in fstab Haines Brown <haines@HistoricalMaterialism.info> - 2011-12-22 10:54 -0500
        Re: CDROM drive by UUID in fstab J G Miller <miller@yoyo.ORG> - 2011-12-22 18:08 +0000
          Re: CDROM drive by UUID in fstab Haines Brown <haines@HistoricalMaterialism.info> - 2011-12-22 20:03 -0500
        Re: CDROM drive by UUID in fstab Bill Marcum <bill@lat.localnet> - 2011-12-22 17:54 -0500
          Re: CDROM drive by UUID in fstab Haines Brown <haines@HistoricalMaterialism.info> - 2011-12-23 06:15 -0500
            Re: CDROM drive by UUID in fstab Bit Twister <BitTwister@mouse-potato.com> - 2011-12-23 23:31 +0000
            Re: CDROM drive by UUID in fstab "David W. Hodgins" <dwhodgins@nomail.afraid.org> - 2011-12-23 22:37 -0500

#918 — CDROM drive by UUID in fstab

FromHaines Brown <haines@HistoricalMaterialism.info>
Date2011-12-21 15:37 -0500
SubjectCDROM drive by UUID in fstab
Message-ID<877h1pwti1.fsf@engels.HistoricalMaterialism.info>
I went over to UUID for my hard disks and some external storage
devices. I also use ubsmount for usb sticks. However, I don't know what
to do about my DVD drive. It does not seem to have a unique ID number:

  dmesg | grep DVD
  ata1.01: ATAPI: Optiarc DVD RW AD-7240S, 1.02, max UDMA/100
  scsi 0:0:1:0: CD-ROM    Optiarc  DVD RW AD-7240S  1.02 PQ: 0 ANSI: 5

For some reason, my DVD drive seems to be assigned a somewhat random
interface:

  $ ls /dev | grep dvd
  dvd5
  dvdrw5

In any case, mplayer can't play DVDs. It spins up, but after a couple
minutes trying to access the DVD drive, it just stops. I have trouble
understanding this return:

  $ mplayer dvd://1 /dev/dvd5
  MPlayer SVN-r31918 (C) 2000-2010 MPlayer Team
  ...
  mplayer: could not connect to socket
  mplayer: No such file or directory
  Failed to open LIRC support. You will not be able to use your remote control.
  
  Playing dvd://1.
  libdvdread: Using libdvdcss version 1.2.10 for DVD access
  libdvdread: Can't stat /dev/dvd
  No such file or directory
  libdvdread: Could not open /dev/dvd
  Couldn't open DVD device: /dev/dvd (No such file or directory)
  No stream found to handle url dvd://1

  Playing /dev/dvd5.
  Seek failed
  libavformat file format detected.
  [mp3 @ 0x92d9370] Header missing
    Last message repeated 139 times
  [mp3 @ 0x92d9370] big_values too big
  [mp3 @ 0x92d9370] Header missing
    Last message repeated 997 times
  [mp3 @ 0x92e7c90] Estimating duration from bitrate, this may be inaccurate
  [lavf] stream 0: audio (mp1), -aid 0
  ==========================================================================
  Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
  big_values too large!
  AUDIO: 8000 Hz, 2 ch, s16le, 8.0 kbit/3.12% (ratio: 1000->32000)
  Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
  ==========================================================================
  AO: [alsa] 8000Hz 2ch s16le (2 bytes per sample)
  Video: no video
  Starting playback...
  big_values too large!
  ...
  big_values too large!) of 661022.8 (183:37:02.7) 135.2% 
  ...
  Blocktype == 0 and window-switching == 1 not allowed.
  [a lot more messages like the last three]
  mpg123: Can't rewind stream by 754 bits!3:37:02.7) 201.3% 
  Blocktype == 0 and window-switching == 1 not allowed.9.0% 
  A:661022.8 (183:37:02.7) of 661022.8 (183:37:02.7) 144.7% 
  Audio output truncated at end.
  A:661022.8 (183:37:02.7) of 661022.8 (183:37:02.7) 144.7% 

  Exiting... (End of file)

My question is, can I or should I set up my DVDRW drive with a UUID?
Would the "AD-7240S" serve to distinguish my DVD drive? Would this be
likely to resolve mplayer's probem accessing the disk?

Haines Brown

[toc] | [next] | [standalone]


#919

FromBit Twister <BitTwister@mouse-potato.com>
Date2011-12-21 21:49 +0000
Message-ID<slrnjf4l2p.b09.BitTwister@wb.home.test>
In reply to#918
On Wed, 21 Dec 2011 15:37:58 -0500, Haines Brown wrote:

>   libdvdread: Can't stat /dev/dvd
>   No such file or directory

> My question is, can I or should I set up my DVDRW drive with a UUID?

I would be impressed if you could.

> Would the "AD-7240S" serve to distinguish my DVD drive? 

Depends on where you would make that decision and what you did with it where.

> Would this be likely to resolve mplayer's probem accessing the disk?

Maybe depending on how you implement your changes. You may want to read
http://www.catb.org/~esr/faqs/smart-questions.html


On my Mandriva Linux 2011.0 system, running KDE 4.6.5.

I have a cd/dvd RW (/dev/sr0) and a cd/dvd R only drive (/dev/sr1). 
Out of the box install usually sets the read only device as cdrom/dvd/... :(

Not wanting to use /dev/dvd1 or cdrom1 to get to the burner, I used/modified
/etc/udev/rules.d/70-persistent-cd.rules to create the /dev links to
the device I wanted. Result:

$ cd /dev
$ ls -al | grep sr0
lrwxrwxrwx   1 root root             3 Dec 21 15:35 cdrom -> sr0
lrwxrwxrwx   1 root root             3 Dec 21 15:35 cdrw -> sr0
lrwxrwxrwx   1 root root             3 Dec 21 15:35 dvd -> sr0
lrwxrwxrwx   1 root root             3 Dec 21 15:35 dvdrw -> sr0
brw-rw----   1 root cdrom      11,   0 Dec 21 15:35 sr0

$ ls -al | grep sr1
lrwxrwxrwx   1 root root             3 Dec 21 15:35 cdrom1 -> sr1
lrwxrwxrwx   1 root root             3 Dec 21 15:35 dvd1 -> sr1
brw-rw----   1 root cdrom      11,   1 Dec 21 15:35 sr1

I also have added my login id to the audio, disk, cdrom groups.  :-)

[toc] | [prev] | [next] | [standalone]


#920

FromJ G Miller <miller@yoyo.ORG>
Date2011-12-21 23:20 +0000
Message-ID<jctpkp$8pk$1@dont-email.me>
In reply to#918
On Wednesday, December 21st, 2011, at 15:37:58h -0500, Haines Brown wrote:

> I went over to UUID for my hard disks and some external storage devices.

Actually you did not.

You "went over to UUID" for the disk partitions / file systems on
each of your hard disks.

> However, I don't know what to do about my DVD drive.

Because a "drive" by it-self does not have any partitions / file systems,
does it?

[toc] | [prev] | [next] | [standalone]


#922

From"David W. Hodgins" <dwhodgins@nomail.afraid.org>
Date2011-12-21 20:00 -0500
Message-ID<op.v6u83nhwa3w0dxdave@hodgins.homeip.net>
In reply to#918
On Wed, 21 Dec 2011 15:37:58 -0500, Haines Brown <haines@historicalmaterialism.info> wrote:

> My question is, can I or should I set up my DVDRW drive with a UUID?

No.  You could setup fstab entries using uuid for filesystems stored
on a data disc, but not for the drive itself.

Depending on which distribution and version you have, there is likely
a file similar in name to /etc/udev/rules.d/70-persistent-cd.rules
that controls which device name gets assigned to the drive.

If you replace a drive, or switch which connector a drive is using
a new entry will be added to that file, ensuring the device always
gets the same name.

Try deleting all of the non-comment lines from that file, and
rebooting.  It should then create a entry assigning the drive
to /dev/dvd.

Regards, Dave Hodgins


-- 
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)

[toc] | [prev] | [next] | [standalone]


#924

FromHaines Brown <haines@HistoricalMaterialism.info>
Date2011-12-22 10:54 -0500
Message-ID<8739ccwqif.fsf@engels.HistoricalMaterialism.info>
In reply to#922
"David W. Hodgins" <dwhodgins@nomail.afraid.org> writes:

> On Wed, 21 Dec 2011 15:37:58 -0500, Haines Brown <haines@historicalmaterialism.info> wrote:
>
>> My question is, can I or should I set up my DVDRW drive with a UUID?
>
> No.  You could setup fstab entries using uuid for filesystems stored
> on a data disc, but not for the drive itself.

Understood

> Depending on which distribution and version you have, there is likely
> a file similar in name to /etc/udev/rules.d/70-persistent-cd.rules
> that controls which device name gets assigned to the drive.

There are two stanzas there for my dvd drive, which have the lines,
among others:

  SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
                      ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-1:0:0:0", 
                      SYMLINK+="dvd", ENV{GENERATED}="1"

  SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", 
                      ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-0:0:1:0", 
                      SYMLINK+="dvd5", ENV{GENERATED}="1"

However, thre is no /dev/dvd.

  $ ls -la /dev | grep dvd
  lrwxrwxrwx   1 root   root           3 Dec 22 09:49 dvd5 -> sr0
  lrwxrwxrwx   1 root   root           3 Dec 22 09:49 dvdrw5 -> sr0

Perhaps removing lines associated with my dvd drive in
700persistent-cd.rules and rebooting will reconstruct a /dev/dvd, but if
if that file already has a dvd line, why isn't there a /dev/dvd? 

But meanwhile, to play a dvd I assume I have to do:

  $ mplayer dvd://1 /dev/dvd5

The gui window merely flashes and this is from the trace of the calls:

execve("/usr/bin/mplayer", ["mplayer", "dvd://1", "/dev/dvd5"], [/* 27 vars */]) = 0
brk(0)                                  = 0x9580000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
...
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0
write(1, "\nPlaying /dev/dvd5.\n", 20)  = 20
open("/dev/dvd5.ifo", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/dev/dvd5.idx", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/haines/.mplayer/sub/dvd5.ifo", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/haines/.mplayer/sub/dvd5.idx", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/dev/dvd5", O_RDONLY|O_LARGEFILE) = 3
_llseek(3, 0, [4565041152], SEEK_END)   = 0
...
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2048) = 2048
read(3, 0x95c73d8, 2048)                = -1 EIO (Input/output error)
read(3, 0x95c73d8, 2048)                = -1 EIO (Input/output error)
munmap(0xb4baf000, 2101248)             = 0
write(1, "libavformat file format detected"..., 34) = 34
_llseek(3, 0, [0], SEEK_SET)            = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2048) = 2048
...
read(4, "\1\1\200\0\0\0\0\0\2\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096) = 32
read(4, 0x95effd0, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
close(4)                                = 0
munmap(0xb404f000, 633604)              = 0
munmap(0xb40ea000, 790528)              = 0
munmap(0xb41ab000, 633604)              = 0
munmap(0xb4246000, 790528)              = 0
write(1, "\nExiting... (End of file)\n", 26) = 26
munmap(0xb4d6f000, 266240)              = 0
exit_group(0)                           = ?

I don't know what to make of all this, but it seems that mplayer is
accessing the dvd disk in the drive and extracts some information, but
for some reason can't display it.

Haines Brown












>
> If you replace a drive, or switch which connector a drive is using
> a new entry will be added to that file, ensuring the device always
> gets the same name.
>
> Try deleting all of the non-comment lines from that file, and
> rebooting.  It should then create a entry assigning the drive
> to /dev/dvd.
>
> Regards, Dave Hodgins
>
>
> --
> Change nomail.afraid.org to ody.ca to reply by email.
> (nomail.afraid.org has been set up specifically for
> use in usenet. Feel free to use it yourself.)

[toc] | [prev] | [next] | [standalone]


#925

FromJ G Miller <miller@yoyo.ORG>
Date2011-12-22 18:08 +0000
Message-ID<jcvrnl$dlk$1@dont-email.me>
In reply to#924
On Thursday, December 22nd, 2011 at 10:54:48h -0500,
Haines Brown explained:

> I don't know what to make of all this, but it seems that mplayer is
> accessing the dvd disk in the drive and extracts some information, but
> for some reason can't display it.

If it is an encrypted DVD (most commercial ones are), do you have
the DeCSS library installed?

  Package: libdvdcss2
  Priority: optional
  Section: libs
  Installed-Size: 88
  Maintainer: Christian Marillat <marillat@debian.org>
  Bugs: mailto:marillat@debian.org
  Architecture: i386
  Source: libdvdcss
  Version: 1.2.11-0.0

  Description: Simple foundation for reading DVDs - runtime libraries
  To allow applications to access some of the more advanced features
  of the DVD format.

  Homepage: http://download.videolan.org/

You need to get it from the debian-multimedia repository.

[toc] | [prev] | [next] | [standalone]


#927

FromHaines Brown <haines@HistoricalMaterialism.info>
Date2011-12-22 20:03 -0500
Message-ID<87y5u4umiu.fsf@engels.HistoricalMaterialism.info>
In reply to#925
J G Miller <miller@yoyo.ORG> writes:

> On Thursday, December 22nd, 2011 at 10:54:48h -0500,
> Haines Brown explained:
>
>> I don't know what to make of all this, but it seems that mplayer is
>> accessing the dvd disk in the drive and extracts some information, but
>> for some reason can't display it.
>
> If it is an encrypted DVD (most commercial ones are), do you have
> the DeCSS library installed?

Yes, it is an encrypted DVD, but I have libdvdcss2 installed. The
disk is one that I've played before on this same machine.

Haines Brown

[toc] | [prev] | [next] | [standalone]


#929

FromBill Marcum <bill@lat.localnet>
Date2011-12-22 17:54 -0500
Message-ID<j1pcs8-dv9.ln1@lat.localnet>
In reply to#924
On 2011-12-22, Haines Brown <haines@HistoricalMaterialism.info> wrote:
> "David W. Hodgins" <dwhodgins@nomail.afraid.org> writes:
>
>> On Wed, 21 Dec 2011 15:37:58 -0500, Haines Brown <haines@historicalmaterialism.info> wrote:
>>
>>> My question is, can I or should I set up my DVDRW drive with a UUID?
>>
>> No.  You could setup fstab entries using uuid for filesystems stored
>> on a data disc, but not for the drive itself.
>
> Understood
>
>> Depending on which distribution and version you have, there is likely
>> a file similar in name to /etc/udev/rules.d/70-persistent-cd.rules
>> that controls which device name gets assigned to the drive.
>
> There are two stanzas there for my dvd drive, which have the lines,
> among others:
>
>   SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
>                       ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-1:0:0:0", 
>                       SYMLINK+="dvd", ENV{GENERATED}="1"
>
>   SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", 
>                       ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-0:0:1:0", 
>                       SYMLINK+="dvd5", ENV{GENERATED}="1"
>
> However, thre is no /dev/dvd.
>
>   $ ls -la /dev | grep dvd
>   lrwxrwxrwx   1 root   root           3 Dec 22 09:49 dvd5 -> sr0
>   lrwxrwxrwx   1 root   root           3 Dec 22 09:49 dvdrw5 -> sr0
>
> Perhaps removing lines associated with my dvd drive in
> 700persistent-cd.rules and rebooting will reconstruct a /dev/dvd, but if
> if that file already has a dvd line, why isn't there a /dev/dvd? 
>
Notice the difference between the two entries. Perhaps your present dvd
drive does not fit this rule:
>        ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-1:0:0:0", 


-- 
"Never believe the attribution of a quotation you find on the Internet."
(George Bernard Shaw)

[toc] | [prev] | [next] | [standalone]


#930

FromHaines Brown <haines@HistoricalMaterialism.info>
Date2011-12-23 06:15 -0500
Message-ID<87ty4rv8sg.fsf@engels.HistoricalMaterialism.info>
In reply to#929
Bill Marcum <bill@lat.localnet> writes:

> On 2011-12-22, Haines Brown <haines@HistoricalMaterialism.info> wrote:
>> "David W. Hodgins" <dwhodgins@nomail.afraid.org> writes:

>> There are two stanzas there for my dvd drive, which have the lines,
>> among others:
>>
>>   SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
>>                       ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-1:0:0:0", 
>>                       SYMLINK+="dvd", ENV{GENERATED}="1"
>>
>>   SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", 
>>                       ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-0:0:1:0", 
>>                       SYMLINK+="dvd5", ENV{GENERATED}="1"
>>
>> However, thre is no /dev/dvd.

> Notice the difference between the two entries. Perhaps your present dvd
> drive does not fit this rule:
>>        ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-1:0:0:0", 

I see the difference but am too ignorant to know what to make of
it. What is the "path" to? What do the end numbers refer to? My DVD
drive is standard, good quality, and is not very old, so I'd assume
that it would meet system expectations. It seems there is a rule for
"dvd" but no corresponding interface /dev/dvd. 

But I now realize that the trace info above simply reports the
70persistent-cd.rules. Could I edit those rules so that "dvd" stana
acquires the value 0:0:1:0? Or would I do better and do what you
suggested, which is to remove the lines and reboot so that they are
regenerated?

I've been complete absorbed by intense work in last two months, and one
effect is that a key combination close to one or two I use all the time
(not sure, but may be C-A-Q) crashes my machine. Could have happened
five times to yield the dvd5. I'll test it, and if that is the offending
key combination I'll have to block it so that I don't do it again.

Haines Brown


[toc] | [prev] | [next] | [standalone]


#933

FromBit Twister <BitTwister@mouse-potato.com>
Date2011-12-23 23:31 +0000
Message-ID<slrnjfa3pv.ab3.BitTwister@wb.home.test>
In reply to#930
On Fri, 23 Dec 2011 06:15:11 -0500, Haines Brown wrote:
> I see the difference but am too ignorant to know what to make of
> it. What is the "path" to? What do the end numbers refer to? 

One is the hardware bus id, the other the scsi channel used by the
system to channel data to the device.  What you are interested in is
the last two digits of the scsi id to identify which device you want
associated with what SYMLINK and what the symlink will be.

Here look at my two devices. Memorex is read/writer and ASUS is reader.

# grep CD-ROM /var/log/messages 
Dec 23 16:58:47 localhost kernel: scsi 3:0:0:0: CD-ROM  Memorex  DVD+-RAM 
Dec 23 16:58:47 localhost kernel: scsi 3:0:1:0: CD-ROM  ASUS     DVD-E616A

My udev rules snippet:
 ENV{ID_PATH}=="pci-0000:00:14.1-scsi-1:0:0:0", SYMLINK+="dvd",
 ENV{ID_PATH}=="pci-0000:00:14.1-scsi-1:0:0:0", SYMLINK+="dvdrw",
 ENV{ID_PATH}=="pci-0000:00:14.1-scsi-1:0:1:0", SYMLINK+="dvd1",

No idea why messages has 3:0:x:x and rules has 1:0:x:x

the results are
# cd /dev
# ls -al | grep dvd
lrwxrwxrwx   1 root       root             3 Dec 23 11:32 dvd -> sr0
lrwxrwxrwx   1 root       root             3 Dec 23 11:32 dvdrw -> sr0
lrwxrwxrwx   1 root       root             3 Dec 23 11:32 dvd1 -> sr1

[toc] | [prev] | [next] | [standalone]


#935

From"David W. Hodgins" <dwhodgins@nomail.afraid.org>
Date2011-12-23 22:37 -0500
Message-ID<op.v6y5obr4a3w0dxdave@hodgins.homeip.net>
In reply to#930
On Fri, 23 Dec 2011 06:15:11 -0500, Haines Brown <haines@historicalmaterialism.info> wrote:

> Bill Marcum <bill@lat.localnet> writes:
>
>> On 2011-12-22, Haines Brown <haines@HistoricalMaterialism.info> wrote:
>>> "David W. Hodgins" <dwhodgins@nomail.afraid.org> writes:
>
>>> There are two stanzas there for my dvd drive, which have the lines,
>>> among others:
>>>
>>>   SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
>>>                       ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-1:0:0:0",
>>>                       SYMLINK+="dvd", ENV{GENERATED}="1"
>>>
>>>   SUBSYSTEM=="block", ENV{ID_CDROM}=="?*",
>>>                       ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-0:0:1:0",
>>>                       SYMLINK+="dvd5", ENV{GENERATED}="1"
>>>
>>> However, thre is no /dev/dvd.
>
>> Notice the difference between the two entries. Perhaps your present dvd
>> drive does not fit this rule:
>>>        ENV{ID_PATH}=="pci-0000:00:1f.2-scsi-1:0:0:0",
>
> I see the difference but am too ignorant to know what to make of
> it. What is the "path" to? What do the end numbers refer to? My DVD
> drive is standard, good quality, and is not very old, so I'd assume
> that it would meet system expectations. It seems there is a rule for
> "dvd" but no corresponding interface /dev/dvd.

The above indicates that at one time you either had a dvd drive connected
to a different connector.

You should remove both entries and reboot. When udev restarts, it will
add a new entry with the symlink set to dvd and the correct path for
the currently detected device.

Regards, Dave Hodgins

-- 
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.linux.hardware


csiph-web