bug#18919: Parted false warning.

2014-11-01 Thread dE
Hi! I was using the parted utility to create GPT partitions as a workaround to fdisk which forces partitions to start at 1MiB boundaries. I set the first partition to begin at sector 40 but I got this -- Warning: The resulting partition is not properly aligned for best performance. Which's

bug#18920: Parted always chooses the logical sector size.

2014-11-01 Thread dE
Can someone please add an option to set the sector size to custom or/and the physical sector size?

bug#18920: Parted always chooses the logical sector size.

2014-11-01 Thread dE
On 11/02/14 02:46, Phillip Susi wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 11/01/2014 07:10 AM, dE wrote: Can someone please add an option to set the sector size to custom or/and the physical sector size? Why? Not using the correct sector size doesn't make sense and

bug#18920: Parted always chooses the logical sector size.

2014-11-04 Thread dE
On 11/04/14 03:24, Brian C. Lane wrote: On Sun, Nov 02, 2014 at 02:37:09PM +0530, dE wrote: On 11/02/14 02:46, Phillip Susi wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 11/01/2014 07:10 AM, dE wrote: Can someone please add an option to set the sector size to custom or/and the

bug#18920: Parted always chooses the logical sector size.

2014-11-04 Thread dE
On 11/04/14 22:10, Brian C. Lane wrote: On Tue, Nov 04, 2014 at 08:26:24PM +0530, dE wrote: On 11/04/14 03:24, Brian C. Lane wrote: Assuming you are talking about linux -- parted uses the logical sector size returned by the kernel, which gets it from the drive. We don't set to 512 arbitr

Re: Hi, good news VIÂGRRA

2005-08-28 Thread De Fitzgibbon
 Good day, Welcome to ical shopThe One Of The Leading onIine pharmaceuts Sr 60 your phaBy-Mail SAVE Ove% onrmacy with US Pharmccy-hop VALlUS Vlother medicatM ClALlAGRA and many ions ___ Bug-parted mailing list Bug-parted@gnu.org http://lists.gnu.org/ma

Fix compilation with -Wl,--as-needed

2006-05-14 Thread Thomas de Grenier de Latour
Parted doesn't compile with LDFLAGS="-Wl,--as-needed", because libparted.so is not linked to libdl, and thus has unresolved symbols. mkdir .libs gcc -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DLOCALEDIR=\"/usr/local/share/locale\" -DLOCALEDIR=\"/usr/local/share/locale\" -W -Wall -Wno-unused -Wno-switch

Bug in parted 1.6.15 Fedora core 3

2005-05-04 Thread S.A. de Heer
can try to provide it. Greetings, Sjoerd de Heer S&R Solutions Diezestraat 24 7523 SN Enschede http://www.sr-solutions.nl Disclaimer: De informatie verzonden met dit e-mailbericht is uitsluitend bestemd voor de geadresseerde. Gebruik van deze informatie door anderen dan de geadressee

Bug detected

2007-09-09 Thread Salvatore De Paolis
Hi all ped_partition_get_name msdos A bug has been detected in GNU Parted. Refer to the web site of parted http://www.gnu.org/software/parted/parted.html for more informations of what could be useful for bug submitting! Please email a bug report to bug-parted@gnu.org containing at least the ver

Multiple issues with commit_to_os (Linux)

2009-08-27 Thread Hans de Goede
* changing mounted partitions anyway... - */ -if (!rets[i - 1] && errnums[i - 1] == EBUSY) -continue; - -/* add the (possibly modified or new) partition */ -

PATCH: do not unnecessarily open partition device nodes (and make udev hate us)

