There is a lot of commonality and code repetition for resizing of file
systems which can only be resized while mounted. Resizing of btrfs, jfs
and xfs all follow the pattern: mkdir, mount, resize, umount and rmdir.
Copying an xfs file system also uses a similar pattern, but for the
source and destination xfs file systems simultaneously.
Add three helper functions to the FileSystem class which implement
common tasks, allowing mounted file system resizing to be implemented
more simply.
Also add a function to the Utils class which checks whether the kernel
supports a file system. It handles the case of non-loaded modules,
which currently leads to reporting the growing of jfs and xfs as
unsupported.
We used to just log libparted exceptions without handling them. This patch
changes the exception handler to display a modal dialog box and return the
chosen action to libparted.
The call to "blkid -c /dev/null" on Precise Pangolin Alpha 1 takes
exceedingly long. This occurs when the BIOS is incorrectly set to
indicate a floppy drive is present when none is physically installed.
Use cached blkid results instead.
Ubuntu launchpad 910379 - Gparted does not start and continues to
scan devices
https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/910379
Setting the status and controlling the timing of operation details
initialised with OperationDetail(desc, status, font) uses a conditional
branch depending on the uninitialised variable this->status.
valgrind:
==28957== Conditional jump or move depends on uninitialised value(s)
==28957== at 0x80E4287:
GParted::OperationDetail::set_status(GParted::OperationDetailStatus)
(OperationDetail.cc:77)
OperationalDetail.cc:
75 void OperationDetail::set_status( OperationDetailStatus status )
76 {
>> 77 if ( this ->status != STATUS_ERROR )
78 {
79 switch ( status )
80 {
Requires libparted 2.4 or higher, or blkid from utils-linux 2.20 or
higher for nilfs2 file system detection.
Requires nilfs-utils for nilfs2 file system support.
Closes Bug #642842 - nilfs is not detected
When GParted performed operations or combinations of operations,
such as:
a) copy to same or smaller size destination partition
b) move to same or smaller size due to alignment change
c) resize to smaller size
a redundant maximize file system operation would occur.
Normally these redundant maximize operations to grow the file
system to take up all the space in the partition were not harmful.
However in situations where libparted failed to inform the kernel
of partition changes, then the extra maximize operation would
grow the file system to be the original partition size. In cases
where the original partition was larger than the new partition
size, this caused problems because the file system would be
larger than the partition on reboot.
This enhancement avoids redundant file system maximize actions on
copy, move, and resize, and should help reduce problems described
in the following links:
WARNING! Problem Resizing File Systems with GParted
http://gparted-forum.surf4.info/viewtopic.php?id=13777
Bug #601574 - ERROR: Current NTFS volume size is bigger than the
device size!
Bug #604298 - Problems resizing file systems with
gparted-live-0.5.0-3
Closes Bug #663980 - Avoid redundant file system maximize actions
on copy, move, and resize
Btrfsctl and btrfs-show were depreciated in October 2011 and have been
superseeded by the newer btrfs multi-tool control command. Use btrfs as
first choice, falling back to btrfsctl and btrfs-show when not found.
There are still 2 issues with reading btrfs labels when falling back
on using btrfs-show command, rather than primary method of using the
blkid command:
1) Label is set no "none" when btrfs-show is reporting there is no
label, although it is impossible to distinguish from the case of the
label actually being set to "none".
2) The label has 2 trailing spaces appended as the regular expression
matches "Label: (btrfslabel )uuid:" rather than
"Label: (btrfslabel) uuid:" in the btrfs-show output.
Assume a label "none" means there is no label and fix the regular
expression.
Note that this enhancement changes GParted to first try the native
tools to determine the volume label for all file systems. If the
volume label is not found then the fall back method is to use blkid.
There is a small degradation in device refresh times as a result of
this change.
Closes Bug #662537 - Ext4 unicode labels not shown correctly