LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-06-2008, 08:01 PM   #1
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221

Rep: Reputation: 36
What manages the files/directories in "/media"


I'm trying to figure out the udev rules and/or /etc/fstab changes I need to make to get my Debian system to recognize my new miniSDHC card. I do have an older regular SD card and SD card reader, and when I plug in that older SD card, I get a window popping up that reads:

Code:
A photo card has been detected.
There are photos on the card. Would you like
to add these pictures to your album?
[ ] Always perform this action
[Ignore] [Import Photos]
When that SD card is connected, I see that the system has automatically mounted the SD card as "/media/disk". Searching through the /etc/udev/rules.d directory does not turn up any references to "media" or "disk" or "/media/disk", so I'm stumped as to what in the system can be creating that. If I could figure out what creates /media/disk for the regular SD card, I'm thinking I can reconfigure that component to recognize the new miniSDHC card, too.

Does anyone know what component creates that /media/disk mount?

For your reference, here is the udevinfo output for the device since I suspect this will be the first question someone will ask:

Code:
sh-3.2$ udevinfo -a -p /sys/block/sdc/

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/block/sdc':
    KERNEL=="sdc"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{range}=="16"
    ATTR{removable}=="1"
    ATTR{size}=="7813120"
    ATTR{capability}=="13"
    ATTR{stat}=="      59     1091     1682      560        0        0        0        0        0      280      560"

  looking at parent device '/devices/pci0000:00/0000:00:0a.1/usb2/2-2/2-2:1.0/host14/target14:0:0/14:0:0:0':
    KERNELS=="14:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"
    ATTRS{device_blocked}=="0"
    ATTRS{type}=="0"
    ATTRS{scsi_level}=="0"
    ATTRS{vendor}=="Generic "
    ATTRS{model}=="USB SD Reader   "
    ATTRS{rev}=="1.00"
    ATTRS{state}=="running"
    ATTRS{timeout}=="30"
    ATTRS{iocounterbits}=="32"
    ATTRS{iorequest_cnt}=="0xc2"
    ATTRS{iodone_cnt}=="0xc2"
    ATTRS{ioerr_cnt}=="0x32"
    ATTRS{modalias}=="scsi:t-0x00"
    ATTRS{evt_media_change}=="0"
    ATTRS{queue_depth}=="1"
    ATTRS{queue_type}=="none"
    ATTRS{max_sectors}=="240"

  looking at parent device '/devices/pci0000:00/0000:00:0a.1/usb2/2-2/2-2:1.0/host14/target14:0:0':
    KERNELS=="target14:0:0"
    SUBSYSTEMS==""
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:0a.1/usb2/2-2/2-2:1.0/host14':
    KERNELS=="host14"
    SUBSYSTEMS==""
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:0a.1/usb2/2-2/2-2:1.0':
    KERNELS=="2-2:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb-storage"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{bInterfaceClass}=="08"
    ATTRS{bInterfaceSubClass}=="06"
    ATTRS{bInterfaceProtocol}=="50"
    ATTRS{modalias}=="usb:v058Fp6362d0129dc00dsc00dp00ic08isc06ip50"

  looking at parent device '/devices/pci0000:00/0000:00:0a.1/usb2/2-2':
    KERNELS=="2-2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bMaxPower}=="250mA"
    ATTRS{urbnum}=="3665"
    ATTRS{idVendor}=="058f"
    ATTRS{idProduct}=="6362"
    ATTRS{bcdDevice}=="0129"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="20"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Generic"
    ATTRS{product}=="Mass Storage Device"
    ATTRS{serial}=="058F312D81B"

  looking at parent device '/devices/pci0000:00/0000:00:0a.1/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="475"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0002"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="480"
    ATTRS{busnum}=="2"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 2.00"
    ATTRS{maxchild}=="10"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.26-1-amd64 ehci_hcd"
    ATTRS{product}=="EHCI Host Controller"
    ATTRS{serial}=="0000:00:0a.1"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:0a.1':
    KERNELS=="0000:00:0a.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="ehci_hcd"
    ATTRS{vendor}=="0x10de"
    ATTRS{device}=="0x036d"
    ATTRS{subsystem_vendor}=="0x147b"
    ATTRS{subsystem_device}=="0x1c21"
    ATTRS{class}=="0x0c0320"
    ATTRS{irq}=="22"
    ATTRS{local_cpus}=="00000003"
    ATTRS{local_cpulist}=="0-1"
    ATTRS{modalias}=="pci:v000010DEd0000036Dsv0000147Bsd00001C21bc0Csc03i20"
    ATTRS{numa_node}=="0"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
