GParted requires libparted version 2.2 or higher to support devices
with sector sizes > 512 bytes.
This commit marks the end of a series of enhancements required to
provide support for sector sizes > 512 bytes.
Do not show unallocated space of exactly 1 MiB in size if:
a) The space is at the front of the drive.
This space is reserved for the partition table and the
Master Boot Record.
or
b) The space immediately precedes a logical partition.
This space is reserved for the Extended Boot Record.
Quote from GNOME Human Interface Guidelines 2.2.1 on Drop-down lists:
"Selecting an item from a drop-down list should not affect the
values of any other controls. It may sensitize, insensitize, hide
or show other controls, however."
Make align to MiB the default setting instead of align to cylinder.
Migrate logic for alignment to cylinder into its own method
snap_to_cylinder, and place common logic in snap_to_alignment.
Add alignment checks for situations where space is needed for Master
Boot Record or Extended Boot Record.
Adjust ranges on spin buttons according to required boot record space.
Copy fix for off by one sector (#596552) from
Dialog_Partition_New::Get_New_Partition to
Dialog_Base_Partition::Get_New_Partition
Enhance resize / move logic for checking locations of nearby logical
partitions to not depend on the partition ordering.
Note: This commit does not include limiting graphic movement according
to required boot record space.
Also add signal handler to alignment menu to update file system
minimum size.
This enhancement is to prepare for adding a third alignment
option to align to MiB.
This enhancement was added because the current libparted library,
version 2.2, does not appear to detect file systems for sector
sizes other than 512 bytes.
With the removal of the 512 byte constants, such as MEBIBYTE, it
was possible to rename the _FACTOR constants back to BYTE
constants. The _FACTOR constants, such as MEBI_FACTOR, were a
temporary measure to help in the transition to support devices
with sector sizes > 512 bytes.
The device sector size is needed in all calculations that convert
between sectors and bytes. The device sector_size is included in
the partition object because this object is used to contain
operation information in addition to actual partitions and
unallocated space. A second option was considered to pass the
device object to many methods, but this was considered a much
larger task that might not provide significant gains in
maintainability.
Previously this value was calculated to end on a cylinder
boundary. On today's larger hard drives, which simply emulate
Cylinders/Heads/Sectors, some disk space might remain after the
last cylinder. This space would always be less than a full
cylinder in size. Now this space will be visible to the user.
Improved logic in cleanup_cursor method to minimize the number of
string erase operations performed.
Previously when the NTFS copy finished, GParted would take an
exceptionally long time to clean up the output. This was due to
the huge number of small string erase operations performed on a
extremely large string.
A patch to alleviate the "failure to inform kernel of partition
changes problem" (bug #604298) has been included in parted-2.2.
Hence when parted-2.2 or higher is used, the work around code in
GParted is not required.
According to parted documentation, only "msdos" and "dvh" disk
types (or partition table types) support extended partitions.
All other disk types support primary partitions only.
This is not an ideal solution because devices with sector sizes
greater than 512 bytes are silently ignored from a graphical interface
perspective. Only if the user starts gparted from the command line
will the "ignoring device" message be seen.
In my opinion this short term solution of ignoring these devices is
still better than a gparted crash which might also result in data
loss.
A bug report requesting support for devices with sector sizes > 512
bytes has been created.
https://bugzilla.gnome.org/show_bug.cgi?id=607165
Thanks go to Jan Claeys for the initial small patch.
Bug #604298 involves a problem that can occur when GParted uses
libparted to manipulate a partition table, but the
ped_disk_commit_to_os() function fails to inform the Linux kernel of
these changes to the partition table. This problem is intermittent in
nature and is difficult to reliably reproduce.
This change is an attempt at a work around. If the first call to
ped_disk_commit_to_os() fails, then we sleep for 1 second to allow the
system to settle before invoking the function call again. My testing
has shown that this greatly improves the chances of successfully
informing the kernel of partition changes.
Thanks go to François Dupoux and Steven Shiau for their suggestions
and help to resolve this problem.
This problem was introduced with GParted 0.4.7 when the "-a"
option was removed from the dosfsck command. The dosfsck command
is used to read the number of used sectors. Instead we will now
use the "-n" option which does not write any changes to the file
system, and allows non-interactive operation.
Remove commented code and boolean use-C-lang parameter for
Utils::num_to_str() method because this bug was fixed in
gcc-4.0.3. The GNU gcc compiler versions 4 and up are now
commonly in use. Also due to previous partial commenting and
removal of the code, the code was non-functional
Thanks goes to Jan Claeys for pointing out this clean up
opportunity.
When calling commit_to_os() with newer Linux kernels,
parted-1.9.0, and at least one partition mounted on the device,
the following error message is displayed:
The kernel was unable to re-read the partition table on
/dev/sda (Device or resource busy). This means Linux won't
know anything about the modifications you made until you
reboot. You should reboot your computer before doing
anything with /dev/sda.
If this message is not cleared then it will remain in the
libparted_message array and could potentially be displayed along
with an error message for a subsequent scanned disk device.
When libparted reports a problem with the partition table, capture
this message and attach it to the "unallocated" partition that spans
the entire disk.
Examples of these types of problems encountered are:
/dev/sda: unrecognised disk label
Can't have overlapping partitions.
The ability to paste into an existing partition was disabled in
v0.4.0. This ability has been re-enabled along with a warning
dialog that indicates the data in the existing partition will be
lost if the copy and paste operation is applied.
Restore copyright entries by original author to those of his last
known repository commit titled "released gparted-0.3.4 on
LarryT's request." on Feb 25, 2007.
Add my own copyright entries for files in which I changed source
code. Files in which I only made spelling changes do not have my
copyright entry added.
Auto detection of Linux software RAID devices was lost in GParted
0.3.8. This was because device scanning by the libparted device
call ped_device_probe_all() was replaced with custom code within
GParted to scan /proc/partitions for devices.
The reason the libparted call was replaced was due to a long
scanning problem with ped_device_probe_all(), a non-existent
physical floppy device, and a BIOS setting indicating a floppy
drive existed. See bug #351753:
https://bugzilla.gnome.org/show_bug.cgi?id=351753
When used with parted-2.0, GParted would display a warning
message indicating "kernel unable to re-read partition table" on
every device scan for each device with at least one partition
mounted. Device scans occur when GParted starts up, immediately
after a series of actions are applied, and upon manually invoked
device refreshes. This, I believe, is excessive notification to
the user and would be annoying.
Improve the feedback to the user when creating or pasting a
partition on a device with no partition table found.
Prior to this enhancement if a user tried to create or paste a
partition onto a device with no partition table found, GParted
would present the user with a Create Partition Table dialog.
When creating a new partition this could cause confusion for
users who were trying to format the disk. The user could
mistakenly believe the choice of an MS-DOS file system was being
presented.
Similarly on a paste operation it could be confusing to be
presented with a dialog to create a partition table without any
explanation of why a partition table was suddenly required in the
midst of the paste operation.
Neither the new partition creation, nor the partition paste
actions were performed after the Create Partition Table dialog
was displayed.
Removed the "-a" flag from the dosfsck command that is used to
determine the number of used sectors in FAT16 and FAT32 file systems.
Related to GParted bug #569921
In order to find a match between the device paths in mount files and
partitions as found by libparted, the mount device must be a real path
and not a symbolic link.
Closes GParted bug #582687
Excerpt from parted-1.9.0 release notes follows:
In libparted, the linux-swap "filesystem" types are now called
"linux-swap(v0)" and "linux-swap(v1)" rather than "linux-swap(old)"
and "linux-swap(new)" as in parted 1.8, or "linux-swap" as in older
versions; "old" and "new" generally make poor names, and v1 is the
only format supported by current Linux kernels. Aliases for all
previous names are available.
Previously the read_mountpoints_from_file() method only expected
a space between arguments in files such as /etc/fstab. Valid
delimiters are now space and tab.
Related to GParted bug #582687
To further minimize the chance of accidentally creating a new partition
table, the following steps have been taken:
1) Rename non-standard Create button to stock Apply button.
2) Remove extra warning about erasing entire disk device.
3) Update GParted Manual accordingly.
Closes GParted bug #576374
Perform direct update of Number of Hidden Sectors in NTFS boot record.
This change removes the need for /usr/bin/xxd and /bin/dd.
Related to GParted bug #574389
It appears that different dmraid versions handle specifying a
single dmraid device differently.
dmraid-1.0.0.rc14 uses a partial name only,
such as "isw" or "isw_cjbdddajhi".
dmriad-1.0.0.rc15 uses a full name only,
such as "isw_cjbdddajhi_Vol0".
To maintain compatibility with the broadest range of dmraid versions,
the ability to specify a single dmraid device is being removed.
Some distros appear to display /dev/dm-# device names with
libparted. Since this fails a pattern match with the dmraid
device name, check with udev to see if a pattern match is
possible with the name returned from udevinfo or udevadm info.
For example:
/dev/mapper/isw_cjbdddajhi_Vol0 is the device name
/dev/dm-0 is a symbolic link pointing to the above device name
Normally, the blkid command will detect the UUID for a file system.
In cases where blkid fails to detect the UUID and the vol_id command
is available, then try using the vol_id command.
Newer systems might not have udevsettle. It has been replaced by
"udevadm settle".
Thanks to Lorenzo Cogotti aka Micia for this knowledge, and for a
proposed solution.
Move crypt-luks detection prior to libparted file system detection.
If libparted file system detection is performed first, then encrypted
file systems such as ext3 will be incorrectly detected by libparted as
plain 'ext3' when in fact these file systems are encrypted.
The GIT version of libparted returns types of linux-swap(new) and linux-swap(old), previously only linux-swap was returned.
svn path=/trunk/; revision=1024
If translated language is relatively long, then split the "Resize/Move" toolbar button text into two lines, and do not display the "Undo" button.
svn path=/trunk/; revision=971
- Changed title Features to File System Support.
- Renamed button Refresh to Rescan Support.
- Created expander for legend and added narrative.
- Removed columns detect and read.
svn path=/trunk/; revision=966
The move away from libparted device recognition broke recognition of /dev/mapper/* devices. Problem now fixed.
Thanks to Colin Watson for the patch.
svn path=/trunk/; revision=933
Thanks to Sebastion Kraft for designing the icons.
Thanks to Michael Monreal for the small patch to make use of themed app icon from hicolor.
svn path=/trunk/; revision=909
- Removed gparted-disable-automount.fdi handling.
- Renamed gparted binary to gpartedbin to permit a calling script to be named gparted.
- Added new calling script gparted.in to permit using hal-lock to acuiqre device locks to prevent automounting while executing gpartedbin.
- Renamed gparted.desktop.in to gparted.desktop.in.in to permit parsing installdir.
svn path=/trunk/; revision=826
* include/Device.h,
include/Dialog_Base_Partition.h,
src/Dialog_Base_Partition.cc: replaced 'long' with 'Sector' to
prefent overflows with really large devices.
* src/GParted_Core.cc: fixed 'Could not detect file system.' error
with fat and hfs filesystem when performing a move to the left.
(thanks to 'the Bogerds' for borrowing me an usbstick ;) )
* include/Makefile.am,
include/Operation.h,
include/Win_GParted.h,
src/GParted_Core.cc,
src/Makefile.am,
src/Win_GParted.cc,
include/OperationCheck.h (new),
src/OperationCheck.cc (new): added 'check' operation. The
functionality was already there, but it was not possible yet to
activate it from the gui.
* src/Dialog_Progress.cc: gtk+-2.10 seems to return the last valid
iterator if get_iter is executed with an invalid treepath. This is
different from gtk+-2.8 and gave some problems in the
operationdetails. I added a check to make it work in both
situations.
* src/GParted_Core: Replaced std::abs with llabs (see #357691)
* src/hfs.cc,
src/xfs.cc: added support for reading of volumelabel
* src/reiserfs.cc: added Fixme
* added support for reading volumelabels. Atm we only read ext2/3, but
the infrastructure for adding the other filesystems is in place.
It's simply a matter of finding the right commands and parsing the
output. (see #338528 for more info)
* src/GParted_Core.cc: reverted back to parted probing after i heard
patches to fix some issues with it are underway. (skipping of floppy
and cdrom)
* src/reiser4.cc,
src/reiserfs.cc: added --quiet to the fschecks to prevent the
detailswindow from dying under the load. I should find a solution
for that anyway.
* src/Dialog_Progress.cc: make sure progressfraction stays between 0.0
and 1.0
* include/GParted_Core.h,
src/GParted_Core.cc: implemented rollback in case of failed move of
overlapping filesystems. Together with the readonly test moving
should be quite save now :)
* include/Dialog_Progress.h,
src/Dialog_Progress.cc: Show number of warnings after all operations
are completed. Also urge people to save their details in case of
error.
* src/ext2.cc
src/ext3.cc
src/fat16.cc
src/fat32.cc
src/jfs.cc
src/ntfs.cc
src/reiser4.cc
src/reiserfs.cc
src/xfs.cc: be a bit more verbose on errior in set_used_sectors()
* include/GParted_Core.h,
src/GParted_Core.cc: declared char * buf global, so it can be
initialized in copy_blocks(). This is a lot more efficient than
initializing it on every copy_block()
* include/Partition.h,
src/Partition.cc: added test_overlap()
* include/GParted_Core.h,
src/GParted_Core.cc: perform a readonly testrun before the actual
move if destination overlaps source.
* include/GParted_Core.h,
src/GParted_Core.cc: update ntfsbootsector after first sector has
changed. This is necessary to let windows boot correctly afterwards.
* src/ntfs.cc: added FIXME
* src/GParted_Core.cc: fixed an issue with copying to unallocated
space. It works fine now, but this entire copy operation breaks
consistency a bit. I should take a look at that when i have some
more time.
* include/GParted_Core.h,
src/GParted_Core.cc: tried to fix a couple of errors with moving to
the right with overlap (thanks Larry for hunting ;) )
Although everything seems to work well i'm still not sure if
everything is 100% ok.
I guess everything could use some more testing, which is exactly
what i plan to do this weekend :)
* happy 24th birthday Johannes! :^)
* include/GParted_Core.h,
src/GParted_Core.cc: restructured resize_move() to be more robust.
This will hopefully tackle a couple of issues which came up during
the public testing.
* src/GParted_Core.cc: use Glib::timer instead of std::time stuff for
the probing, this is more accurate since the resolution is much
higher (microseconds instead of seconds)
* include/Utils.h,
src/Utils.cc: added format_time()
* include/OperationDetail.h,
src/OperationDetail.cc: keep track of elapsed time between
STATUS_EXECUTE and STATUS_[ERROR|SUCCES]
* include/Dialog_Progress.h,
src/Dialog_Progress.cc: show elapsed time in the details per (sub)
process
* src/GParted_Core.cc: use Utils::format_time()
* include/GParted_Core.h,
src/GParted_Core.cc: fixed some issues with combi move+shrink on
fat* and hfs* filesystems.
Also call wait_for_node() from commit() if 'node' was provided.
* include/GParted_Core.h,
src/GParted_Core.cc: created set_progress_info() (i actually planned
on adding some time remaining stuff, but xfiles is waiting ;) )
* include/GParted_Core.h,
src/GParted_Core.cc: did some work on disabling of automounting of
removable drives. The current method is not entirely to my liking
but it seems to work.
* implemented some stuff to find a good blocksize to use for
copy/move. Actually i'm not really happy with it, because probing
seems suboptimal, but it's better than nothing. As soon as i have
some time i should do some research on the subject to find a better
solution.
* include/Win_GParted.h,
src/Win_GParted.cc: construct operations in the activate*()
functions instead of in Add_Operation(). This approach allows for
more customization of operations.
* src/Dialog_Partition_Copy.cc,
src/GParted_Core.cc,
src/Win_GParted.cc: fixed some issues when manipulating a just
copied partition. (see also #349513)
* improved errorhandling a bit. At the initialscan we store
errors/warnings now in a list per partition and show the in the
partitioninfo dialog.
While executing an operation we collect all libparted exceptions in
a list and attach this list to the operationdetails when everything
is done.
* include/FileSystem.h,
include/GParted_Core.h,
src/FileSystem.cc,
src/GParted_Core.cc,
src/ext2.cc,
src/ext3.cc,
src/ntfs.cc,
src/reiserfs.cc: removed cylindersize buffering during resize from
the filesystems. It is not needed anymore now we calculate the new
position before calling this.
Also added some extra progressfeedback in the core
* src/Win_GParted.cc: added FIXME:
* include/GParted_Core.h,
src/GParted_Core.cc,
src/fat32.cc: decoupled libparted partition and filesystemresizing.
This resulted in a much more consistent core. This also affected
several other aspects of resizing/moving in a positive way.
* include/GParted_Core.h,
src/GParted_Core.cc,
src/Win_GParted.cc: perform some checks before adding a new
operation to the list.
* src/Partition.cc: made get_length() a bit safer
* include/Dialog_Progress.h,
include/Operation.h,
src/Dialog_Progress.cc,
src/GParted_Core.cc: show warning in progressfeedback if a certain
action is n/a. Of course we only allow these actions if the results
are non-lethal.
* src/Win_GParted.cc,
include/GParted_Core.h,
src/GParted_Core.cc: implemented snap to cylinder algorithm.
Although the algorithm is very simple, it seems to work perfectly.
However, some additional testing is required.
* include/GParted_Core.h,
src/GParted_Core.cc,
src/ext2.cc: added movesupport, atm in experimental state and needs
lots of cleaning. only enabled for ext2, but should work for all
filesystems.
* src/DialogFeatures.cc: added alternating rowcolours (see #342682)
* include/Dialog_Partition_Copy.h,
include/GParted_Core.h,
include/OperationCopy.h,
include/Win_GParted.h,
src/Dialog_Partition_Copy.cc,
src/GParted_Core.cc,
src/OperationCopy.cc,
src/Win_GParted.cc: made blocksize settable by the user.
* Use ped_device_read and ped_device_write instead of 'dd' to copy
filesystems.
Modified progressdetails to provide more detailed feedback about a
process.
Basicly these were all changes to the infrastructure to make the
incorporation of the 'move-code' a bit easier.
( sorry, not in the mood to list all affected files ;)
* src/Dialog_Partition_Copy.cc: only allow growing of copy if there is
grow support for the filesystem.
* src/reiser4.cc: added support for copying reiser4 filesystems
* src/DialogManageFlags.cc: disabled resizing of this dialog
* include/DialogFeatures.h,
include/Makefile.am,
include/Win_GParted.h,
src/DialogFeatures.cc,
src/Makefile.am,
src/Win_GParted.cc: renamed 'Filesystems' to 'Features' in the
featuredialog to better reflect the actual functionality
* include/Dialog_Filesystems.h,
src/Dialog_Filesystems.cc: removed
* include/GParted_Core.h,
src/GParted_Core.cc: improved disabling of automounting. It's still
somewhat crude, but right now it's ok for some semi-public testing.
I'll do some cleanups tomorrow morning.
* src/Dialog_Progress.cc: added FIXME
* include/GParted_Core.h,
src/GParted_Core.cc: an initial solution for the automount problem.
I still need to add something to prevent just created partitions from
getting mounted. (see #324220 for more info)
* src/GParted_Core.cc: trivial cleanups
* src/OperationResizeMove.cc: fixed a glitch in apply_to_visual()
* src/ext2.cc,
src/ext3.cc: accept returnvalues 0, 1 and 2 instead of 0 and 1
* include/Partition.h,
src/Partition.cc: added set_used() and operator!=
* src/Dialog_Partition_Copy.cc,
src/GParted_Core.cc,
src/OperationCopy.cc,
src/Win_GParted.cc: it's now possible to copy from partition to
partition. (before this it was only possible to copy to unallocated
space)
* include/TreeView_Detail.h,
src/TreeView_Detail.cc: made icon behaviour more intelligent
* src/GParted_Core.cc: small improvement in open_device_and_disk()
* include/DrawingAreaVisualDisk.h,
src/DrawingAreaVisualDisk.cc: fixed a few issues with
selecting/activating partitions.
* include/Utils.h,
src/Utils.cc,
src/Dialog_Disklabel.cc,
src/Dialog_Partition_Info.cc (mk_label): improved support for
aligment.
* src/Win_GParted.cc: fixed a small alignmentissue in the devices
submenu.
* include/DrawingAreaVisualDisk.h,
src/DrawingAreaVisualDisk.cc: another change to highlighting of
selected partition.
* include/Partition.h,
src/Win_GParted.cc: deal properly with just formatted partitions
* src/Operation.cc: added FIXME