#1483 PR merged: Avoid log messages about multiple disk partitions with identical name

Labels: enhancement, fixed / solved / done, minor bug

OliverO2 opened issue at 2017-09-12 10:55:

Problem:

Original gpt disk partitions may be unnamed. As parted requires a name for each gpt partition, ReaR currently supplies "rear-noname" for originally unnamed partitions. This leads to systemd log messages during rear recover and in boot logs:

Dev dev-disk-by\x2dpartlabel-rear\x2dnoname.device appeared twice with different sysfs paths

Solution:

To supply unique names for unnamed partitions, just use the basename of the partition's device path, e.g. sda1, sda2, ...

The suggested change also strips unnecessary quotes from parted invocations.

Tested on Ubuntu 16.04.3 LTS (gpt only).

schlomo commented at 2017-09-12 11:20:

Good catch. Can you tell us why you fix the type name during recovery and not already during the mkrescue phase? In usr/share/rear/layout/save/GNU/Linux/200_partition_layout.sh this name is initially generated, I think that there you could already set such a unique name.

OliverO2 commented at 2017-09-12 12:02:

Nameless partitions seem fine with the UEFI spec, so it's actually a parted limitation which might go away in a future version of parted or with some other partitioning tool. Keeping "rear-noname" around as a marker for an originally unnamed partition has two advantages:

  • As better tools become available we could re-create a true-to-original partition table.
  • The user can edit disklayout.conf and add partitions without having to worry about assigning unique partition names.

Tools background: The parted manual page is actually out of date with respect to the mkpart command, but the user's manual clearly states A name must be specified for a ‘gpt’ partition table. In contrast, gparted does not have this restriction.

jsmeix commented at 2017-09-14 11:52:

If there are no strict objections
I would like to merge it soon...


[Export of Github issue for rear/rear.]