[gparted] Allow unused space in a partition to equal its size
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Allow unused space in a partition to equal its size
- Date: Fri, 3 Feb 2012 19:04:44 +0000 (UTC)
commit 0acb6237255435013c65777d81609df9bac24b79
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date: Mon Nov 28 12:43:04 2011 +0000
Allow unused space in a partition to equal its size
Newly created LVM2 PVs, before being added to a Volume Group, report
free space equal to the partition size. Allow free space to equal
partition size.
# parted /dev/sda10 unit B print
Error: /dev/sda10: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/sda10: 2147483648B
Sector size (logical/physical): 512B/512B
Partition Table: unknown
# lvm pvcreate /dev/sda10
Writing physical volume data to disk "/dev/sda10"
Physical volume "/dev/sda10" successfully created
# lvm pvs --units b -o pv_free /dev/sda10
PFree
2147483648B
src/Partition.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/Partition.cc b/src/Partition.cc
index 882da8a..952b9b6 100644
--- a/src/Partition.cc
+++ b/src/Partition.cc
@@ -81,7 +81,7 @@ void Partition::Set( const Glib::ustring & device_path,
void Partition::Set_Unused( Sector sectors_unused )
{
- if ( sectors_unused < get_sector_length() )
+ if ( sectors_unused <= get_sector_length() )
{
this ->sectors_unused = sectors_unused ;
this ->sectors_used = ( sectors_unused == -1 ) ? -1 : get_sector_length() - sectors_unused ;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]