Bug 399791 - Partitionmanager tries to check whole disk instead of partition after restore operation
Summary: Partitionmanager tries to check whole disk instead of partition after restore...
Status: RESOLVED FIXED
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (show other bugs)
Version: 3.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Andrius Štikonas
URL: https://bugzilla.redhat.com/show_bug....
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-14 13:30 UTC by Mattia
Modified: 2019-05-10 01:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.0.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mattia 2018-10-14 13:30:19 UTC
Restoring a partition from a backup ends with a failure message, but the restore is successful. It seems that PM tries to check the whole disk instead of the partition in the end, so it gets a failure:
https://bugzilla.redhat.com/show_bug.cgi?id=1639021
Comment 1 Mattia 2019-02-17 10:15:46 UTC
With PM 3.80.0 the problem has now changed: the "Check file system" operation is now successful (it correctly checks the recovered partition instead of the whole disk), but after that a warning is produced in the "Maximize file system" operation:

Job: Check file system on partition ‘/dev/vdb1’ 
Command: fsck.fat -a -w -v /dev/vdb1 
Check file system on partition ‘/dev/vdb1’: Success

Job: Maximize file system on ‘/dev/vdb1’ to fill the partition 
Resizing file system from 1262485504 to 2465792 sectors. 

Command: fatresize --verbose --size 1262485504 /dev/vdb1 
Maximize file system on ‘/dev/vdb1’ to fill the partition: Error

WARNING: Maximizing file system on target partition ‘/dev/vdb1’ to the size of the partition failed. 
Restore partition on ‘/dev/vdb’ at 1,00 MiB from ‘/home/rpmbuild/testbkp’: Warning
Comment 2 Kevin Kofler 2019-05-09 07:55:22 UTC
The downstream reporter still has the same issue with KPM 4.0.0, see the attached log:
https://bugzilla.redhat.com/attachment.cgi?id=1565953
Comment 3 Mattia 2019-05-09 09:51:19 UTC
I can reproduce the bug only if I try to restore to an already existent partition.

For example, if I choose to restore the partition to unallocated space on the disk, PM will firstly create the partition, then it prints:
Restore partition from ‘/home/taurus/efi.raw’ to ‘/dev/sda2’
Job: Restore the file system from file ‘/home/taurus/efi.raw’ to partition ‘/dev/sda2’
...
Restore the file system from file ‘/home/taurus/efi.raw’ to partition ‘/dev/sda2’: Success
Job: Check file system on partition ‘/dev/sda2’

But if I choose to restore to an already partition I get the same output of the submitter's log.

Pay attention to the change of the partition name from the second line onward: the first line correctly outputs '/dev/sda2' in both cases, but when restoring to an already existent partition it points to '/dev/sda'.
Comment 4 Andrius Štikonas 2019-05-09 17:51:16 UTC
2019 m. gegužės 9 d., ketvirtadienis 10:51:19 BST rašėte:
> https://bugs.kde.org/show_bug.cgi?id=399791
> 
> --- Comment #3 from Mattia <mattia.verga@tiscali.it> ---
> I can reproduce the bug only if I try to restore to an already existent
> partition.

Thanks! This piece of information is really useful.
Comment 5 Andrius Štikonas 2019-05-10 01:13:14 UTC
Git commit 4b6a26f0f80060d522e485c0ebf1b14eb089ef52 by Andrius Štikonas.
Committed on 10/05/2019 at 01:12.
Pushed by stikonas into branch 'master'.

Fix setting partition path when restoring partitions.

M  +1    -1    src/ops/restoreoperation.cpp

https://invent.kde.org/kde/kpmcore/commit/4b6a26f0f80060d522e485c0ebf1b14eb089ef52