coldfix / udiskie

Automounter for removable media
MIT License
866 stars 53 forks source link

Mounting audio CDs #196

Closed mb720 closed 4 years ago

mb720 commented 4 years ago

Hi!

Is there a way to mount CD-ROMs with udiskie?

I tried udiskie-mount /dev/sr0 but the error message said it was an unhandled device.

coldfix commented 4 years ago

Hi,

mounting CDs should be possible. What is the output of udiskie-mount -v /dev/sr0? It should display which rule was used to discriminate against the device.

mb720 commented 4 years ago

The output of udiskie-mount -v /dev/sr0 is

DEBUG [2020-01-20 18:08:18,684] udiskie.config: Failed to read config file: [Errno 2] No such file or directory: '/home/mb/.config/udiskie/config.yml'
DEBUG [2020-01-20 18:08:18,687] udiskie.config: Failed to read config file: [Errno 2] No such file or directory: '/home/mb/.config/udiskie/config.json'
DEBUG [2020-01-20 18:08:18,699] udiskie.udisks2: Daemon version: 2.8.4
DEBUG [2020-01-20 18:08:18,699] udiskie.udisks2: Keyfile support: True
DEBUG [2020-01-20 18:08:18,733] udiskie.config: IgnoreDevice(match={'symlinks': '/dev/mapper/docker-*'}, value={'ignore': True}) created
DEBUG [2020-01-20 18:08:18,733] udiskie.config: IgnoreDevice(match={'symlinks': '/dev/disk/by-id/dm-name-docker-*'}, value={'ignore': True}) created
DEBUG [2020-01-20 18:08:18,733] udiskie.config: IgnoreDevice(match={'is_loop': True, 'loop_file': '/*'}, value={'ignore': False}) created
DEBUG [2020-01-20 18:08:18,733] udiskie.config: IgnoreDevice(match={'is_block': False}, value={'ignore': True}) created
DEBUG [2020-01-20 18:08:18,733] udiskie.config: IgnoreDevice(match={'is_external': False}, value={'ignore': True}) created
DEBUG [2020-01-20 18:08:18,733] udiskie.config: IgnoreDevice(match={'is_ignored': True}, value={'ignore': True}) created
DEBUG [2020-01-20 18:08:18,734] udiskie.udisks2: found device owning "/dev/sr0": "/org/freedesktop/UDisks2/block_devices/sr0"
not adding /org/freedesktop/UDisks2/block_devices/sr0: unhandled device
INFO [2020-01-20 18:08:18,734] udiskie.mount: not adding /org/freedesktop/UDisks2/block_devices/sr0: unhandled device
coldfix commented 4 years ago

Hi,

thanks for the output! Looks like the device for the CD drive is not properly handled by the cases in Mounter.add. I put this on my TODO for the next release, but I can't promise making it timely, I'm afraid.

Best, Thomas

mb720 commented 4 years ago

Thanks for looking into this! :-) There's no rush, by the way.

coldfix commented 4 years ago

Hi, I reinstalled a CD drive in my laptop (:D) and couldn't reproduce the issue. In order to determine what might be the problem, it would be helpful to also have the output of udisksctl dump, everything for /dev/sr0 and the object listed as its drive.

coldfix commented 4 years ago

One issue that I found is that it can take relatively long for the filesystem to be recognized (depending on the CD drive and the quality of the CD/DVD) such that udiskie will consider the device unhandleable for a certain amount of time.

mb720 commented 4 years ago

I forgot to mention that I tried to mount an audio CD; udiskie works flawlessly with a CD that contains files: it mounts the CD's file system automatically. :-)

I'm not sure it's possible to mount an audio CD, is it?

For audio CDs, I can get the tracks using abcde anyway.

For the record, here's the output of udisksctl dump for the audio CD:

/org/freedesktop/UDisks2/Manager:
  org.freedesktop.UDisks2.Manager:
    DefaultEncryptionType:      luks1
    SupportedEncryptionTypes:   luks1
                                luks2
    SupportedFilesystems:       ext2
                                ext3
                                ext4
                                vfat
                                ntfs
                                exfat
                                xfs
                                reiserfs
                                nilfs2
                                btrfs
                                minix
                                udf
                                f2fs
                                swap
    Version:                    2.8.4

/org/freedesktop/UDisks2/block_devices/sr0:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/sr0
    DeviceNumber:               2816
    Drive:                      '/org/freedesktop/UDisks2/drives/HL_DT_ST_DVDRAM_GT30N_DD56419883915'
    HintAuto:                   true
    HintIconName:               
    HintIgnore:                 false
    HintName:                   
    HintPartitionable:          false
    HintSymbolicIconName:       
    HintSystem:                 false
    Id:                         
    IdLabel:                    
    IdType:                     
    IdUUID:                     
    IdUsage:                    
    IdVersion:                  
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/sr0
    ReadOnly:                   true
    Size:                       357502976
    Symlinks:                   /dev/cdrom
                                /dev/disk/by-id/usb-HL-DT-ST_DVDRAM_GT30N_DD56419883915-0:0
                                /dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.1:1.0-scsi-0:0:0:0
    UserspaceMountOptions:      

/org/freedesktop/UDisks2/drives/HL_DT_ST_DVDRAM_GT30N_DD56419883915:
  org.freedesktop.UDisks2.Drive:
    CanPowerOff:                true
    Configuration:              {}
    ConnectionBus:              usb
    Ejectable:                  true
    Id:                         HL-DT-ST-DVDRAM-GT30N-DD56419883915
    Media:                      optical_cd
    MediaAvailable:             true
    MediaChangeDetected:        true
    MediaCompatibility:         optical_cd
                                optical_cd_r
                                optical_cd_rw
                                optical_dvd
                                optical_dvd_plus_r
                                optical_dvd_plus_r_dl
                                optical_dvd_plus_rw
                                optical_dvd_r
                                optical_dvd_ram
                                optical_dvd_rw
    MediaRemovable:             true
    Model:                      DVDRAM GT30N
    Optical:                    true
    OpticalBlank:               false
    OpticalNumAudioTracks:      13
    OpticalNumDataTracks:       0
    OpticalNumSessions:         1
    OpticalNumTracks:           13
    Removable:                  true
    Revision:                   IS09
    RotationRate:               -1
    Seat:                       seat0
    Serial:                     DD56419883915
    SiblingId:                  /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0
    Size:                       357502976
    SortKey:                    01hotplug/1580649171285592
    TimeDetected:               1580649171285592
    TimeMediaDetected:          1580649836751529
    Vendor:                     HL-DT-ST
    WWN:                        
coldfix commented 4 years ago

Hi,

I'm no expert in these things, but from google research it's not possible to mount audio CDs.

This also agrees with the fact that udisksctl dump doesn't list a org.freedesktop.UDisks2.Filesystem interface for the CD.

Should you happen find that there are indeed drivers that allow exposing the audio tracks as a filesystem, please let me know here (for my curiosity and future readers).

I'm closing this for now since you say that normal data CDs work.

Best, Thomas

mb720 commented 4 years ago

This did not work for the audio CD:

sudo mount -t iso9660 -o ro /dev/sr0 /run/media/mb/

Got an error:

mount: /run/media/mb: wrong fs type, bad option, bad superblock on /dev/sr0, missing codepage or helper program, or other error.