2009-08-27 Thread Hans de Goede
Hi, After patching parted with my do not use BLKPG patch, I started to get EBUSY errors on commit_to_os. Note this is not caused by the do not use BLKPG patch, this was already happening, but instead of parted silently ignoring the errors (and the kernel not knowing about the changes, which is ba

PATCH [libparted]: avoid unnecessary open() / close() on commit()

2009-08-27 Thread Hans de Goede
Hi all, Currently when calling commit() on a ped_disk, the following happens: open /dev/sda write partition table close /dev/sda open /dev/sda ioctl (BLKRRPART) close /dev/sda This is rather inefficient, and causes 2 udev change events to be fired for /dev/sda (+ the change events from the BLKRR

[parted] ped_partition_busy should not call the libparted exception handler

2009-10-06 Thread Hans de Goede
Modify libparted/arch/linux.c _partition_get_part_dev() to not call _device_stat() but instead use stat directly, as _device_stat() calls the libparted exception handler and we don't want this here, the only caller of _partition_get_part_dev() is _partition_is_mounted(), which in turn only gets cal

Re: [parted] ped_partition_busy should not call the libparted exception handler

2009-10-06 Thread Hans de Goede
Hi, On 10/06/2009 11:54 AM, Jim Meyering wrote: Hans de Goede wrote: Modify libparted/arch/linux.c _partition_get_part_dev() to not call _device_stat() but instead use stat directly, as _device_stat() calls the libparted exception handler and we don't want this here, the only call

[PATCH parted] Handle swap flag in msdos type labels

2009-10-10 Thread Hans de Goede
From: David Cantrell Original patch by David Cantrell , I (Hans de Goede ) made the following changes: -msdos_partition_is_flag_available() should return 1 for swap flag -Only change the partition type to 82 when setting the swap flag on dos labels, not when resetting it --- libparted/labels

Re: [PATCH parted] Handle swap flag in msdos type labels

2009-10-10 Thread Hans de Goede
Hi, On 10/10/2009 03:41 PM, Jim Meyering wrote: Hans de Goede wrote: From: David Cantrell Original patch by David Cantrell, I (Hans de Goede) made the following changes: -msdos_partition_is_flag_available() should return 1 for swap flag -Only change the partition type to 82 when setting the

Re: [PATCH parted] Handle swap flag in msdos type labels

2009-10-13 Thread Hans de Goede
Hi, On 10/13/2009 12:07 PM, Jim Meyering wrote: Hans de Goede wrote: From: David Cantrell Original patch by David Cantrell, I (Hans de Goede) made the following changes: -msdos_partition_is_flag_available() should return 1 for swap flag -Only change the partition type to 82 when setting the

[PATCH parted 5/5] parted: When retrying mkpart keep the device constraint

2009-10-28 Thread Hans de Goede
When retrying mkpart when the part addition to the disk with the constraint derived from the user specified start and end fails, keep the device constraint otherwise the result of the retry may end up being not properly aligned. --- parted/parted.c |6 +++--- 1 files changed, 3 insertions(+),

[PATCH parted 1/5] libparted: add ped_device_get_xxx_aligment() functions

2009-10-28 Thread Hans de Goede
Add ped_device_get_minimal_aligment() and ped_device_get_optimal_aligment() functions to libparted. --- include/parted/device.h |8 include/parted/natmath.h |1 + libparted/device.c | 18 ++ 3 files changed, 27 insertions(+), 0 deletions(-) diff --git a/i

[PATCH parted 2/5] linux.c: save blkid topology in arch_specific data for later use

2009-10-28 Thread Hans de Goede
This is a preparation patch for adding get_minimal_alignment and get_optimal_alignment functions to linux's _PedDeviceArchOps. --- libparted/arch/linux.c | 75 ++-- libparted/arch/linux.h |8 + 2 files changed, 36 insertions(+), 47 deletions(-)

[PATCH parted 3/5] linux.c: add get_minimal_alignment() and get_optimal_alignment() functions

2009-10-28 Thread Hans de Goede
--- libparted/arch/linux.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index d261a04..32e8af9 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -2521,6 +2521,34 @@ linux

[PATCH parted 4/5] Take alignment offset into account in ped_device_get_constraint()

2009-10-28 Thread Hans de Goede
ped_device_get_constraint() was trying to do aligment based on physical sector / logical sector differences, but this does not take alignment offset into account. So use ped_device_get_minimal_aligment() instead. Note this may seem a regression for arch's which don't implement ped_device_get_minim

Re: [PATCH parted 1/5] libparted: add ped_device_get_xxx_aligment() functions

2009-10-28 Thread Hans de Goede
efore submitting them. Regards, Hans p.s. I also plan to backport this set of 5 to libparted-1.9 and add them to the Fedora packages for F-13. On 10/28/2009 10:20 PM, Hans de Goede wrote: Add ped_device_get_minimal_aligment() and ped_device_get_optimal_aligment() functions to libparted. --- in

Re: [PATCH parted 1/5] libparted: add ped_device_get_xxx_aligment() functions

2009-10-29 Thread Hans de Goede
Hi, On 10/28/2009 10:26 PM, Jim Meyering wrote: Hans de Goede wrote: Note, these patches may apply to master with a couple of lines offset left and right, as I also have some patches in my local tree to update parted to keep working with upcoming lvm2 (libdevmapper) changes, I'm still wa

Re: [PATCH parted 1/5] libparted: add ped_device_get_xxx_aligment() functions

2009-10-29 Thread Hans de Goede
Hi, Me again I forgot one part of my reply: On 10/28/2009 10:26 PM, Jim Meyering wrote: @@ -31,6 +31,7 @@ typedef struct _PedAlignment PedAlignment; #include #include +#include Might as well indent consistently. This is your mail client playing tricks, all 3 includes are not ind

[PATCH parted 1/7] libparted: add ped_device_get_xxx_aligment() functions

2009-10-29 Thread Hans de Goede
Add ped_device_get_minimal_aligment() and ped_device_get_optimal_aligment() functions to libparted. --- include/parted/device.h |8 include/parted/natmath.h |1 + libparted/device.c | 43 +++ 3 files changed, 52 insertions(+), 0 del

[PATCH parted 3/7] linux.c: add get_minimal_alignment() and get_optimal_alignment() functions

2009-10-29 Thread Hans de Goede
--- libparted/arch/linux.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 176e7da..b6070d7 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -2521,6 +2521,34 @@ linux

[PATCH parted 2/7] linux.c: save blkid topology in arch_specific data for later use

2009-10-29 Thread Hans de Goede
This is a preparation patch for adding get_minimal_alignment and get_optimal_alignment functions to linux's _PedDeviceArchOps. --- libparted/arch/linux.c | 75 ++-- libparted/arch/linux.h |8 + 2 files changed, 36 insertions(+), 47 deletions(-)

[PATCH parted 5/7] libparted: add ped_device_get_xxx_aligned_constraint() functions

2009-10-29 Thread Hans de Goede
Add ped_device_get_minimal_aligned_constraint() and ped_device_get_optimal_aligned_constraint() functions to libparted. These functions can be used to get a device constraint taking alignment into account. --- include/parted/device.h |5 +++ libparted/device.c | 69

[PATCH parted 7/7] Implement get_partition_alignment DiskOp for all labels which need it

2009-10-29 Thread Hans de Goede
Implement get_partition_alignment DiskOp for all labels which require an alignment with a grain_size != 1. --- libparted/labels/dasd.c | 12 libparted/labels/mac.c | 11 ++- libparted/labels/pc98.c | 12 +++- libparted/labels/rdb.c | 12 +++- libparte

[PATCH parted 4/7] ped_device_get_constraint: return constraint without alignment

2009-10-29 Thread Hans de Goede
In libparted-1.9 ped_device_get_constraint() would always return a constraint without any start / end aligning (grain_size == 1). Now that we are starting to support disks with a physical sector size other then 512, the old ped_device_get_constraint() code may actually start returning constrains wi

[PATCH parted 6/7] libparted: add ped_disk_get_partition_alignment() function

2009-10-29 Thread Hans de Goede
This functions get the aligment needed for partition boundaries on this disk. The returned alignment describes the aligment for the start sector of the partition, for all disklabel types which require alignment, except Sun disklabels, the end sector must be aligned too. To get the end sector aligme

[PATCH parted 4/7] ped_device_get_constraint: return constraint without alignment

2009-10-29 Thread Hans de Goede
In libparted-1.9 ped_device_get_constraint() would always return a constraint without any start / end aligning (grain_size == 1). Now that we are starting to support disks with a physical sector size other then 512, the old ped_device_get_constraint() code may actually start returning constrains wi

[PATCH parted 2/7] linux.c: save blkid topology in arch_specific data for later use

2009-10-29 Thread Hans de Goede
This is a preparation patch for adding get_minimum_alignment and get_optimum_alignment functions to linux's _PedDeviceArchOps. --- libparted/arch/linux.c | 75 ++-- libparted/arch/linux.h |8 + 2 files changed, 36 insertions(+), 47 deletions(-)

[PATCH parted 1/7] libparted: add ped_device_get_xxx_alignment() functions

2009-10-29 Thread Hans de Goede
Add ped_device_get_minimum_alignment() and ped_device_get_optimum_alignment() functions to libparted. Note this is a resent of my previous patchset with a number of typos corrected: aligment -> alignment minimal_alignment -> minimum_aligment optimal_alignment -> optimum_aligment Sorry for the noi

[PATCH parted 5/7] libparted: add ped_device_get_xxx_aligned_constraint() functions

2009-10-29 Thread Hans de Goede
Add ped_device_get_minimal_aligned_constraint() and ped_device_get_optimal_aligned_constraint() functions to libparted. These functions can be used to get a device constraint taking alignment into account. --- include/parted/device.h |5 +++ libparted/device.c | 69

[PATCH parted 7/7] Implement get_partition_alignment DiskOp for all labels which need it

2009-10-29 Thread Hans de Goede
Implement get_partition_alignment DiskOp for all labels which require an alignment with a grain_size != 1. --- libparted/labels/dasd.c | 12 libparted/labels/mac.c | 11 ++- libparted/labels/pc98.c | 12 +++- libparted/labels/rdb.c | 12 +++- libparte

[PATCH parted 6/7] libparted: add ped_disk_get_partition_alignment() function

2009-10-29 Thread Hans de Goede
This functions get the alignment needed for partition boundaries on this disk. The returned alignment describes the alignment for the start sector of the partition, for all disklabel types which require alignment, except Sun disklabels, the end sector must be aligned too. To get the end sector alig

[PATCH parted 3/7] linux.c: add get_minimum_alignment() and get_optimum_alignment() functions

2009-10-29 Thread Hans de Goede
--- libparted/arch/linux.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 176e7da..3069c59 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -2521,6 +2521,34 @@ linux

Re: [PATCH parted 1/7] libparted: add ped_device_get_xxx_alignment() functions

2009-10-30 Thread Hans de Goede
Hi, On 10/29/2009 05:38 PM, Jim Meyering wrote: Hans de Goede wrote: Add ped_device_get_minimum_alignment() and ped_device_get_optimum_alignment() functions to libparted. Note this is a resent of my previous patchset with a number of typos corrected: aligment -> alignment minimal_alignm

[PATCH parted 1/2] linux: fix crash (un-initialized pointer) when operating on regular files

2009-10-30 Thread Hans de Goede
* libparted/arch/linux.c (linux_new): When compiled with blkid support initialize arch_specific->probe and arch_specific->topology to NULL, as get_blkid_topology(), which sets them, does not get called for regular files. * libparted/arch/linux.c (get_blkid_topology): No need to set arch_specific->t

[PATCH parted 2/2] linux: Don't return bogus device alignment info

2009-10-30 Thread Hans de Goede
* libparted/arch/linux.c (linux_get_xxx_alignment): blkid's topology io size may be 0 when blkid could not get the minimum / optimum iosize. Return NULL in this case instead of returning a bogus (grain_size == 0) alignment. --- libparted/arch/linux.c |4 ++-- 1 files changed, 2 insertions(+),

[PATCH parted 1/7] libparted: add ped_device_get_xxx_alignment() functions

2009-10-30 Thread Hans de Goede
Add ped_device_get_minimum_alignment() and ped_device_get_optimum_alignment() functions to libparted. Note this is a resent of my previous patchset with a number of typos corrected: aligment -> alignment minimal_alignment -> minimum_aligment optimal_alignment -> optimum_aligment Sorry for the noi

[PATCH parted 5/7] libparted: add ped_device_get_xxx_aligned_constraint() functions

2009-10-30 Thread Hans de Goede
Add ped_device_get_minimal_aligned_constraint() and ped_device_get_optimal_aligned_constraint() functions to libparted. These functions can be used to get a device constraint taking alignment into account. --- include/parted/device.h |5 +++ libparted/device.c | 69

[PATCH parted 2/7] linux: save blkid topology in arch_specific data for later use

2009-10-30 Thread Hans de Goede
This is a preparation patch for adding get_minimum_alignment and get_optimum_alignment functions to linux's _PedDeviceArchOps. * libparted/arch/linux.h (struct_LinuxSpecific) [probe, topology]: Add members. * libparted/arch/linux.c (linux_new): initialize arch_specific->probe and arch_specific->top

[PATCH parted 3/7] linux: add get_xxx_alignment() functions

2009-10-30 Thread Hans de Goede
* libparted/arch/linux.c (get_minimum_alignment): New function. (get_optimum_alignment): New function. --- libparted/arch/linux.c | 34 +- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index a03c80d

[PATCH parted 4/7] ped_device_get_constraint: return constraint without alignment

2009-10-30 Thread Hans de Goede
In libparted-1.9 ped_device_get_constraint() would always return a constraint without any start / end aligning (grain_size == 1). Now that we are starting to support disks with a physical sector size other then 512, the old ped_device_get_constraint() code may actually start returning constrains wi

[PATCH parted 6/7] libparted: add ped_disk_get_partition_alignment() function

2009-10-30 Thread Hans de Goede
This functions get the alignment needed for partition boundaries on this disk. The returned alignment describes the alignment for the start sector of the partition, for all disklabel types which require alignment, except Sun disklabels, the end sector must be aligned too. To get the end sector alig

[PATCH parted 7/7] Implement get_partition_alignment DiskOp for all labels which need it

2009-10-30 Thread Hans de Goede
Implement get_partition_alignment DiskOp for all labels which require an alignment with a grain_size != 1. --- libparted/labels/dasd.c | 12 libparted/labels/mac.c | 11 ++- libparted/labels/pc98.c | 12 +++- libparted/labels/rdb.c | 12 +++- libparte

[PATCH parted 3/3] linux: Use cached major minor instead of statting the device again

2009-11-02 Thread Hans de Goede
--- libparted/arch/linux.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 3ca938a..a87f7e2 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -2333,22 +2333,20 @@ err: static int _dm_remove_

[PATCH parted 2/3] linux: Use devicemapper task name instead of device node name

2009-11-02 Thread Hans de Goede
Use devicemapper task name instead of device node name as basename for devicemapper disk partitions. This is needed for upcoming lvm changes where the /dev/mapper/foobar files are becoming symlinks, so we will end up opening /dev/dm-#, and naming our partitions dm-#p1, dm-#p2, instead of foobarp1,

[PATCH parted 1/3] linux: Use major / minor to specify device mapper device in dm_task

2009-11-02 Thread Hans de Goede
Use major / minor to specify device mapper device instead of dm_task_set_name. This is needed for upcoming lvm changes where the /dev/mapper/foobar files are becoming symlinks, so we will end up opening /dev/dm-#, and dm-# is not a valid dm_task name. This is only needed in this one place, as in t

[PATCH parted 1/5] dasd: Cleanup anchor handling

2009-11-03 Thread Hans de Goede
The current dasd label code keeps an fdasd anchor struct in the DasdDiskSpecific struct, and fills this during dasd_read. However this anchor does not get updated with any future mods, until dasd_write, at which points it gets completely re-initialized. Since the contents of the anchor saved durin

[PATCH parted 3/5] dasd: cache real_sector_size in linux_probe

2009-11-03 Thread Hans de Goede
dasd_alloc was doing an ioctl to get the real sector size for the dasd device (we are faking 512 bytes sectors), but when called directly from ped_disk_new_fresh(), the device is not open causing this to fail. This patch fixes things by caching the real_sector_size in the linux arch_specific data

[PATCH parted 4/5] dasd: Set disk_specific->format_type in dasd_alloc

2009-11-03 Thread Hans de Goede
Set disk_specific->format_type in dasd_alloc, so that the disk returned by ped_disk_new_fresh is a valid dasd disk. * libparted/labels/dasd.c (dasd_alloc): Set disk_specific->format_type. --- libparted/labels/dasd.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/libpart

[PATCH parted 5/5] dasd: fix disk duplication

2009-11-03 Thread Hans de Goede
Fix dasd_duplicate and add a dasd_partition_duplicate function. * libparted/labels/dasd.c(dasd_partition_duplicate): New function. (dasd_duplicate): Don't set the disk_specific pointer to NULL! (dasd_duplicate): Copy DasdDiskSpecific from old disk to new disk. --- libparted/labels/dasd.c | 24 ++

[PATCH parted 2/5] dasd: Remove (bogus) part_info pointer from DasdPartitionData

2009-11-03 Thread Hans de Goede
The part_info pointer in DasdPartitionData was only used to pass fdasd partition_info_t pointers from dasd_write to the dasd_write dasd_update_type utility function. Since these pointers are not valid outside the lifetime of dasd_write, they should not be stored in the longer lived DasdPartitionDat

Re: [PATCH parted 1/5] dasd: Cleanup anchor handling

2009-11-04 Thread Hans de Goede
Hi, On 11/04/2009 10:32 AM, Jim Meyering wrote: Hans de Goede wrote: The current dasd label code keeps an fdasd anchor struct in the DasdDiskSpecific struct, and fills this during dasd_read. However this anchor does not get updated with any future mods, until dasd_write, at which points it

[PATCH parted] dasd: Fix ped_disk_new_fresh() to not read old data from disk (rh533808)

2009-11-09 Thread Hans de Goede
dasd_write(), was reading the volume label from the disk (trough fdasd_check_volume()) and later writing it back again, this is fine for existing dasd labels, but when creating a fresh label, this would also cause the old volume label to be re-used, and if the old label was corrupt, it would cause

Re: [PATCH parted] dasd: Fix ped_disk_new_fresh() to not read old data from disk (rh533808)

2009-11-10 Thread Hans de Goede
Hi, On 11/09/2009 06:28 PM, Jim Meyering wrote: Hans de Goede wrote: dasd_write(), was reading the volume label from the disk (trough fdasd_check_volume()) and later writing it back again, this is fine for existing dasd labels, but when creating a fresh label, this would also cause the old

[PATCH parted] Update NEWS file for my recent patches

2009-11-10 Thread Hans de Goede
--- NEWS | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index c8c5724..6564ab8 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,18 @@ GNU parted NEWS-*- outline -*- * Noteworthy changes in release ?.? (-??-?

[PATCH parted 2/3] msdos, sun: Implement disk flag operations

2009-12-09 Thread Hans de Goede
* libparted/labels/dos.c(DosDiskData): New struct. * libparted/labels/dos.c(msdos_alloc, msdos_duplicate, msdos_free): Handle per disk DosDiskData. * libparted/labels/dos.c(msdos_disk_set_flag, msdos_disk_get_flag, msdos_disk_is_flag_available): New functions. * libparted/labels/sun.c(sun_disk_set_

[PATCH parted 3/3] dasd: fix memleak in dasd_free

2009-12-09 Thread Hans de Goede
* libparted/labels/dasd.c(dasd_free): free disk_specific data. --- libparted/labels/dasd.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c index dd492f2..57612a3 100644 --- a/libparted/labels/dasd.c +++ b/libparted/label

[PATCH parted 1/3] libparted: add disk flag functions and PED_DISK_CYLINDER_ALIGNMENT flag

2009-12-09 Thread Hans de Goede
Sometimes we want to be able to set flags at the disk level rather then at the parition level, to influence how new partitions will be created for example. This patch adds functions to do this (modelled after the partition flag functions), and adds a PED_DISK_CYLINDER_ALIGNMENT flag. This flag (wh

[PATCH parted 2/5] parted: add --align commandline option to specify mkpart alignment

2009-12-10 Thread Hans de Goede
The new --align commandline option can have the following values: none: Use the minimum alignment allowed by the disk type cyl: Align partitions to cylinders (the default) min: Use minimum alignment as given by the disk topology information opt: Use optimum alignment as given by the disk top

[PATCH parted 1/5] NEWS: Add new disk flag functions to NEWS

2009-12-10 Thread Hans de Goede
* NEWS: Add new disk flag functions. --- NEWS | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index 9a0ac2c..c0b29cc 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,18 @@ GNU parted NEWS-*- outline -*- ** New features

[PATCH parted 4/5] NEWS: update with libblkid and kernel requirements for alignment funcs

2009-12-10 Thread Hans de Goede
* NEWS: Change the note for the align-check command to also reference libblkid, add a note to the libparted alignment functions NEWS entry about libblkid and kernel requirements. --- NEWS |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index bf1044d..5b01e9c

[PATCH parted 3/5] NEWS: Add new --align option to NEWS

2009-12-10 Thread Hans de Goede
* NEWS: Add new --align option. --- NEWS | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index c0b29cc..bf1044d 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,22 @@ GNU parted NEWS-*- outline -*- ** New features

[PATCH parted 5/5] parted.8: add --align option to manpage

2009-12-10 Thread Hans de Goede
--- doc/C/parted.8 | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/doc/C/parted.8 b/doc/C/parted.8 index 9909ba8..31c33ec 100644 --- a/doc/C/parted.8 +++ b/doc/C/parted.8 @@ -30,6 +30,26 @@ never prompts for user intervention .TP .B -v, --version dis

[PATCH parted 1/6] parted.texi: Document --align option

2009-12-10 Thread Hans de Goede
doc/parted.texi: Document --align option. --- doc/parted.texi |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/doc/parted.texi b/doc/parted.texi index a1d794d..a4090df 100644 --- a/doc/parted.texi +++ b/doc/parted.texi @@ -496,6 +496,11 @@ display a help message @itemx

[PATCH parted 2/6] gpt: Add support for appletv partitions

2009-12-10 Thread Hans de Goede
From: Joel Granados Moreno * include/parted/disk.h(PedPartitionFlag): Add PED_PARTITION_APPLE_TV_RECOVERY. * libparted/disk.c(ped_partition_flag_get_name): Handle PED_PARTITION_APPLE_TV_RECOVERY. * libparted/labels/gpt.c(PARTITION_APPLE_TV_RECOVERY_GUID): New define. * libparted/labels/gpt.c(GPTP

[PATCH parted 5/6] libparted: make pop/push update mode propagate sanity check errors

2009-12-10 Thread Hans de Goede
Sanity check errors indicate something is really really wrong, still sometimes they happen, when they happen it helps a lot in debugging them when the libparted caller immediately errors out at the first moment, rather then slugging along until things crash somewere. * libparted/disk.c(_disk_push_u

[PATCH parted 4/6] Makefiles: Don't install s390 dasd internal headers in /usr/include

2009-12-10 Thread Hans de Goede
From: Joel Granados Moreno include/parted/Makefile.am: Don't install s390 dasd internal headers in /usr/include. --- include/parted/Makefile.am |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/parted/Makefile.am b/include/parted/Makefile.am index a1ba960..022

[PATCH parted 3/6] libparted: Add missing update mode pop in duplicate error path

2009-12-10 Thread Hans de Goede
From: Joel Granados Moreno * libparted/disk.c(ped_disk_duplicate): Add missing update mode pop call in error path. --- libparted/disk.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/libparted/disk.c b/libparted/disk.c index 7660ee9..d14fe41 100644 --- a/libparted/di

[PATCH parted 6/6] libparted: Missing pop update mode in ped_disk_delete_all error path

2009-12-10 Thread Hans de Goede
* libparted/disk.c(ped_disk_delete_all): Add missing update mode pop call in error path. --- libparted/disk.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/libparted/disk.c b/libparted/disk.c index 476ece8..5ca5b74 100644 --- a/libparted/disk.c +++ b/libparted/disk.c

[PATCH parted 1/3] NEWS: Add new --align option to NEWS

2009-12-10 Thread Hans de Goede
* NEWS: Add new --align option. --- NEWS | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index 500e060..cd67678 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,21 @@ GNU parted NEWS-*- outline -*- ** New features

[PATCH parted 2/3] parted.8: add --align option to manpage

2009-12-10 Thread Hans de Goede
* doc/C/parted.8: add --align option to manpage. --- doc/C/parted.8 | 20 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/doc/C/parted.8 b/doc/C/parted.8 index 9909ba8..2a8992e 100644 --- a/doc/C/parted.8 +++ b/doc/C/parted.8 @@ -30,6 +30,26 @@ never prompts

[PATCH parted 3/3] parted.texi: Document --align option

2009-12-10 Thread Hans de Goede
doc/parted.texi: Document --align option. --- doc/parted.texi |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/doc/parted.texi b/doc/parted.texi index a1d794d..5704520 100644 --- a/doc/parted.texi +++ b/doc/parted.texi @@ -496,6 +496,11 @@ display a help message @itemx

[PATCH parted] linux: Treat loopback devices as files

2009-12-11 Thread Hans de Goede
We cannot do partition related ioctl's on loopback devices, so treat them as files. * libparted/arch/linux.c(LOOP_MAJOR): New define. * libparted/arch/linux.c(_device_probe_type): Treat loopback devices as files. --- libparted/arch/linux.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions

[PATCH parted 1/2] libparted: push/pop update mode around ped_disk_set_flag

2009-12-17 Thread Hans de Goede
Disk flags can change how the metadata gets allocated, so push/pop update mode around ops->disk_set_flag, so that the metadata gets re-allocated. * libparted/disk.c (ped_disk_set_flag): push/pop update mode. --- libparted/disk.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(

[PATCH parted 2/2] dos: Honor cylinder alignment disk flag when allocating metadata

2009-12-17 Thread Hans de Goede
* libparted/labels/dos.c (add_startend_metadata): Honor cylinder alignment flag. --- libparted/labels/dos.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c index ea8fc0b..581506e 100644 --- a/libparted/labels/dos.c +++ b/

[PATCH parted 1/2] ui: Do not truncate flag names when printing

2009-12-18 Thread Hans de Goede
The partition_print_flags() function was truncating the flag names, but these are translated strings, and thus can contain multibyte characters. Truncating multibyte chars in a non multibyte aware way is not good and was causing issues when printing tables in Russian: http://bugzilla.redhat.com/sho

[PATCH parted 2/2] linux: Fix use after free in devicemapper code

2009-12-18 Thread Hans de Goede
* libparted/arch/linux.c (_dm_add_partition): Fix use of dm_task information after freeing it. --- libparted/arch/linux.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 9d15bf2..36a698d 100644 --- a/libparted/arch

Re: [PATCH parted 2/2] linux: Fix use after free in devicemapper code

2009-12-18 Thread Hans de Goede
Hi, On 12/18/2009 01:26 PM, Jim Meyering wrote: Hans de Goede wrote: * libparted/arch/linux.c (_dm_add_partition): Fix use of dm_task information after freeing it. --- libparted/arch/linux.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libparted/arch/linux.c

Re: [PATCH parted 2/2] linux: Fix use after free in devicemapper code

2009-12-18 Thread Hans de Goede
Hi, On 12/18/2009 01:59 PM, Jim Meyering wrote: Hans de Goede wrote: Is this adjustment ok with you, since I'm leaving your name on it? I don't want to leave the assignments to NULL, since they're effectively dead code and I don't want to provoke warnings from the likes o

[PATCH parted 2/3] linux: Remove unused blkpg.h header file

2010-01-11 Thread Hans de Goede
* libparted/arch/linux.c: Don't include blkpg.h. * libparted/arch/blkpg.h: Deleted. --- libparted/arch/blkpg.h | 64 libparted/arch/linux.c |1 - 2 files changed, 0 insertions(+), 65 deletions(-) delete mode 100644 libparted/arch/blkpg.h dif

[PATCH parted 1/3] linux: use blkid_topology_get_physical_sector_size

2010-01-11 Thread Hans de Goede
The official 2.17 release of util-linux-ng, has added a function to get the physical sector size, use that instead of getting the minimum io size. * libparted/arch/linux.c(_device_set_sector_size): use blkid_topology_get_physical_sector_size. --- libparted/arch/linux.c |2 +- 1 files changed,

[PATCH parted 3/3] linux: Remove PED_DEVICE_FILE check from _device_set_sector_size

2010-01-11 Thread Hans de Goede
_device_set_sector_size never get called for devices with a type of PED_DEVICE_FILE, and having a PED_DEVICE_FILE check inside an ifdef __390__ block does not make sense. * libparted/arch/linux.c(_device_set_sector_size): Remove PED_DEVICE_FILE check. --- libparted/arch/linux.c |3 +-- 1 files

Re: [PATCH parted 3/3] linux: Remove PED_DEVICE_FILE check from _device_set_sector_size

2010-01-29 Thread Hans de Goede
Hi, On 01/29/2010 10:31 AM, Jim Meyering wrote: Hans de Goede wrote: _device_set_sector_size never get called for devices with a type of PED_DEVICE_FILE, and having a PED_DEVICE_FILE check inside an ifdef __390__ block does not make sense. * libparted/arch/linux.c(_device_set_sector_size

[PATCH parted 1/7] linux: Fixup phys_sector_size setting

2010-01-30 Thread Hans de Goede
1) Use the logical sector size as physical sector size instead of 512 when not compiled with libblkid support, this fixes problems with logical sector size > physical sector size. 2) blkid_topology_get_physical_sector_size() can return 0 when it could not determine the physical sector size

[PATCH parted 5/7] parted: change warnings when initial constrained mkpart fails

2010-01-30 Thread Hans de Goede
In do_mkpart we first try to create a partition using a constraint derived from the user input intersected with the devices alignment needs. And if that fails we try again without any constraint. However the warning given when this happens only takes into account the user not getting what he asked

[PATCH parted 6/7] Makefiles: Fix check-other-sector_sizes

2010-01-30 Thread Hans de Goede
Atleast on my system check-other-sector_sizes was actually just testing 512 bytes sectors 4 times. This fixes this. * Makefile.am: Fix check-other-sector_sizes --- Makefile.am |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0e80967..d5a32ef

[PATCH parted 4/7] parted: Honor --align option also in mkpartfs, resize and print cmds

2010-01-30 Thread Hans de Goede
parted/parted.c (do_mkpartfs,do_print,do_resize): honor --align --- parted/parted.c | 26 +- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/parted/parted.c b/parted/parted.c index c4d1779..5ba8bbf 100644 --- a/parted/parted.c +++ b/parted/parted.c @@ -949

[PATCH parted 3/7] linux: handle incomplete topology information

2010-01-30 Thread Hans de Goede
The topology information returned by libblkid is not always complete (as the kernel does not always have complete information). This patch makes the linux_get_*_alignment() alignment functions handle this. The algorithm used for linux_get_optimum_alignment is: 1) Always use the reported aligment of

[PATCH parted 2/7] libparted: Give device_get_*_alignment sane defaults

2010-01-30 Thread Hans de Goede
When the topology info is incomplete or non existent, return something more sensible then NULL (which ends up being interpreted as PedAlignmentAny in most cases). The default minimum alignment aligns to physical sector size, the default optimal alignment is 1 MiB, which is what vista and windows 7

[PATCH parted 7/7] parted: Change default alignment to optimal

2010-01-30 Thread Hans de Goede
parted/parted.c: change --align default value to optimal tests/*.sh: adjust for alignment changes where necessary --- NEWS |3 +++ parted/parted.c|2 +- tests/t0220-gpt-msftres.sh |4 ++-- tests/t0280-gpt

Re: [PATCH parted 6/7] Makefiles: Fix check-other-sector_sizes

2010-01-31 Thread Hans de Goede
Hi, Thanks for the heads up, note that I've finished a couple of test installs this morning and the rest of the patch set is good to go too from my pov. Actually I've already build Fedora and RHEL-6 packages with it in. Regards, Hans On 01/31/2010 03:55 PM, Jim Meyering wrote

Re: [PATCH parted 6/7] Makefiles: Fix check-other-sector_sizes

2010-01-31 Thread Hans de Goede
Hi, On 01/31/2010 05:14 PM, Jim Meyering wrote: Hans de Goede wrote: Thanks for the heads up, note that I've finished a couple of test installs this morning and the rest of the patch set is good to go too from my pov. Actually I've already build Fedora and RHEL-6 packages

[PATCH parted 1/7] linux: Fixup phys_sector_size setting

2010-02-10 Thread Hans de Goede
1) Use the logical sector size as physical sector size instead of 512 when not compiled with libblkid support, this fixes problems with logical sector size > physical sector size. 2) blkid_topology_get_physical_sector_size() can return 0 when it could not determine the physical sector size

[PATCH parted 3/7] linux: handle incomplete topology information

2010-02-10 Thread Hans de Goede
The topology information returned by libblkid is not always complete (as the kernel does not always have complete information). This patch makes the linux_get_*_alignment() alignment functions handle this. The algorithm used for linux_get_optimum_alignment is: 1) Always use the reported aligment of

  1   2   >