And here is the output of /var/log/messages when the USB card reader is connected to the USB bus:

Code:
Sep  6 17:56:15 hungover kernel: [242592.930555] usb 2-2: new high speed USB device using ehci_hcd and address 21
Sep  6 17:56:15 hungover kernel: [242593.075853] usb 2-2: configuration #1 chosen from 1 choice
Sep  6 17:56:15 hungover kernel: [242593.087287] scsi15 : SCSI emulation for USB Mass Storage devices
Sep  6 17:56:15 hungover kernel: [242593.087603] usb 2-2: New USB device found, idVendor=058f, idProduct=6362
Sep  6 17:56:15 hungover kernel: [242593.087609] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep  6 17:56:15 hungover kernel: [242593.087611] usb 2-2: Product: Mass Storage Device
Sep  6 17:56:15 hungover kernel: [242593.087614] usb 2-2: Manufacturer: Generic
Sep  6 17:56:15 hungover kernel: [242593.087616] usb 2-2: SerialNumber: 058F312D81B
Sep  6 17:56:20 hungover kernel: [242598.549402] scsi 15:0:0:0: Direct-Access     Generic  USB SD Reader    1.00 PQ: 0 ANSI: 0
Sep  6 17:56:20 hungover kernel: [242598.550229] scsi 15:0:0:1: Direct-Access     Generic  USB CF Reader    1.01 PQ: 0 ANSI: 0
Sep  6 17:56:20 hungover kernel: [242598.552978] scsi 15:0:0:2: Direct-Access     Generic  USB SM Reader    1.02 PQ: 0 ANSI: 0
Sep  6 17:56:20 hungover kernel: [242598.553810] scsi 15:0:0:3: Direct-Access     Generic  USB MS Reader    1.03 PQ: 0 ANSI: 0
Sep  6 17:56:20 hungover kernel: [242598.561009] sd 15:0:0:0: [sdc] Attached SCSI removable disk
Sep  6 17:56:20 hungover kernel: [242598.561060] sd 15:0:0:0: Attached scsi generic sg3 type 0
Sep  6 17:56:20 hungover kernel: [242598.568994] sd 15:0:0:1: [sdd] Attached SCSI removable disk
Sep  6 17:56:20 hungover kernel: [242598.569037] sd 15:0:0:1: Attached scsi generic sg4 type 0
Sep  6 17:56:20 hungover kernel: [242598.584182] sd 15:0:0:2: [sde] Attached SCSI removable disk
Sep  6 17:56:20 hungover kernel: [242598.584226] sd 15:0:0:2: Attached scsi generic sg5 type 0
Sep  6 17:56:20 hungover kernel: [242598.599961] sd 15:0:0:3: [sdf] Attached SCSI removable disk
Sep  6 17:56:20 hungover kernel: [242598.600006] sd 15:0:0:3: Attached scsi generic sg6 type 0
And this is what shows up in the /var/log/messages file for when the regular SD card is inserted:

Code:
Sep  6 17:56:48 hungover kernel: [242629.084410] usb 2-2: reset high speed USB device using ehci_hcd and address 21
Sep  6 17:56:50 hungover kernel: [242631.272656] usb 2-2: reset high speed USB device using ehci_hcd and address 21
Sep  6 17:56:56 hungover kernel: [242637.915127] usb 2-2: reset high speed USB device using ehci_hcd and address 21
Sep  6 17:57:06 hungover kernel: [242649.359772] sd 15:0:0:0: [sdc] 3970048 512-byte hardware sectors (2033 MB)
Sep  6 17:57:06 hungover kernel: [242649.363769] sd 15:0:0:0: [sdc] Write Protect is off
Sep  6 17:57:06 hungover kernel: [242649.367773] sd 15:0:0:0: [sdc] 3970048 512-byte hardware sectors (2033 MB)
Sep  6 17:57:06 hungover kernel: [242649.371772] sd 15:0:0:0: [sdc] Write Protect is off
Sep  6 17:57:06 hungover kernel: [242649.371772]  sdc:<6>usb 2-2: reset high speed USB device using ehci_hcd and address 21
Sep  6 17:57:07 hungover kernel: [242650.089520]  sdc1
Sep  6 17:57:07 hungover kernel: [242650.397513] usb 2-2: reset high speed USB device using ehci_hcd and address 21
And this is the /var/log/messages output when the new miniSDHC card is inserted:

