GParted already has basic support only to recognize Btrfs volumes; if
configured, use our newer methods to handle them.
Also, put in place interface controls for all supported generic actions.
Change string initialization to use direct assignment instead of
a class method in the GParted_Core class initialization.
Thanks go to Jan Claeys for pointing out this potential problem
and providing the following link:
https://bugzilla.gnome.org/show_bug.cgi?id=627724#c7
This link contains a comment by Matthias Clasen that says:
"In a class init function, don't do anything that causes
other threads to initialize classed types."
This patch along with a few preceding patches address the
following bug reports:
Closes bug #622217 - gparted live 0.6.0-1 incompatibility with
AMD RAID (SB750 southbridge)
Closes Ubuntu launchpad bug 600729 - Gparted not usable on
fakeraid arrays
https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/600729
Prevent overwriting meta data (Extended Boot Rectors) for logical
partitions by temporarily increasing the size of the logical
partition to encompass all of the space involved in the move
operation. The libparted library will move the EBR as needed to
permit this to happen. After the move the logical partition is
set to the proper size.
This fixes bug #623630 - Move logical partition to right yields
invalid partition table on /dev/sda - wrong signature 0
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.
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.
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.
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.
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.
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.
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
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
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
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 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
- 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 ;) )