1. Add two 1 TB physical volumes to a new LVM volume group. Add one logical volume of 1 TB of type RAID1 to that volume group. You now have two identical disks and have consumed all available space in that volume group. 2. Open partitionmanager and select the volume group. Expected: Should show one volume of 2 (or “2x1”) TB, and 0 unallocated storage. Actual: Displays one volume of 1 TB and incorrectly shows 1 TB to be unallocated.
LVM raid levels (or other advanced features) are not implemented yet. KPM itself does not allow to create LVs with raid but obviously you can create them externally, so it would be nice to at least fix this (LVM RAID creation in KPM can come later...) I think most code changes would be in kpmcore/src/core/lvmdevice.cpp most probably in initPartitions function. If you have some time, I encourage you to look at this issue, if not, I'll try to fix it at some point later myself. Although, I think there might be an assumption in kpmcore that Device size = Sum over partitions sizes + free spaces, so we might need to find a way to double count those partitions in RAID1 (and I think we might need to take into account that there might be even more than 2 drives).
I’m not requesting that you implement RAID creation. That would probably be quite a huge task. However, KPM should be aware of software RAIDs and display these properly in the UI, and potentially also disable UI that modify these in unsupported ways. This may be a generic issue that also applies to RAIDs created on top of Btrfs, ZFS, (and Stratis?) I’ve not tested anything but LVM, however.
After some further investigation, I think the easiest way to fix it is in kpmcore/src/core/partitiontable.cpp::updateUnallocated
(In reply to Andrius Štikonas from comment #3) > After some further investigation, I think the easiest way to fix it is in > kpmcore/src/core/partitiontable.cpp::updateUnallocated s/updateUnallocated/insertUnallocated/
Git commit 4fcbb540e05988c7cb73c091ca912756933a3e32 by Andrius Štikonas. Committed on 24/07/2018 at 20:39. Pushed by stikonas into branch 'kauth'. Fix unallocated space calculation in the presence of LVM RAID partitions. M +18 -10 src/core/partitiontable.cpp https://commits.kde.org/kpmcore/4fcbb540e05988c7cb73c091ca912756933a3e32