You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observed on the current master branch, as well as versions packaged in Debian and Amazon Linux 2.
By opening the nvme block devices in read/write mode, ebsnvme-id triggers a kernel "change" event, which translates to the device nodes corresponding to the partitions being deleted and recreated. Similarly, the sysfs files corresponding with the partitions are also deleted and recreated.
To reproduce:
Launch an EC2 instance with a partitioned secondary EBS volume attached (seen as /dev/nvme1n1 here):
admin@ip-10-0-0-75:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 8G 0 disk
├─nvme0n1p1 259:1 0 7.9G 0 part /
└─nvme0n1p15 259:2 0 127M 0 part /boot/efi
nvme1n1 259:3 0 8G 0 disk
├─nvme1n1p1 259:4 0 7.9G 0 part
├─nvme1n1p14 259:5 0 3M 0 part
└─nvme1n1p15 259:6 0 124M 0 part
Note the inode number of one of the partition device nodes in /dev, e.g:
admin@ip-10-0-0-75:~$ stat --format="%i" /dev/nvme1n1p1
566
Start udevadm monitor in a second session.
Run sudo /sbin/ebsnvme-id /dev/nvme1n1
Note the inode number of the partition device:
admin@ip-10-0-0-75:~$ stat --format="%i" /dev/nvme1n1p1
598
Note the output of udevadm monitor, which will indicate the child device removal and recreation similar to the following:
Similar behavior can be observed with respect to the files in the /sys/block/nvme1n1/nvme1n1p*/ directories.
Since the ebsnvme-id script is only supposed to be gathering metadata about volumes in a read-only manner, its invocation should not trigger a kernel change event.
The text was updated successfully, but these errors were encountered:
nmeyerhans
pushed a commit
to nmeyerhans/amazon-ec2-utils
that referenced
this issue
Nov 30, 2021
Opening block devices in read/write mode triggers a kernel change event, which
leads to the child devices (corresponding with the partitions) being deleted
and recreated. See amazonlinux#15 for
background and further details.
Opening the fd in read-only mode still provides access to the NVME ioctl()
interface, but avoids the unnecessary change event.
Observed on the current master branch, as well as versions packaged in Debian and Amazon Linux 2.
By opening the nvme block devices in read/write mode,
ebsnvme-id
triggers a kernel "change" event, which translates to the device nodes corresponding to the partitions being deleted and recreated. Similarly, the sysfs files corresponding with the partitions are also deleted and recreated.To reproduce:
Launch an EC2 instance with a partitioned secondary EBS volume attached (seen as /dev/nvme1n1 here):
Note the inode number of one of the partition device nodes in /dev, e.g:
Start
udevadm monitor
in a second session.Run
sudo /sbin/ebsnvme-id /dev/nvme1n1
Note the inode number of the partition device:
Note the output of
udevadm monitor
, which will indicate the child device removal and recreation similar to the following:Similar behavior can be observed with respect to the files in the
/sys/block/nvme1n1/nvme1n1p*/
directories.Since the
ebsnvme-id
script is only supposed to be gathering metadata about volumes in a read-only manner, its invocation should not trigger a kernel change event.The text was updated successfully, but these errors were encountered: