Bug 367473

Summary: Partition Manager seems to show swap partition is using more than its size
Product: [Applications] partitionmanager Reporter: Marco Parillo <marco_parillo>
Component: generalAssignee: Andrius Štikonas <andrius>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 2.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: http://imgur.com/a/8ay0g
Latest Commit: Version Fixed In:
Attachments: Screenshot of Partition Manager
Screenshot from GParted from a live USB
Screenshot of Partion Manager from Kubuntu Live USB

Description Marco Parillo 2016-08-18 00:33:47 UTC
free -h
              total        used        free      shared  buff/cache   available
Mem:           3.8G        1.4G        1.5G         50M        1.0G        2.2G
Swap:          8.4G          0B        8.4G

So it seems as if I am using none of my swap, Yet, it seems to show the same amount used as my root partition.

Reproducible: Always

Steps to Reproduce:
1. Start Partition Manager
2. View > Refresh Devices and File > Quit and re-starting it return the same results

Actual Results:  
See URL and Attachment.

Expected Results:  
Something like the results from free -h
              total        used        free      shared  buff/cache   available
Mem:           3.8G        1.4G        1.5G         50M        1.0G        2.2G
Swap:          8.4G          0B        8.4G

Actually Manjaro, but Arch was the closest in the pull-down.

Version 2.2.1
Using:
KDE Frameworks 5.24.0
Qt 5.7.0 (built against 5.7.0)
The xcb windowing system
Comment 1 Marco Parillo 2016-08-18 00:36:46 UTC
Created attachment 100651 [details]
Screenshot of Partition Manager
Comment 2 Marco Parillo 2016-08-18 00:45:46 UTC
*** Bug 367474 has been marked as a duplicate of this bug. ***
Comment 3 Marco Parillo 2016-08-18 00:53:51 UTC
Created attachment 100652 [details]
Screenshot from GParted from a live USB
Comment 4 Marco Parillo 2016-08-18 01:10:17 UTC
Created attachment 100653 [details]
Screenshot of Partion Manager from Kubuntu Live USB
Comment 5 Andrius Štikonas 2016-08-24 22:44:47 UTC
We don't really have code to read swap usage. I guess one way to fix this bug is to add that code, e.g. check /proc/swaps like GParted does. The other is to simply do not report swap usage (since it is not really relevant for resizing, you can't resize active swap partition and inactive does not have any used space), but I guess the first option is nicer.
Comment 6 Andrius Štikonas 2016-08-29 11:14:31 UTC
Git commit 5ab60c6dfadd5cf2e941d0105ff598092031f9b5 by Andrius Štikonas.
Committed on 29/08/2016 at 11:12.
Pushed by stikonas into branch 'master'.

Enable used space reporting for swap.

M  +5    -0    src/core/lvmdevice.cpp
M  +26   -5    src/fs/linuxswap.cpp
M  +5    -0    src/fs/linuxswap.h
M  +4    -0    src/plugins/libparted/libpartedbackend.cpp

http://commits.kde.org/kpmcore/5ab60c6dfadd5cf2e941d0105ff598092031f9b5