Hi,

> $ mount /media/cdrom0
> mount: block device /dev/sr0 is write-protected, mounting read-only
> mount: /dev/sr0 already mounted or /media/cdrom0 busy
> $ mount /media/cdrom0
> mount: block device /dev/sr0 is write-protected, mounting read-only

It looks like some process is opening /dev/sr0 (the link target
of /dev/cdrom0) with flag O_EXCL for a short time.

I can provoke the message by running in one terminal

  cdrskin dev=/dev/sr0 grab_drive_and_wait=60

and then trying to mount /dev/sr0 in another terminal.
After the cdrskin run has ended, the next mount attempt
succeeds.


> I can live with this, but I'm curious to know why.

btrace(8) might tell something. As superuser in a terminal

  btrace /dev/sr0 2>&1 | tee -i /tmp/btrace.log

The names of acting processes are told in []-brackets.
E.g.
  11,0    1       16    23.917345909 13645  Q   R 4096 + 8 [systemd-udevd]
  11,0    4       11   106.816656855 13652  G   N [cdrskin]

When the interesting event has happened, end the btrace run
by Ctrl+C and read file /tmp/btrace.log from its end.
The numbers "23.917345909" and "106.816656855" are seconds
since btrace start. So you can easily judge which lines
are too old to be related to your invisible drive groper.


Have a nice day :)

Thomas

Reply via email to