From ca810bfa4937684556b3eb05be9b0478f605f26f Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Mon, 14 Sep 2026 17:48:06 +0530 Subject: [PATCH 1/9] Remove IEC_UNITS flag from storage info Because storage devices typically advertise their capacities in "base 1000" rather than "base 1024". A disk advertised as having 2 TB capacity previously showed as 1.8 TiB in the system view. With this diff it now shows as 2 TB which is what a user would expect to see. --- src/Views/SystemView/SystemStorageView.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Views/SystemView/SystemStorageView.vala b/src/Views/SystemView/SystemStorageView.vala index 035f53bdf..72afa842c 100644 --- a/src/Views/SystemView/SystemStorageView.vala +++ b/src/Views/SystemView/SystemStorageView.vala @@ -96,8 +96,8 @@ public class Monitor.SystemStorageView : Gtk.Box { size = H3 }; - string size_string = format_size ((uint64) drive.size, IEC_UNITS); - string used_string = format_size ((uint64) (drive.size - drive.free), IEC_UNITS); + string size_string = format_size ((uint64) drive.size); + string used_string = format_size ((uint64) (drive.size - drive.free)); string drive_block_name_and_size_string = "%s 𐄁 %s / %s".printf (drive.device, used_string, size_string); From 73dcd67778ca17b8c486161d1219daeb6ce1b6a0 Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Mon, 14 Sep 2026 17:58:50 +0530 Subject: [PATCH 2/9] Remove storage usage info It usually shows larger usage because free space (which is used to calculate usage) is counted for only mounted volumes and won't work for multiple partitions with only some mounted. --- src/Views/SystemView/SystemStorageView.vala | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/Views/SystemView/SystemStorageView.vala b/src/Views/SystemView/SystemStorageView.vala index 72afa842c..64b7f578a 100644 --- a/src/Views/SystemView/SystemStorageView.vala +++ b/src/Views/SystemView/SystemStorageView.vala @@ -97,13 +97,8 @@ public class Monitor.SystemStorageView : Gtk.Box { }; string size_string = format_size ((uint64) drive.size); - string used_string = format_size ((uint64) (drive.size - drive.free)); - string drive_block_name_and_size_string = "%s 𐄁 %s / %s".printf (drive.device, used_string, size_string); - - if (drive.free == 0) { - drive_block_name_and_size_string = "%s 𐄁 %s".printf (drive.device, size_string); - } + string drive_block_name_and_size_string = "%s 𐄁 %s".printf (drive.device, size_string); var drive_block_name_and_size_label = new Gtk.Label (drive_block_name_and_size_string) { halign = START, @@ -116,14 +111,6 @@ public class Monitor.SystemStorageView : Gtk.Box { }; drive_not_mounted_label.add_css_class (Granite.CssClass.DIM); - var usagebar = new Gtk.LevelBar () { - max_value = 100.0, - min_value = 0.0, - margin_bottom = 6 - }; - usagebar.add_css_class (Granite.STYLE_CLASS_FLAT); - usagebar.set_value (100.0 * (drive.size - drive.free) / drive.size); - var drive_box = new Gtk.Box (VERTICAL, 0) { margin_top = 6, margin_end = 12, @@ -134,8 +121,6 @@ public class Monitor.SystemStorageView : Gtk.Box { drive_box.append (drive_block_name_and_size_label); if (drive.free == 0) { drive_box.append (drive_not_mounted_label); - } else { - drive_box.append (usagebar); } add_css_class (Granite.CssClass.CARD); From 2e70a1755d3b8c9f1ffe91407f0df9f6e9a73cff Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Mon, 14 Sep 2026 18:07:23 +0530 Subject: [PATCH 3/9] Remove "not mounted" label Not really useful info after removal of free/used info? Also, edge case of it potentially showing "not mounted" if free space really is zero. --- src/Views/SystemView/SystemStorageView.vala | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Views/SystemView/SystemStorageView.vala b/src/Views/SystemView/SystemStorageView.vala index 64b7f578a..70a3063c3 100644 --- a/src/Views/SystemView/SystemStorageView.vala +++ b/src/Views/SystemView/SystemStorageView.vala @@ -106,11 +106,6 @@ public class Monitor.SystemStorageView : Gtk.Box { }; drive_block_name_and_size_label.add_css_class (Granite.CssClass.DIM); - var drive_not_mounted_label = new Gtk.Label (_("Not mounted")) { - halign = START - }; - drive_not_mounted_label.add_css_class (Granite.CssClass.DIM); - var drive_box = new Gtk.Box (VERTICAL, 0) { margin_top = 6, margin_end = 12, @@ -119,9 +114,6 @@ public class Monitor.SystemStorageView : Gtk.Box { }; drive_box.append (drive_name_label); drive_box.append (drive_block_name_and_size_label); - if (drive.free == 0) { - drive_box.append (drive_not_mounted_label); - } add_css_class (Granite.CssClass.CARD); append (drive_box); From 5dc553639637bca8281a125e16a1ac26e284c5bc Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Sun, 20 Sep 2026 08:45:53 +0530 Subject: [PATCH 4/9] Revert "Remove "not mounted" label" This reverts commit 2e70a1755d3b8c9f1ffe91407f0df9f6e9a73cff. --- src/Views/SystemView/SystemStorageView.vala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Views/SystemView/SystemStorageView.vala b/src/Views/SystemView/SystemStorageView.vala index 6cbfda9af..ee532755d 100644 --- a/src/Views/SystemView/SystemStorageView.vala +++ b/src/Views/SystemView/SystemStorageView.vala @@ -106,6 +106,11 @@ public class Monitor.SystemStorageView : Gtk.Box { }; drive_block_name_and_size_label.add_css_class (Granite.CssClass.DIM); + var drive_not_mounted_label = new Gtk.Label (_("Not mounted")) { + halign = START + }; + drive_not_mounted_label.add_css_class (Granite.CssClass.DIM); + var drive_box = new Gtk.Box (VERTICAL, 0) { margin_top = 6, margin_end = 12, @@ -114,6 +119,9 @@ public class Monitor.SystemStorageView : Gtk.Box { }; drive_box.append (drive_name_label); drive_box.append (drive_block_name_and_size_label); + if (drive.free == 0) { + drive_box.append (drive_not_mounted_label); + } add_css_class (Granite.CssClass.CARD); append (drive_box); From 4a2fcd5cd84755a77bb7bcdc57f33fbaa8b2cd94 Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Sun, 20 Sep 2026 08:46:03 +0530 Subject: [PATCH 5/9] Revert "Remove storage usage info" This reverts commit 73dcd67778ca17b8c486161d1219daeb6ce1b6a0. --- src/Views/SystemView/SystemStorageView.vala | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Views/SystemView/SystemStorageView.vala b/src/Views/SystemView/SystemStorageView.vala index ee532755d..17568d596 100644 --- a/src/Views/SystemView/SystemStorageView.vala +++ b/src/Views/SystemView/SystemStorageView.vala @@ -97,8 +97,13 @@ public class Monitor.SystemStorageView : Gtk.Box { }; string size_string = format_size ((uint64) drive.size); + string used_string = format_size ((uint64) (drive.size - drive.free)); - string drive_block_name_and_size_string = "%s 𐄁 %s".printf (drive.device, size_string); + string drive_block_name_and_size_string = "%s 𐄁 %s / %s".printf (drive.device, used_string, size_string); + + if (drive.free == 0) { + drive_block_name_and_size_string = "%s 𐄁 %s".printf (drive.device, size_string); + } var drive_block_name_and_size_label = new Gtk.Label (drive_block_name_and_size_string) { halign = START, @@ -111,6 +116,14 @@ public class Monitor.SystemStorageView : Gtk.Box { }; drive_not_mounted_label.add_css_class (Granite.CssClass.DIM); + var usagebar = new Gtk.LevelBar () { + max_value = 100.0, + min_value = 0.0, + margin_bottom = 6 + }; + usagebar.add_css_class (Granite.STYLE_CLASS_FLAT); + usagebar.set_value (100.0 * (drive.size - drive.free) / drive.size); + var drive_box = new Gtk.Box (VERTICAL, 0) { margin_top = 6, margin_end = 12, @@ -121,6 +134,8 @@ public class Monitor.SystemStorageView : Gtk.Box { drive_box.append (drive_block_name_and_size_label); if (drive.free == 0) { drive_box.append (drive_not_mounted_label); + } else { + drive_box.append (usagebar); } add_css_class (Granite.CssClass.CARD); From ec5d71e6d89d7a4be4a828dfd35867f1572e4546 Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Sun, 20 Sep 2026 09:44:46 +0530 Subject: [PATCH 6/9] Include only mounted used space for storage info --- src/Resources/Storage/Disk.vala | 3 +++ src/Resources/Storage/Storage.vala | 1 + src/Resources/Storage/Volume.vala | 2 ++ src/Views/SystemView/SystemStorageView.vala | 4 ++-- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Resources/Storage/Disk.vala b/src/Resources/Storage/Disk.vala index 7103bb7e8..06c527cba 100644 --- a/src/Resources/Storage/Disk.vala +++ b/src/Resources/Storage/Disk.vala @@ -7,6 +7,7 @@ public class Monitor.Disk : GLib.Object { public string model; public uint64 size; + public uint64 size_mounted; public uint64 free; public string revision; public string id; @@ -22,11 +23,13 @@ public class Monitor.Disk : GLib.Object { revision = drive.revision; id = drive.id; free = 0; + size_mounted = 0; } public void add_volume (Volume vol) { volumes.add (vol); free = free + vol.free; + size_mounted = size_mounted + vol.size_mounted; } public Gee.ArrayList get_volumes () { diff --git a/src/Resources/Storage/Storage.vala b/src/Resources/Storage/Storage.vala index 3829cf63f..646045c9f 100644 --- a/src/Resources/Storage/Storage.vala +++ b/src/Resources/Storage/Storage.vala @@ -110,6 +110,7 @@ Posix.statvfs buf; Posix.statvfs_exec (block_fs.mount_points[0], out buf); current_volume.free = (uint64) buf.f_bfree * (uint64) buf.f_bsize; + current_volume.size_mounted = (uint64) buf.f_blocks * (uint64) buf.f_bsize; // } else { // current_volume.mount_point = ""; diff --git a/src/Resources/Storage/Volume.vala b/src/Resources/Storage/Volume.vala index 02e6874f8..ac09c2447 100644 --- a/src/Resources/Storage/Volume.vala +++ b/src/Resources/Storage/Volume.vala @@ -10,6 +10,7 @@ public class Monitor.Volume : Object { public string uuid; public string mount_point; public uint64 size; + public uint64 size_mounted; public uint64 free; public uint64 offset; @@ -25,6 +26,7 @@ public class Monitor.Volume : Object { type = block.id_type; size = block.size; uuid = block.id_uuid; + size_mounted = 0; } public void add_slave (string? new_slave) { diff --git a/src/Views/SystemView/SystemStorageView.vala b/src/Views/SystemView/SystemStorageView.vala index 17568d596..3063a70fc 100644 --- a/src/Views/SystemView/SystemStorageView.vala +++ b/src/Views/SystemView/SystemStorageView.vala @@ -97,7 +97,7 @@ public class Monitor.SystemStorageView : Gtk.Box { }; string size_string = format_size ((uint64) drive.size); - string used_string = format_size ((uint64) (drive.size - drive.free)); + string used_string = format_size ((uint64) (drive.size_mounted - drive.free)); string drive_block_name_and_size_string = "%s 𐄁 %s / %s".printf (drive.device, used_string, size_string); @@ -122,7 +122,7 @@ public class Monitor.SystemStorageView : Gtk.Box { margin_bottom = 6 }; usagebar.add_css_class (Granite.STYLE_CLASS_FLAT); - usagebar.set_value (100.0 * (drive.size - drive.free) / drive.size); + usagebar.set_value (100.0 * (drive.size_mounted - drive.free) / drive.size_mounted); var drive_box = new Gtk.Box (VERTICAL, 0) { margin_top = 6, From 28d624d8689fc46d87030758915febd48f94a3db Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Mon, 21 Sep 2026 07:28:11 +0530 Subject: [PATCH 7/9] Update storage info to address review feedback --- src/Views/SystemView/SystemStorageView.vala | 26 +++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Views/SystemView/SystemStorageView.vala b/src/Views/SystemView/SystemStorageView.vala index 3063a70fc..704ae60dd 100644 --- a/src/Views/SystemView/SystemStorageView.vala +++ b/src/Views/SystemView/SystemStorageView.vala @@ -96,22 +96,24 @@ public class Monitor.SystemStorageView : Gtk.Box { size = H3 }; - string size_string = format_size ((uint64) drive.size); - string used_string = format_size ((uint64) (drive.size_mounted - drive.free)); + var size_string = format_size ((uint64) drive.size); + var used_string = format_size ((uint64) (drive.size_mounted - drive.free)); + var available_string = format_size ((uint64) drive.size_mounted); - string drive_block_name_and_size_string = "%s 𐄁 %s / %s".printf (drive.device, used_string, size_string); + drive_name_label.secondary_text = "%s 𐄁 %s".printf (drive.device, size_string); - if (drive.free == 0) { - drive_block_name_and_size_string = "%s 𐄁 %s".printf (drive.device, size_string); - } - - var drive_block_name_and_size_label = new Gtk.Label (drive_block_name_and_size_string) { + ///TRANSLATORS: Only the words "Used" and "available" need to be translated, + ///the positional strings placeholders are already translated by the GLib.format_string () function. + var drive_usage_string = _("Used %s of %s available").printf (used_string, available_string); + var drive_usage_label = new Gtk.Label (drive_usage_string) { halign = START, + margin_top = 6, margin_bottom = 6 }; - drive_block_name_and_size_label.add_css_class (Granite.CssClass.DIM); + drive_usage_label.add_css_class (Granite.CssClass.DIM); var drive_not_mounted_label = new Gtk.Label (_("Not mounted")) { + margin_top = 6, halign = START }; drive_not_mounted_label.add_css_class (Granite.CssClass.DIM); @@ -122,7 +124,6 @@ public class Monitor.SystemStorageView : Gtk.Box { margin_bottom = 6 }; usagebar.add_css_class (Granite.STYLE_CLASS_FLAT); - usagebar.set_value (100.0 * (drive.size_mounted - drive.free) / drive.size_mounted); var drive_box = new Gtk.Box (VERTICAL, 0) { margin_top = 6, @@ -131,10 +132,11 @@ public class Monitor.SystemStorageView : Gtk.Box { margin_start = 12 }; drive_box.append (drive_name_label); - drive_box.append (drive_block_name_and_size_label); - if (drive.free == 0) { + if (drive.size_mounted == 0) { drive_box.append (drive_not_mounted_label); } else { + drive_box.append (drive_usage_label); + usagebar.set_value (100.0 * (drive.size_mounted - drive.free) / drive.size_mounted); drive_box.append (usagebar); } From 1503ab0e1929d3d5780e4d301ddb0a408718479f Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Wed, 23 Sep 2026 09:51:45 +0530 Subject: [PATCH 8/9] Change "available" to "mounted" for usage info --- src/Views/SystemView/SystemStorageView.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Views/SystemView/SystemStorageView.vala b/src/Views/SystemView/SystemStorageView.vala index 704ae60dd..ccbe64b57 100644 --- a/src/Views/SystemView/SystemStorageView.vala +++ b/src/Views/SystemView/SystemStorageView.vala @@ -104,7 +104,7 @@ public class Monitor.SystemStorageView : Gtk.Box { ///TRANSLATORS: Only the words "Used" and "available" need to be translated, ///the positional strings placeholders are already translated by the GLib.format_string () function. - var drive_usage_string = _("Used %s of %s available").printf (used_string, available_string); + var drive_usage_string = _("Used %s of %s mounted").printf (used_string, available_string); var drive_usage_label = new Gtk.Label (drive_usage_string) { halign = START, margin_top = 6, From d8539c97a5240c6de90d96255997aa6618245ef3 Mon Sep 17 00:00:00 2001 From: Vishal Rao Date: Wed, 23 Sep 2026 12:04:05 +0530 Subject: [PATCH 9/9] Fix storage usage anomaly for logical volumes Accumulate mounted size but avoid counting the same volume multiple times. --- src/Resources/Storage/Storage.vala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Resources/Storage/Storage.vala b/src/Resources/Storage/Storage.vala index 646045c9f..49b641ced 100644 --- a/src/Resources/Storage/Storage.vala +++ b/src/Resources/Storage/Storage.vala @@ -141,6 +141,9 @@ foreach (var slave_name in slaves_names) { current_volume.add_slave (slave_name); } + if (logical_volumes.keys.contains (current_volume.device)) { + continue; + } logical_volumes.set (current_volume.device, current_volume); // if all slave volumes are coming from a single drive, @@ -151,6 +154,7 @@ var affiliated_disk = disks.get ("/dev/" + affiliated_disk_device); if (affiliated_disk != null) { affiliated_disk.free = affiliated_disk.free + current_volume.free; + affiliated_disk.size_mounted += current_volume.size_mounted; } } }