Solved Unable to mount CD / DVD or dd contents

I created some CDs and DVDs a while back to offload infrequently accessed files. I have since rebuilt my system and am using a custom kernel, but I thought I have added back support for CDs and DVDs, but am still unable to mount the discs.

I am using a powered USB to SATA interface with the DVD reader plugged into that. With dmesg, I see da0 maps to that device when I plug it in. I am hoping I could either run dd or mount directly on da0:

I am trying:
Code:
dd if=/dev/da0 of=/media/backup.iso
mount_cd9660  -v -s 0 /dev/da0 /mnt/usb

This results in:
dd: /dev/da0: Device not configured
0+0 records in
0+0 records out
0 bytes transferred in 0.000067 secs (0 bytes/sec)

mount_cd9660: /dev/da0: Device not configured

My kernel configuration inherits from GENERIC and has to the best of my knowledge:
Code:
device scbus    # SCSI bus (required for ATA/SCSI)
device da    # Direct Access (disks)
device pass    # Passthrough device (direct ATA/SCSI access)
device cd    # needed for CD and DVD burners
device uhci    # provides USB 1.x support
device ohci    # provides USB 1.x support
device ehci    # provides USB 2.0 support
device xhci    # provides USB 3.0 support
device usb    # USB Bus (required)
device umass    # Disks/Mass storage - Requires scbus and da


So, I think that perhaps the DVD drive is still not being properly recognized? I should be able to run dd, then after that, I probably need to run mdconfig to setup a loopback device followed by mount_cd9660. I'm not sure where to look from here though. I don't have any free space inside the case to put the DVD drive, but I'm not sure the USB part is the issue.
 
Normally, a CD / DVD device would map to /dev/cd0, cd1 and so on. Perhaps your usb to SATA adapter confuses things?
 
Hmm, that is just a device node, right? So, it shouldn't matter. But, that is a good point, to simplify matters, I'll pull out an hd and put the dvd drive back and see what happens.
 
how about unplug the cd drive or cd drive plugged into the USB to SATA adaptor with the USB unplugged, then plug in the USB side and get the output of
dmesg ls -ltr /dev

That may give a hint on the device node to use in your commands.
Using one of those adaptors I've always had to check the device nodes to find out exactly what was created.
 
if the cd is identified as da0 thats suspect it should be cd0
I know that used to be true at one point in time, but I thought it was done via devd hooks that created a symlink.
Perhaps having a disk inserted makes a difference?
I'm asking because I don't know and don't have a system handy with a cd/dvd drive.
 
I don't think so - both to "devd hooks" and having a disk inserted. Here is what's logged in /var/log/messages when I plug in my USB CD / DVD writer (no cd or dvd in the drive)
Code:
Oct 31 21:54:07 kg-core2 kernel: usb_msc_auto_quirk: UQ_MSC_NO_GETMAXLUN set for USB mass storage device PLEXTOR PLEXTOR USB Storage Adapter (0x093b:0x0023)
Oct 31 21:54:07 kg-core2 kernel: ugen1.8: <PLEXTOR PLEXTOR USB Storage Adapter> at usbus1
Oct 31 21:54:07 kg-core2 kernel: umass1 on uhub3
Oct 31 21:54:07 kg-core2 kernel: umass1: <PLEXTOR PLEXTOR USB Storage Adapter, class 0/0, rev 2.00/1.01, addr 7> on usbus1
Oct 31 21:54:07 kg-core2 kernel: umass1:  8070i (ATAPI) over Bulk-Only; quirks = 0x0100
Oct 31 21:54:07 kg-core2 kernel: umass1:6:1: Attached to scbus6
Oct 31 21:54:08 kg-core2 kernel: cd0 at umass-sim1 bus 1 scbus6 target 0 lun 0
Oct 31 21:54:08 kg-core2 kernel: cd0: <PLEXTOR DVDR    PX-608CU 1.00> Removable CD-ROM SCSI device
Oct 31 21:54:08 kg-core2 kernel: cd0: 40.000MB/s transfers
Oct 31 21:54:08 kg-core2 kernel: cd0: Attempt to query device size failed: NOT READY, Medium not present
Oct 31 21:54:08 kg-core2 kernel: cd0: quirks=0x10<10_BYTE_ONLY>
here is what usbconfig says
Code:
root@kg-core2:~ # usbconfig -d ugen1.8
ugen1.8: <PLEXTOR PLEXTOR USB Storage Adapter> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
the only linking part I can find is these commented out lines in /etc/devfs.conf:
Code:
root@kg-core2:~ # grep cd0 /etc/devfs.conf
#link    cd0    cdrom
#link    cd0    dvd
info from sysctl
Code:
root@kg-core2:~ # sysctl kern.disks
kern.disks: cd0 da4 da3 da2 da1 da0 ada0 nvd1 nvd0
root@kg-core2:~ # sysctl kern.geom.disk.cd0
kern.geom.disk.cd0.flags: 0
kern.geom.disk.cd0.led:
this on
Code:
root@kg-core2:~ # freebsd-version -ku
13.2-RELEASE-p4
13.2-RELEASE-p4
 
  • Like
Reactions: mer
tingo thanks for that info. That implies to me the OP needs to do similar commands to find out what devnode should be used; the first post is using da0 which may not be correct.
 
dmesg:
Code:
usb_msc_auto_quirk: UQ_MSC_NO_GETMAXLUN set for USB mass storage device Western Digital External HDD (0x1058:0x1001)
usb_msc_auto_quirk: UQ_MSC_NO_SYNC_CACHE set for USB mass storage device Western Digital External HDD (0x1058:0x1001)
usb_msc_auto_quirk: UQ_MSC_NO_PREVENT_ALLOW set for USB mass storage device Western Digital External HDD (0x1058:0x1001)
usb_msc_auto_quirk: UQ_MSC_NO_TEST_UNIT_READY set for USB mass storage device Western Digital External HDD (0x1058:0x1001)
usb_msc_auto_quirk: UQ_MSC_NO_START_STOP set for USB mass storage device Western Digital External HDD (0x1058:0x1001)
ugen0.2: <Western Digital External HDD> at usbus0
umass0 on uhub0
umass0: <Western Digital External HDD, class 0/0, rev 2.00/1.06, addr 4> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0xc105
umass0:3:0: Attached to scbus3
da0 at umass-sim0 bus 0 scbus3 target 0 lun 0
da0: <  > Fixed Direct Access SCSI device
da0: Serial Number 44424C463538333720202020
da0: 40.000MB/s transfers
da0: 0MB (0 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>
da0: Write Protected

sysctl kern.disks
Code:
kern.disks: da0 ada0 ada1

usbconfig -d ugen0.2
Code:
ugen0.2: <Western Digital External HDD> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)

I'll try putting it directly in the case.
 
cds need a block size multiple of 2k

Yes, bs=2048 (or a multiple) is required when using dd to/from a cd/dvd.

But should that be sufficient to copy a CD with dd if=/dev/da0 of=mycd.ISO bs=2048; mdconfig mycd.ISO; mount_cd9660 /dev/md0 /mnt ?

i.e is there no header / preamble on /dev/da0 (or /dev/cd0) before the raw data?

Assume genuine ignorance :)
 
I installed it in another device and it showed up as /dev/cd0. Still, when I try to dd if=/dev/cd0 of=/tmp/image.img, I get "Invalid Argument".

From what I can tell, I wrote an ISO to the CD or DVD using cdrecord. I prepared the ISO using mkisofs and just a collection of files.
 
Back
Top