[Pkg-utopia-maintainers] Bug#648810: Bug#648810: udisks-daemon: regression from squeeze: partitions on USB disks are not scanned by default

Bjørn Mork bjorn at mork.no
Tue Nov 15 12:59:09 UTC 2011


reassign 648810 udev 172-1
thanks

Michael Biebl <biebl at debian.org> writes:

> What exactly used to work? udisks-daemon has always been started on
> demand so I fail to see the regression wrt udisks.

Right.  Sorry about jumping to conclusions when noticing that simply
running "udisks --dump" fixed my problem. 

I'm reassigning this bug to udev now, hoping that is more correct....


>> My question is really "what service is responsible for calling the
>> BLKRRPART ioctl whenever a new disk is detected?"
>
> $ grep blkid /lib/udev/rules.d/*
> /lib/udev/rules.d/60-persistent-storage-dm.rules:IMPORT{program}="/sbin/blkid
> -o udev -p $tempnode"
> /lib/udev/rules.d/60-persistent-storage.rules:
> IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O
> $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
> /lib/udev/rules.d/60-persistent-storage.rules:
> IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
> /lib/udev/rules.d/60-persistent-storage.rules:KERNEL!="sr*",
> IMPORT{program}="/sbin/blkid -o udev -p $tempnode"


Thanks.  I just verified that running 

 /sbin/blkid -o udev -p /dev/sdb

does fix the problem for me as well.  So I should probably look for any
rule changes which may cause this rule to be skipped.


> That sounds like either an issue in udev or the kernel not generating
> proper uevents when the device is plugged in.
>
> It sounds like running udisks-daemon triggers a uevent which causes udev
> to probe the partition on that device.
>
> Marco, do you have maybe an idea why the partition is not correctly
> probed initially?
>
> Bjørn, what does udevadm info --query=all --name=sdb show after you
> plugged in your device (and udisks daemon is not running).

nemi:/tmp# udevadm info --query=all --name=sdb
P: /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host15/target15:0:0/15:0:0:0/block/sdb
N: sdb
S: disk/by-id/usb-SEMC_Mass_Storage_43423531314D42573144-0:0
S: disk/by-path/pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0
E: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host15/target15:0:0/15:0:0:0/block/sdb
E: MAJOR=8
E: MINOR=16
E: DEVNAME=/dev/sdb
E: DEVTYPE=disk
E: SUBSYSTEM=block
E: ID_VENDOR=SEMC
E: ID_VENDOR_ENC=SEMC\x20\x20\x20\x20
E: ID_VENDOR_ID=0fce
E: ID_MODEL=Mass_Storage
E: ID_MODEL_ENC=Mass\x20Storage\x20\x20\x20\x20
E: ID_MODEL_ID=3138
E: ID_REVISION=0001
E: ID_SERIAL=SEMC_Mass_Storage_43423531314D42573144-0:0
E: ID_SERIAL_SHORT=43423531314D42573144
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_00_1d_7-usb-0_1_1_0-scsi-0_0_0_0
E: UDISKS_PRESENTATION_NOPOLICY=0
E: DEVLINKS=/dev/disk/by-id/usb-SEMC_Mass_Storage_43423531314D42573144-0:0 /dev/disk/by-path/pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0

nemi:/tmp# cat /proc/partitions 
major minor  #blocks  name

   8        0  125034840 sda
   8        1     129724 sda1
   8        2  124904988 sda2
 254        0  124903960 dm-0
 254        1  119668736 dm-1
 254        2    5234688 dm-2


> If you run "echo change > /sys/block/sdb/uevent", do you partitions show
> up? how does the udevadm info look then?

Yes, they do:

nemi:/tmp# echo change > /sys/block/sdb/uevent
nemi:/tmp# cat /proc/partitions 
major minor  #blocks  name

   8        0  125034840 sda
   8        1     129724 sda1
   8        2  124904988 sda2
 254        0  124903960 dm-0
 254        1  119668736 dm-1
 254        2    5234688 dm-2
   8       16   15558144 sdb
   8       17   15554048 sdb1

nemi:/tmp# udevadm info --query=all --name=sdb
P: /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host15/target15:0:0/15:0:0:0/block/sdb
N: sdb
S: disk/by-id/usb-SEMC_Mass_Storage_43423531314D42573144-0:0
S: disk/by-path/pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0
E: UDEV_LOG=3
E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host15/target15:0:0/15:0:0:0/block/sdb
E: MAJOR=8
E: MINOR=16
E: DEVNAME=/dev/sdb
E: DEVTYPE=disk
E: SUBSYSTEM=block
E: ID_VENDOR=SEMC
E: ID_VENDOR_ENC=SEMC\x20\x20\x20\x20
E: ID_VENDOR_ID=0fce
E: ID_MODEL=Mass_Storage
E: ID_MODEL_ENC=Mass\x20Storage\x20\x20\x20\x20
E: ID_MODEL_ID=3138
E: ID_REVISION=0001
E: ID_SERIAL=SEMC_Mass_Storage_43423531314D42573144-0:0
E: ID_SERIAL_SHORT=43423531314D42573144
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_00_1d_7-usb-0_1_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_TYPE=dos
E: UDISKS_PRESENTATION_NOPOLICY=0
E: UDISKS_PARTITION_TABLE=1
E: UDISKS_PARTITION_TABLE_SCHEME=mbr
E: UDISKS_PARTITION_TABLE_COUNT=1
E: DEVLINKS=/dev/disk/by-id/usb-SEMC_Mass_Storage_43423531314D42573144-0:0 /dev/disk/by-path/pci-0000:00:1d.7-usb-0:1:1.0-scsi-0:0:0:0


>From the looks of it, it seems that the "change" event caused both
/sbin/blkid (adding ID_PART_TABLE_TYPE) and /lib/udev/udisks-part-id
(adding UDISKS_PARTITION_TABLE*) to run. For your reference, this is the
output when running those commands manually:


nemi:/tmp# /sbin/blkid -o udev -p /dev/sdb
ID_PART_TABLE_TYPE=dos

nemi:/tmp# /lib/udev/udisks-part-id /dev/sdb
using device_file=/dev/sdb syspath=/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host15/target15:0:0/15:0:0:0/block/sdb, offset=0 ao=0 and number=0 for /dev/sdb
Entering MS-DOS parser (offset=0, size=15931539456)
MSDOS_MAGIC found
looking at part 0 (offset 4194304, size 15927345152, type 0x0c)
new part entry
looking at part 1 (offset 0, size 0, type 0x00)
new part entry
looking at part 2 (offset 0, size 0, type 0x00)
new part entry
looking at part 3 (offset 0, size 0, type 0x00)
new part entry
Exiting MS-DOS parser
MSDOS partition table detected
UDISKS_PARTITION_TABLE=1
UDISKS_PARTITION_TABLE_SCHEME=mbr
UDISKS_PARTITION_TABLE_COUNT=1


So now I guess the question is why that doesn't happen automatically
anymore?  udev rule changes, or kernel interface changes?



Bjørn





More information about the Pkg-utopia-maintainers mailing list