Code:
Sep  6 17:58:42 hungover kernel: [242755.066129] sd 15:0:0:0: [sdc] 7813120 512-byte hardware sectors (4000 MB)
Sep  6 17:58:42 hungover kernel: [242755.070173] sd 15:0:0:0: [sdc] Write Protect is off
Sep  6 17:58:42 hungover kernel: [242755.074173] sd 15:0:0:0: [sdc] 7813120 512-byte hardware sectors (4000 MB)
Sep  6 17:58:42 hungover kernel: [242755.078552] sd 15:0:0:0: [sdc] Write Protect is off
Sep  6 17:58:42 hungover kernel: [242755.078565]  sdc: sdc1
Thanks
bgoodr
 
Old 09-06-2008, 09:14 PM   #2
{BBI}Nexus{BBI}
Senior Member
 
Registered: Jan 2005
Location: Nottingham, UK
Distribution: Mageia 6, KDE Neon
Posts: 4,313

Rep: Reputation: 212Reputation: 212Reputation: 212
See here: http://www.redhat.com/magazine/003jan05/features/hal/ and click the Callouts link.
 
Old 09-07-2008, 10:44 PM   #3
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by {BBI}Nexus{BBI} View Post
See here: http://www.redhat.com/magazine/003jan05/features/hal/ and click the Callouts link.
Thanks Nexus. That page was helpful in providing a basic HAL overview, and gets me a bit closer, but I'm still stumped.

I ran lshal before and after inserting the two different cards. Here is the lshal output for the SD card that works (the one that the system discovers is mountable and actually mounts into /media/disk):

Code:
udi = '/org/freedesktop/Hal/devices/volume_uuid_6237_6236'
  block.device = '/dev/sdc1'  (string)
  block.is_volume = true  (bool)
  block.major = 8  (0x8)  (int)
  block.minor = 33  (0x21)  (int)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_Generic_USB_SD_Reader_058F312D81B_0_0'  (string)
  info.capabilities = {'volume', 'block'} (string list)
  info.category = 'volume'  (string)
  info.interfaces = {'org.freedesktop.Hal.Device.Volume'} (string list)
  info.parent = '/org/freedesktop/Hal/devices/storage_serial_Generic_USB_SD_Reader_058F312D81B_0_0'  (string)
  info.product = 'Volume (vfat)'  (string)
  info.udi = '/org/freedesktop/Hal/devices/volume_uuid_6237_6236'  (string)
  linux.hotplug_type = 3  (0x3)  (int)
  linux.sysfs_path = '/sys/block/sdc/sdc1'  (string)
  org.freedesktop.Hal.Device.Volume.method_argnames = {'mount_point fstype extra_options', 'extra_options', 'extra_options'} (string list)
  org.freedesktop.Hal.Device.Volume.method_execpaths = {'hal-storage-mount', 'hal-storage-unmount', 'hal-storage-eject'} (string list)
  org.freedesktop.Hal.Device.Volume.method_names = {'Mount', 'Unmount', 'Eject'} (string list)
  org.freedesktop.Hal.Device.Volume.method_signatures = {'ssas', 'as', 'as'} (string list)
  storage.model = ''  (string)
  volume.block_size = 512  (0x200)  (int)
  volume.fstype = 'vfat'  (string)
  volume.fsusage = 'filesystem'  (string)
  volume.fsversion = 'FAT16'  (string)
  volume.ignore = false  (bool)
  volume.is_disc = false  (bool)
  volume.is_mounted = true  (bool)
  volume.is_mounted_read_only = false  (bool)
  volume.is_partition = true  (bool)
  volume.label = ''  (string)
  volume.linux.is_device_mapper = false  (bool)
  volume.mount.valid_options = {'ro', 'sync', 'dirsync', 'noatime', 'nodiratime', 'noexec', 'quiet', 'remount', 'exec', 'utf8', 'shortname=', 'codepage=', 'iocharset=', 'umask=', 'dmask=', 'fmask=', 'uid=', 'flush'} (string list)
  volume.mount_point = '/media/disk'  (string)
  volume.num_blocks = 3967239  (0x3c8907)  (int)
  volume.partition.flags = {} (string list)
  volume.partition.label = ''  (string)
  volume.partition.media_size = 2032664576  (0x79280000)  (uint64)
  volume.partition.number = 1  (0x1)  (int)
  volume.partition.scheme = 'mbr'  (string)
  volume.partition.start = 127488  (0x1f200)  (uint64)
  volume.partition.type = '0x06'  (string)
  volume.partition.uuid = ''  (string)
  volume.size = 2031226368  (0x79120e00)  (uint64)
  volume.unmount.valid_options = {'lazy'} (string list)
  volume.uuid = '6237-6236'  (string)
