Partition not visible - systemd-udev inotify add watch failed

Category: myblog Written by Jiri Kanicky Hits: 20555

Hi there. My USB stick partition was not visible when I plugged a USB flash driveĀ into a server running Debian Jessie and MDADM. Here is more information about the issue and how I resolved it.

Symptom

When you plug USB Drive with partition in a system running Debian Jessie and MDADM, you might get the following error in the syslog and partition will not be visible in /dev/* directories.

Jan 11 14:12:44 dom1 kernel: [1369462.538252] sdg: sdg1 Jan 11 14:12:46 dom1 kernel: [1369464.074130] md: export_rdev(sdg) Jan 11 14:12:46 dom1 kernel: [1369464.074885] md: export_rdev(sdg) Jan 11 14:12:46 dom1 systemd-udevd[31751]: inotify_add_watch(6, /dev/sdg1, 10) failed: No such file or directory

Problem

The issue is related to MDADM scan.

Solution

Stop scanning all partitions by MDADM,

  1. Edit /etc/mdadm/mdadm.conf.
  2. Comment out "DEVICE partitions"
  3. List only devices which are part of MDADM.

Example:

# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired. 
DEVICE partitions DEVICE /dev/disk/by-id/ata-ST3320620AS_6QF0FQMW*
DEVICE /dev/disk/by-id/ata-ST3320620AS_6QF0FRMH* 
DEVICE /dev/disk/by-id/ata-ST2000DM001-1CH164_Z1E2B8BC*
DEVICE /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E0HM1S*
DEVICE /dev/disk/by-id/ata-ST2000DM001-9YN164_Z1E0GNM*