Thanks for getting back to me Jerome; very much appreciated.
My major device number is as you expected:
brw-rw---- 1 root cdrom 11, 0 Oct 15 11:29 /dev/sr0
And I'd also spotted a discussion on device numbers under a ZFS thread (https://github.com/zfsonlinux/zfs/issues/515), but I didn't want to hack around without a bit more reassurance; so thanks again.
I tried to add your suggestion to utils.py, but this this caused targetcli to error when I attempted to create the iblock backstore:
/backstores/iblock> create name=cdrom dev=/dev/sr0
Generating a wwn serial.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line 983, in run_interactive
self._cli_loop()
File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line 806, in _cli_loop
self.run_cmdline(cmdline)
File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line 927, in run_cmdline
self._execute_command(path, command, pparams, kparams)
File "/usr/lib/python2.7/dist-packages/configshell/shell.py", line 902, in _execute_command
result = target.execute_command(command, pparams, kparams)
File "/usr/lib/python2.7/dist-packages/targetcli/ui_node.py", line 101, in execute_command
pparams, kparams)
File "/usr/lib/python2.7/dist-packages/configshell/node.py", line 1405, in execute_command
result = method(*pparams, **kparams)
File "/usr/lib/python2.7/dist-packages/targetcli/ui_backstore.py", line 381, in ui_command_create
raise exception
IOError: [Errno 30] Read-only file system
So I clearly don't know what I'm doing here; do I need to recompile compile this file, or something similar?
Removing this additional line resolves these errors, but takes me back to the original issue.
WRT using the CDROM as a pscsi blockstore: everything that I've tried (music CDs, movie DVDs) is detected by the laptop, it plays the media correctly, and the CD try is ejected on command from the laptop.
Unfortunately, not all is well. It does get into a bit of a twist when the server has accessed the CDROM (a mount, ls, and then unmount). The laptop can no-longer eject the CD tray, and the eject button on the CDROM will not work. I can eject the CD tray from the server command line, but only a server reboot will resolve the problem for the laptop. Not great, but good enough for my limited use case.
I have read that it's possible to 'unlock' the CD tray mechanism by default, but I'm not about to start hacking about with that for now.
Thanks again, and best regards,
a.
-----Original Message-----
From: "Jerome Martin" [***@netiant.com]
Date: 15/10/2014 01:26 PM
To: "Andrew Watt" <***@excite.com>, target-***@vger.kernel.org
Subject: Re: CDROM not recognised: 'Device is not a TYPE_DISK block device'
Hi Andrew,
Post by Andrew WattHello all,
I'm having a problem creating an iblock backstore from the CDROM drive in my HP Microserver.
create name=cdrom dev=/dev/sr0
Generating a wwn serial.
Device is not a TYPE_DISK block device.
I have been able to create a pscsi backstore to this device, and I can access it from my Windows 7 laptop, although it can get confused and lock the drive tray if I mount it within the server - which is why I'm trying the iblock configuration.
This behaviour is for a TSST Corp CDDVDW SH-24DBSCSI CDRom in a HP Microserver N54, with a clean install of Ubuntu 14.04 server, and targetcli.
Could you please give me the major device number for your CDROM drive?
In case you are not familiar with this, simply run:
# ls -l /dev/sr0
You should get something like that:
brw-rw---- 1 root cdrom 11, 0 Oct 13 16:01 /dev/sr0
In that case, 11 is the major number and 0 the minor.
Note that if I remember correctly, not adding CD-ROM majors as TYPE_DISK
was a deliberate decision, I'll have to go through my notes to find out
exactly why. In the meantime, you could add it manually to the
type_disk_known_majors list found in utils.py from the python-rtslib
package:
--- /usr/lib/python2.7/dist-packages/rtslib/utils.py 2014-10-13
16:04:08.000000000 +0200
+++ /tmp/utils.py 2014-10-15 14:24:31.932000000 +0200
@@ -219,6 +219,7 @@
type_disk_known_majors = [1, # RAM disk
8, # SCSI disk devices
9, # Metadisk RAID devices
+ 11, # Temporary hack for CD-ROM
13, # 8-bit MFM/RLL/IDE controller
19, # "Double" compressed disk
21, # Acorn MFM hard drive interface
Please report here on the outcome, and let me know how the CD-ROM
behaves with iblock. I am not convinced that this is a good idea at all,
but feel free to test it :-)
Post by Andrew WattAny help would be greatly appreciated.
Thanks in advance,
a.
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
More majordomo info at http://vger.kernel.org/majordomo-info.html