crash on duplicate UUID
drzraf opened this issue · 4 comments
I want to move to a bigger hard-drive and follow that 3-steps road:
dd if=sdb of=sdc
from the current (small) drive to the destination one (all partition)luks open /dev/sdc3
(using a distinct mapper-name)- rename/resize the LV (where blivet could be handy).
But Blivet fails as soon as duplicated UUID are detected:
File "/usr/lib/python3/dist-packages/blivet/devicetree.py", line 181, in _add_device
raise DuplicateUUIDError("Duplicate UUID '%s' found for devices: "
blivet.errors.DuplicateUUIDError: Duplicate UUID '4eac3870-d436-45e1-a32d-xxxx' found for devices: 'sdb1' and 'sdc1'.
Worth mentioning that in this case, these sd*1
partition are EFI System
Unfortunately blivet doesn't allow duplicate UUIDs in the system and AFAICT there is no plan to change it in the future. blivet-gui already has some code that allows ignoring disks with corrupted partitions tables so I could do something similar for duplicate UUIDs -- dialog that allows ignoring one (or both) disks with duplicates. I'll see what can I do to make this work.
gparted
can take a device path as its first argument. In that case, scanning & co will only stay within that scope. That could allow a user to avoid some (most?) of this kind of conflicts.
That is actually a very good idea and also very simple to implement, thanks! I've posted a PR with this functionality #247 and it should be available in the next release (not sure when that will be).
Please reopen. With Blivet 2.4.0, I still experiencing the same problem, here running blivet-gui /dev/sdb
or blivet-gui /dev/mapper/luks-ffaf1e28-2086-406f-8cbd-1739d76dd6fc
File "/usr/lib/python3/dist-packages/blivet/populator/populator.py", line 446, in populate
self._populate()
File "/usr/lib/python3/dist-packages/blivet/threads.py", line 53, in run_with_lock
return m(*args, **kwargs)
File "/usr/lib/python3/dist-packages/blivet/populator/populator.py", line 490, in _populate
self.handle_device(dev)
File "/usr/lib/python3/dist-packages/blivet/threads.py", line 53, in run_with_lock
return m(*args, **kwargs)
File "/usr/lib/python3/dist-packages/blivet/populator/populator.py", line 297, in handle_device
device = helper_class(self, info).run()
File "/usr/lib/python3/dist-packages/blivet/populator/helpers/partition.py", line 98, in run
self._devicetree._add_device(device)
File "/usr/lib/python3/dist-packages/blivet/threads.py", line 53, in run_with_lock
return m(*args, **kwargs)
File "/usr/lib/python3/dist-packages/blivet/devicetree.py", line 181, in _add_device
raise DuplicateUUIDError("Duplicate UUID '%s' found for devices: "
blivet.errors.DuplicateUUIDError: Duplicate UUID '4eac3870-d436-45e1-a32d-fafedd9e0d11' found for devices: 'nvme0n1p1' and 'sdb1'.
During handling of the above exception, another exception occurred:
File "/usr/lib/python3/dist-packages/blivetgui/communication/server.py", line 270, in _blivet_utils_init
self.blivet_utils = BlivetUtils(*args)
File "/usr/lib/python3/dist-packages/blivetgui/blivet_utils.py", line 167, in __init__
self.blivet_reset()
File "/usr/lib/python3/dist-packages/blivetgui/blivet_utils.py", line 1541, in blivet_reset
self.storage.reset()
File "/usr/lib/python3/dist-packages/blivet/threads.py", line 53, in run_with_lock
return m(*args, **kwargs)
File "/usr/lib/python3/dist-packages/blivet/blivet.py", line 140, in reset
self.devicetree.populate(cleanup_only=cleanup_only)
File "/usr/lib/python3/dist-packages/blivet/threads.py", line 53, in run_with_lock
return m(*args, **kwargs)
File "/usr/lib/python3/dist-packages/blivet/populator/populator.py", line 449, in populate
self._hide_ignored_disks()
File "/usr/lib/python3/dist-packages/blivet/threads.py", line 53, in run_with_lock
return m(*args, **kwargs)
File "/usr/lib/python3/dist-packages/blivet/devicetree.py", line 994, in _hide_ignored_disks
self.hide(disk)
File "/usr/lib/python3/dist-packages/blivet/threads.py", line 53, in run_with_lock
return m(*args, **kwargs)
File "/usr/lib/python3/dist-packages/blivet/devicetree.py", line 872, in hide
self.hide(d)
File "/usr/lib/python3/dist-packages/blivet/threads.py", line 53, in run_with_lock
return m(*args, **kwargs)
File "/usr/lib/python3/dist-packages/blivet/devicetree.py", line 879, in hide
self._remove_device(device, force=True, modparent=False)
File "/usr/lib/python3/dist-packages/blivet/threads.py", line 53, in run_with_lock
return m(*args, **kwargs)
File "/usr/lib/python3/dist-packages/blivet/devicetree.py", line 212, in _remove_device
raise ValueError("Device '%s' not in tree" % dev.name)
ValueError: Device 'nvme0n1p1' not in tree
------------------------------
File "/usr/bin/blivet-gui", line 115, in <module>
main()
File "/usr/bin/blivet-gui", line 109, in main
BlivetGUI(client, exclusive_disks=options.disks)
File "/usr/lib/python3/dist-packages/blivetgui/blivetgui.py", line 113, in __init__
self.blivet_init()
File "/usr/lib/python3/dist-packages/blivetgui/blivetgui.py", line 812, in blivet_init
self._reraise_exception(ret.exception, ret.traceback, message,
File "/usr/lib/python3/dist-packages/blivetgui/blivetgui.py", line 243, in _reraise_exception
raise type(exception)(message + "\n" + str(exception) + "\n" + traceback)