lshal also shows a new device object added when I insert the miniSDHC card into the USB card reader below:

Code:
udi = '/org/freedesktop/Hal/devices/volume_part1_size_4000285184'
  block.device = '/dev/sdc1'  (string)
  block.is_volume = true  (bool)
  block.major = 8  (0x8)  (int)
  block.minor = 33  (0x21)  (int)
  block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_Generic_USB_SD_Reader_058F312D81B_0_0'  (string)
  info.capabilities = {'volume', 'block'} (string list)
  info.category = 'volume'  (string)
  info.parent = '/org/freedesktop/Hal/devices/storage_serial_Generic_USB_SD_Reader_058F312D81B_0_0'  (string)
  info.product = 'Volume'  (string)
  info.udi = '/org/freedesktop/Hal/devices/volume_part1_size_4000285184'  (string)
  linux.hotplug_type = 3  (0x3)  (int)
  linux.sysfs_path = '/sys/block/sdc/sdc1'  (string)
  storage.model = ''  (string)
  volume.block_size = 512  (0x200)  (int)
  volume.fstype = ''  (string)
  volume.fsusage = ''  (string)
  volume.fsversion = ''  (string)
  volume.is_disc = false  (bool)
  volume.is_mounted = false  (bool)
  volume.is_mounted_read_only = false  (bool)
  volume.is_partition = true  (bool)
  volume.label = ''  (string)
  volume.linux.is_device_mapper = false  (bool)
  volume.mount_point = ''  (string)
  volume.num_blocks = 7813057  (0x7737c1)  (int)
  volume.partition.flags = {} (string list)
  volume.partition.label = ''  (string)
  volume.partition.media_size = 4000317440  (0xee700000)  (uint64)
  volume.partition.number = 1  (0x1)  (int)
  volume.partition.scheme = 'mbr'  (string)
  volume.partition.start = 32256  (0x7e00)  (uint64)
  volume.partition.type = '0x0b'  (string)
  volume.partition.uuid = ''  (string)
  volume.size = 4000285184  (0xee6f8200)  (uint64)
  volume.uuid = ''  (string)
But notice both volume.uuid and the volume.fstype are empty. I suspect that the miniSDHC card is a FAT32 type filesystem and is 4GB in size, while the normal SD card is is FAT16 and only 2GB in size (which is reflected in the volume.fstype = 'vfat' line in the output for the normal SD card).

I took a closer look at the /var/log files, and saw that, when connecting the normal SD card, I see this added to /var/log/daemon.log:

Code:
Sep  7 18:27:53 hungover NetworkManager: <debug> [1220837273.762931] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/volume_uuid_6237_6236'). 
Sep  7 18:27:53 hungover hald: mounted /dev/sdc1 on behalf of uid 1000
But when connecting the miniSDHC card, I only see this:

Code:
Sep  7 18:24:53 hungover NetworkManager: <debug> [1220837093.890870] nm_hal_device_added(): New device added (hal udi is '/org/freedesktop/Hal/devices/volume_part1_size_4000285184').
So, is the missing uuid on the card the problem, or is that because there is a incomplete HAL device information file? Or, is the missing volume.fstype value the key to the problem here?

Also, how do I map the above lshal output for the working SD card back to the specific HAL configuration files under /usr/share/hal/fdi/information/, so that I can figure out what is missing?

Thanks for your help!
bgoodr
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying files and sub-directories of a directory except the directories named ".abc" sri1025 Linux - General 2 08-24-2010 08:53 AM
Samba: "homes" share, cannot create directories, can create files Herg Linux - Software 1 09-14-2006 08:48 AM
K3b: - Howto re-dock "Directories" and "Contents" windows back into the main window? hagies Linux - Software 4 04-26-2006 08:38 AM
Why doesn't a wildcard chmod change "dot" files/directories? jht2k Linux - General 1 08-09-2004 02:31 PM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-29-2004 11:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration