I booted my laptop with a Kubuntu 16.04 live USB and used KDE Partition Manager (version 1.2.1) to look at the internal HDD (/dev/sda). The main partition (/dev/sda3, ext4) was 442.91 GiB and Partition Manager reported that 41.29 GiB was used.
I then used KDE Partition Manager to shrink sda3 to 45 GiB. After shrinking was successfully completed (no errors reported), KDE Partition Manager reported that 35.03 GiB was used. The data on the partition shouldn't have changed, so how did this happen?
A (not particularly informed) guess of mine would be that Partition Manager was actually giving me an "estimate" of used space which improved after thge e shrinking operation; i.e., the actual data was always closer to 35 GiB. Or maybe a lot of data in the trash or temporary folders was removed. But that's still a big difference (about 20 percent), so I was wondering if anybody has seen this before or actually knows why this happens / should be expected.
Update: The laptop seems to be booting up and working fine after shrinking. This is no proof, of course, but there are no indications of data loss.
Update 2: The number of used inodes are the same between shrunk and unshrunk, and a checksum comparison of all files shows no differences, so I'm even more confident that there has been no data loss, which was the main practical concern. The question is still open but is more academic at this point.
KDE Partition Manager gets used space from a few sources, some of which might be estimates. But as you said 20% looks a bit too much.
I think another thing is that partition resize tools might change some disk structures such as number of extents, so you need less space to store metadata.
The difference occurs due to the
reserved-blocks-percentage
which is a parameter of the file-system. Thereserved-blocks-percentage
can be changed with thetune2fs
-command and has a default of 5% (seeman tune2fs
, look for the-m
-option).It looks as if your your file-system was adjusted to 2% before editing the partition and has been set back to 5% during resize.