2009-04-19 15:44:31 -06:00
|
|
|
git guidelines for gparted
|
2008-10-08 15:23:54 -06:00
|
|
|
==========================
|
2004-09-23 02:33:59 -06:00
|
|
|
|
2009-04-19 15:44:31 -06:00
|
|
|
Please do not commit directly to the git.gnome.org/gparted repository
|
|
|
|
unless you have been given the green light to commit freely to
|
|
|
|
gparted. When in doubt assume you haven't ;-).
|
2004-09-23 02:33:59 -06:00
|
|
|
|
2009-04-19 15:44:31 -06:00
|
|
|
If you are a translator feel free to mark strings for translation, fix
|
|
|
|
typos in the code, etc. I'd appreciate it if you would notify me of
|
|
|
|
anything you've done.
|
2004-09-23 02:33:59 -06:00
|
|
|
|
|
|
|
Please send patches for build & configure fixes too. I really appreciate
|
|
|
|
your help, I just want to review these fixes before applying.
|
|
|
|
|
2009-04-19 15:44:31 -06:00
|
|
|
!!WHENEVER YOU COMMIT, PLACE A COMMENT IN GIT!!
|
2004-09-30 15:01:19 -06:00
|
|
|
even when it's only one character. =)
|
|
|
|
|
2004-09-23 02:33:59 -06:00
|
|
|
Thanks,
|
2009-04-19 15:44:31 -06:00
|
|
|
Curtis
|
Enhance calculation of significant unallocated space (#499202)
Many file systems report differing percentages of unallocated space over
a range of sizes, as well differing figures using their own specific
tools or using statvfs() system call when mounted.
File systems reporting intrinsic unallocated space using their specific
tools are: jfs, lvm2 pv and ntfs. LVM2 PV has the largest amount of
unallocated space with its default Physical Extent size of 4 MiB. For a
100 MiB partition it has 4.0% unallocated space.
File systems reporting intrinsic unallocated space using the statvfs()
system call when mounted are: ext2/3/4, fat16/32, hfs, jfs, nilfs2,
ntfs, reiserfs, and xfs. Xfs has the worst identified unallocated space
of ~4.7% in a 100 MiB partition. Ext2/3 exhibit unusual behaviour by
reporting unallocated space of ~4.6% in a 100 MiB partition falling to a
constant percentage of ~1.8% for sizes of 1 GiB and above.
Update the calculation for used to estimate the maximum size of
intrinsic unallocated space. Limit is now 5% for partitions smaller
than 100 MiB, 2% for partitions larger than 1 GiB and linear scaling of
the percentage between. Will still get false unallocated space warnings
for mounted xfs file systems and lvm2 pvs smaller than 100 MiB.
Also add a short note and worked example calculation of unallocated
space to the HACKING file.
Bug #499202 - gparted does not see the difference if partition size
differs from filesystem size
2012-06-05 12:32:52 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
partition usage and unallocated space
|
|
|
|
=====================================
|
|
|
|
|
|
|
|
After addressing bug #499202 GParted now also displays unallocated space
|
Don't show intrinsic unallocated space (#499202)
Most file systems report intrinsic unallocated space using the statvfs()
system call when mounted, but not using their own tools. They are:
ext2/3/4, fat16/32, hfs, nilfs2, reiserfs and xfs. Showing either a
little or no unallocated space, depending on whether a file system is
mounted or not, could be confusing to the user.
When all file systems are created filling their partitions the unused
figure reported by statvfs() and their own tools are the same or very
close. Also the used plus unallocated figure from statvfs() agrees with
the used figure from their own tools.
For all file systems don't display intrinsic unallocated space (that
below the threshold of 2 to 5%), instead include it as used space. As
soon as the amount of unallocated space becomes significant display it
everywhere and also trigger the warning.
For display purposes always use the new Partition methods:
get_sectors_used(), get_sectors_unused(), and get_sectors_unallocated().
When calculating new usage figures during Paste and Resize/Move
operations directly access sectors_used, sectors_unused and
sectors_unallocated members.
Bug #499202 - gparted does not see the difference if partition size
differs from filesystem size
2012-06-15 06:16:30 -06:00
|
|
|
as well as used and unused space for recognised file systems. Many file
|
|
|
|
systems which actually fill their partition report a small amount of
|
|
|
|
intrinsic unallocated space when mounted, but not when unmounted. To
|
|
|
|
avoid confusing the user and unnecessarily alarming them don't show
|
|
|
|
unallocated space below a threshold, 2 to 5% depending on partition
|
|
|
|
size. It is just included in the used figure instead. (This is
|
|
|
|
effectively how GParted behaved before bug #499202 was addressed). When
|
|
|
|
above the threshold unallocated space is shown graphically, the numeric
|
|
|
|
figure is shown in the Information Dialog and a is warning displayed.
|
Enhance calculation of significant unallocated space (#499202)
Many file systems report differing percentages of unallocated space over
a range of sizes, as well differing figures using their own specific
tools or using statvfs() system call when mounted.
File systems reporting intrinsic unallocated space using their specific
tools are: jfs, lvm2 pv and ntfs. LVM2 PV has the largest amount of
unallocated space with its default Physical Extent size of 4 MiB. For a
100 MiB partition it has 4.0% unallocated space.
File systems reporting intrinsic unallocated space using the statvfs()
system call when mounted are: ext2/3/4, fat16/32, hfs, jfs, nilfs2,
ntfs, reiserfs, and xfs. Xfs has the worst identified unallocated space
of ~4.7% in a 100 MiB partition. Ext2/3 exhibit unusual behaviour by
reporting unallocated space of ~4.6% in a 100 MiB partition falling to a
constant percentage of ~1.8% for sizes of 1 GiB and above.
Update the calculation for used to estimate the maximum size of
intrinsic unallocated space. Limit is now 5% for partitions smaller
than 100 MiB, 2% for partitions larger than 1 GiB and linear scaling of
the percentage between. Will still get false unallocated space warnings
for mounted xfs file systems and lvm2 pvs smaller than 100 MiB.
Also add a short note and worked example calculation of unallocated
space to the HACKING file.
Bug #499202 - gparted does not see the difference if partition size
differs from filesystem size
2012-06-05 12:32:52 -06:00
|
|
|
See the code and commit messages for more details.
|
|
|
|
|
|
|
|
Worked example of partition and file system usage for a newly created
|
|
|
|
jfs file system in a 200 MiB partition reporting a small amount of
|
|
|
|
unallocated space:
|
|
|
|
|
|
|
|
# sfdisk -s /dev/sda9
|
|
|
|
204800
|
|
|
|
|
|
|
|
# echo dm | jfs_debugfs /dev/sda9 | egrep 'Block Size:|dn_mapsize:|dn_nfree:'
|
|
|
|
Aggregate Block Size: 4096
|
|
|
|
[1] dn_mapsize: 0x0000000c6cb [9] dn_agheigth: 0
|
|
|
|
[2] dn_nfree: 0x0000000c6a3 [10] dn_agwidth: 1
|
|
|
|
|
|
|
|
Partition size = 204800 (1K blocks) = 409600 (512 byte sectors)
|
|
|
|
FS size = 0x0c6cb (4K blocks)
|
|
|
|
= 50891 (4K blocks) = 407128 (512 byte sectors)
|
|
|
|
FS free = 0x0c6a3 (4K blocks)
|
|
|
|
= 50851 (4K blocks) = 406808 (512 byte sectors)
|
|
|
|
|
|
|
|
Calculation:
|
|
|
|
size = ptn_size = 409600 = 200.00 MiB
|
|
|
|
used = fs_size - fs_free = 407128 - 406808 = 320 = 160.00 KiB
|
|
|
|
unused = fs_free = 406808 = 198.64 MiB
|
|
|
|
unallocated = ptn_size - fs_size = 409600 - 407128 = 2472 = 1.21 MiB
|
|
|
|
|
Don't show intrinsic unallocated space (#499202)
Most file systems report intrinsic unallocated space using the statvfs()
system call when mounted, but not using their own tools. They are:
ext2/3/4, fat16/32, hfs, nilfs2, reiserfs and xfs. Showing either a
little or no unallocated space, depending on whether a file system is
mounted or not, could be confusing to the user.
When all file systems are created filling their partitions the unused
figure reported by statvfs() and their own tools are the same or very
close. Also the used plus unallocated figure from statvfs() agrees with
the used figure from their own tools.
For all file systems don't display intrinsic unallocated space (that
below the threshold of 2 to 5%), instead include it as used space. As
soon as the amount of unallocated space becomes significant display it
everywhere and also trigger the warning.
For display purposes always use the new Partition methods:
get_sectors_used(), get_sectors_unused(), and get_sectors_unallocated().
When calculating new usage figures during Paste and Resize/Move
operations directly access sectors_used, sectors_unused and
sectors_unallocated members.
Bug #499202 - gparted does not see the difference if partition size
differs from filesystem size
2012-06-15 06:16:30 -06:00
|
|
|
(Threshold %age for 200 MiB partition is approximately 4.675%)
|
|
|
|
threshold = ptn_size * pct = 19150 = 9.35 MiB
|
|
|
|
|
|
|
|
(Unallocated is below threshold so is included in used figure)
|
|
|
|
disp_used = used + unallocated = 320 + 2472 = 2792 = 1.36 MiB
|
|
|
|
disp_unused = unused = 406808 = 198.64 MiB
|
|
|
|
|
Enhance calculation of significant unallocated space (#499202)
Many file systems report differing percentages of unallocated space over
a range of sizes, as well differing figures using their own specific
tools or using statvfs() system call when mounted.
File systems reporting intrinsic unallocated space using their specific
tools are: jfs, lvm2 pv and ntfs. LVM2 PV has the largest amount of
unallocated space with its default Physical Extent size of 4 MiB. For a
100 MiB partition it has 4.0% unallocated space.
File systems reporting intrinsic unallocated space using the statvfs()
system call when mounted are: ext2/3/4, fat16/32, hfs, jfs, nilfs2,
ntfs, reiserfs, and xfs. Xfs has the worst identified unallocated space
of ~4.7% in a 100 MiB partition. Ext2/3 exhibit unusual behaviour by
reporting unallocated space of ~4.6% in a 100 MiB partition falling to a
constant percentage of ~1.8% for sizes of 1 GiB and above.
Update the calculation for used to estimate the maximum size of
intrinsic unallocated space. Limit is now 5% for partitions smaller
than 100 MiB, 2% for partitions larger than 1 GiB and linear scaling of
the percentage between. Will still get false unallocated space warnings
for mounted xfs file systems and lvm2 pvs smaller than 100 MiB.
Also add a short note and worked example calculation of unallocated
space to the HACKING file.
Bug #499202 - gparted does not see the difference if partition size
differs from filesystem size
2012-06-05 12:32:52 -06:00
|
|
|
Figures displayed in the Information dialog:
|
|
|
|
Size: 200.00 MiB
|
Don't show intrinsic unallocated space (#499202)
Most file systems report intrinsic unallocated space using the statvfs()
system call when mounted, but not using their own tools. They are:
ext2/3/4, fat16/32, hfs, nilfs2, reiserfs and xfs. Showing either a
little or no unallocated space, depending on whether a file system is
mounted or not, could be confusing to the user.
When all file systems are created filling their partitions the unused
figure reported by statvfs() and their own tools are the same or very
close. Also the used plus unallocated figure from statvfs() agrees with
the used figure from their own tools.
For all file systems don't display intrinsic unallocated space (that
below the threshold of 2 to 5%), instead include it as used space. As
soon as the amount of unallocated space becomes significant display it
everywhere and also trigger the warning.
For display purposes always use the new Partition methods:
get_sectors_used(), get_sectors_unused(), and get_sectors_unallocated().
When calculating new usage figures during Paste and Resize/Move
operations directly access sectors_used, sectors_unused and
sectors_unallocated members.
Bug #499202 - gparted does not see the difference if partition size
differs from filesystem size
2012-06-15 06:16:30 -06:00
|
|
|
Used: 1.36 MiB ( 1% )
|
|
|
|
Unused: 198.64 KiB ( 99% )
|