On Mon, Jun 01, 2020 at 01:35:44AM +0200, Stanislav Brabec wrote: > Device mapper devices don't provide start sector. for which type of the device/mapping? I'd like to reproduce this issue. > It causes "blockdev --report" error: > blockdev: /dev/dm-9: failed to read partition start from sysfs: No such > file or directory > > There is no reliable way to detect a geometry in this case. > Report N/A instead. I guess the "start" file missing in the sysfs/ in this case, right? > if (ul_path_read_u64(pc, &start, "start") != 0) > - err(EXIT_FAILURE, > - _("%s: failed to read partition start from sysfs"), > - device); > + /* TRANSLATORS: Start sector not available. Max. 10 > letters. */ > + sprintf(start_str, "%10s", _("N/A")); > } > ul_unref_path(pc); > } > + if (start_str[0] == 0) > + sprintf(start_str, "%10ju", start); Maybe we ca use ul_path_read_buffer() rather than ul_path_read_u64() to keep it as string and to avoid sprintf(). Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com