[udev] /dev/disk/by-path missing

Bug #1193705 reported by James Page
40
This bug affects 10 people
Affects Status Importance Assigned to Milestone
ceph (Ubuntu)
Fix Released
High
Unassigned
systemd (Ubuntu)
Won't Fix
Low
Unassigned

Bug Description

Latest cloud image for Ubuntu Saucy; /dev/disk/by-path is missing:

ubuntu@juju-saucy-instance-0:~$ find /dev/disk
/dev/disk
/dev/disk/by-uuid
/dev/disk/by-uuid/80aed723-838e-44b9-90a9-f1b2c04f7c87
/dev/disk/by-label
/dev/disk/by-label/cloudimg-rootfs
/dev/disk/by-label/config-2
ubuntu@juju-saucy-instance-0:~$

I've not seen this in < Saucy and can repeat this reliably using the saucy daily images.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: udev 204-0ubuntu4
ProcVersionSignature: User Name 3.9.0-6.14-generic 3.9.6
Uname: Linux 3.9.0-6-generic x86_64
ApportVersion: 2.10.2-0ubuntu2
Architecture: amd64
CurrentDmesg: [ 6.952094] init: plymouth-stop pre-start process (1125) terminated with status 1
Date: Sat Jun 22 21:32:23 2013
Ec2AMI: ami-0000002a
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.tiny
Ec2Kernel: aki-00000002
Ec2Ramdisk: ari-00000002
Lsusb:
 Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd
 Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: OpenStack Foundation OpenStack Nova
MarkForUpload: True
ProcEnviron:
 TERM=screen
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.9.0-6-generic root=LABEL=cloudimg-rootfs ro console=tty1 console=ttyS0
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 01/01/2011
dmi.bios.vendor: Bochs
dmi.bios.version: Bochs
dmi.chassis.type: 1
dmi.chassis.vendor: Bochs
dmi.modalias: dmi:bvnBochs:bvrBochs:bd01/01/2011:svnOpenStackFoundation:pnOpenStackNova:pvr2013.1.1:cvnBochs:ct1:cvr:
dmi.product.name: OpenStack Nova
dmi.product.version: 2013.1.1
dmi.sys.vendor: OpenStack Foundation

Revision history for this message
James Page (james-page) wrote :
Martin Pitt (pitti)
summary: - /dev/disk/by-path missing in saucy cloud image
+ [udev] /dev/disk/by-path missing
Changed in systemd (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Martin Pitt (pitti) wrote :

I bisected this down to http://git.kernel.org/cgit/linux/hotplug/udev.git/commit/?id=481dcf7c8f; reverting it makes the by-path/ reappear, but disabling it for ATA devices (which only have a SCSI driver, but are not physically SCSI) was quite deliberate. Is this causing actual problems, or did you just happen to notice it?

Changed in systemd (Ubuntu):
importance: Medium → Low
status: Triaged → Incomplete
Revision history for this message
James Page (james-page) wrote :

Martin

I picked it up because it causes problems with the tooling that ceph uses to prepare disks for use in a ceph cluster.

The tools use the /dev/disk/by-path tree to detect whether specific devices are already in use or not; so it would be nice if it could be restored!

Revision history for this message
Martin Pitt (pitti) wrote :

> The tools use the /dev/disk/by-path tree to detect whether specific devices are already in use or not;

The by-path for ATA devices was removed because it was possible for the same device to have multiple different by-path names; what does "in use" mean in that context?

Revision history for this message
James Page (james-page) wrote :

Easiest to refer to the code that uses this:

List all devices and partitions:
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/saucy/ceph/saucy/view/head:/src/ceph-disk#L179

Check whether a given device is a partition or a full disk:
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/saucy/ceph/saucy/view/head:/src/ceph-disk#L222

Changed in ceph (Ubuntu):
importance: Undecided → High
Revision history for this message
James Page (james-page) wrote :

Raising a task for ceph as well as this is the key impact I'm currently aware of.

Revision history for this message
Martin Pitt (pitti) wrote :

While we can technically put /dev/disks/by-path back for ATA devices in Ubuntu, that still won't help upstream ceph on other distros, and I believe this approach is buggy anyway. is_partition() currently looks a bit underdefined/buggy to me, as it's not uncommon to have file systems on unpartitioned block devices (i. e. mounting /dev/sdb directly); this will also completely miss devmapper or other "virtual" devices. To mimic the current behaviou, one could do something like

  return not os.path.exists('/sys/block/%s' % os.path.basename(dev))

as devices will be there (like /sys/block/sdb), and partitions under that (like /sys/block/sdb/sdb2). But again, that's not really what you want there: Judging by how is_partition() is being used in verify_not_in_use(), it should probably be called is_filesystem() and query udev (CLI example: udevadm info --name=/dev/sda2 | grep ID_FS) or blkid.

There are a couple of options how to rewrite these functions, including reading /sys/block/, /proc/partitions, asking blkid, querying udevadm, or querying udisks.

If you want a list of block devices with mountable file systems which are present, and don't want to use any extra libraries, then perhaps the simplest thing is

  udevadm trigger --dry-run --verbose --property-match=ID_FS_USAGE=filesystem

(this doesn't need any root privileges). If you want all block devices, then

  udevadm trigger --dry-run --verbose --subsystem-match=block

will give a list, including device-mapper (and also loopback, etc.).

Revision history for this message
James Page (james-page) wrote :

Hi Martin

Thanks for the detailed response on different ways to tackle this issue; I'll review and see what we can do with upstream to resolve this.

Martin Pitt (pitti)
Changed in systemd (Ubuntu):
status: Incomplete → Won't Fix
Revision history for this message
James Page (james-page) wrote :

This has been resolved in the latest upstream releases.

Changed in ceph (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.