[parted-devel] Parted and usage with larger sector sizes

xerces8 xerces8 at butn.net
Tue Jun 3 07:34:38 UTC 2008


Hi!

Sorry, but parted appears to not support sectors sized other than 512 bytes.
The FAQ just says, that it will align the partitions to the physical sector size.
But it will still use 512 byte sized sectors.

See this recent email from Jim Meyering (look for the string "512") :
(here is the relevant part : "you're trying to use a disk with
sector_size > 512.  Converting parted to work with such sector
sizes is a big job, and will requirea significant widespread changes.")


From:	Jim Meyering <jim at meyering.net> Add Address to Contacts
To:	Otavio Salvador <otavio at debian.org>
Cc:	parted-devel at lists.alioth.debian.org
Date:	29/05/2008 10:41
Subject:	Re: [parted-devel] Progress about ipod issue
(https://bugzilla.redhat.com/show_bug.cgi?id=212066)

Otavio Salvador <otavio at debian.org> wrote:
> I think I did some progress about the ipod issue.

Hi Otavio,
Thanks for looking into this.

> Adding the bug patch or the current proposed Colin's patch it fixes
> the label detection but fails due a bad geom. Looking at code, I found
> where it was doing a wrong thing...

Would you please explain (give examples with real numbers)
what was going wrong and how this change fixes it?

> diff --git a/libparted/labels/dos.c b/libparted/labels/dos.c
> index e513a05..0b11867 100644
> --- a/libparted/labels/dos.c
> +++ b/libparted/labels/dos.c
> @@ -378,9 +378,7 @@ linear_start (const PedDisk* disk, const DosRawPartition* raw_part,
>     PED_ASSERT (disk != NULL, return 0);
>     PED_ASSERT (raw_part != NULL, return 0);
>
> -   return offset
> -          + PED_LE32_TO_CPU (raw_part->start)
> -                 * (disk->dev->sector_size / 512);
> +   return offset + PED_LE32_TO_CPU (raw_part->start);
>  }
>
>  static PedSector
> @@ -391,8 +389,7 @@ linear_end (const PedDisk* disk, const DosRawPartition* raw_part,
>     PED_ASSERT (raw_part != NULL, return 0);
>
>     return linear_start (disk, raw_part, offset)
> -          + (PED_LE32_TO_CPU (raw_part->length) - 1)
> -                 * (disk->dev->sector_size / 512);
> +          + (PED_LE32_TO_CPU (raw_part->length) - 1);
>  }
>
>  #ifndef DISCOVER_ONLY
>
> This provides right geom; code now has a segfault that I was unable to
> find. Any hint?

I presume you're trying to use a disk with sector_size > 512.  Converting
parted to work with such sector sizes is a big job, and will require
a significant widespread changes.  The typical failure I've seen while
addressing this sort of problem is a stack-smashing (tiresome to debug)
or heap-corrupting bug, because there are hard-coded 512-byte buffers
everywhere.  I've converted the code for a few partition table types
already, and posted an incomplete patch months ago, but haven't yet
returned to the task.  And until all partition table types are converted,
it's not really usable due to the way Parted probes using each type
until it finds one that works.

I hope to resume work on this in the next couple months,
but can't say for sure.

-----Original Message-----
From: John Quigley <jquigley+parted at jquigley.com>
To: GNU Parted Devel <parted-devel at lists.alioth.debian.org>
Date: Mon, 02 Jun 2008 15:26:12 -0500
Subject: [parted-devel] Parted and usage with larger sector sizes

> Hey Folks:
> 
> I hope this is going to the proper list, excuse me if not.  I'm working on an open source project
> that provides durable storage on a distributed network.  Our primary interface into this facility
> is via an iSCSI target, that works as expected on various operating systems.
> 
> Due to the distributed nature of the system, it's much more efficient if our iSCSI/SCSI
> implementation is configured to use sector sizes greater than 512 (our current default is 4096). 
> We've been successfully testing in this configuration for months using fdisk.  We've recently
> embarked on testing larger capacities (greater than 2TB), which necessitates our usage of parted,
> as fdisk, cfdisk, et. al. do not support such sizes.
> 
> According to your FAQ [1], parted supports sector sizes other than 512:
> 
> Does GNU Parted support physical sector sizes not equal to 512?
> Starting from 1.7, GNU Parted will automatically align partitions to the physical sector size
> reported by an ATAPI-compliant drive.
> 
> We appear to be having troubles, however.  Running traces at the SCSI command level seems to
> indicate that it isn't our software acting up.  I include an example parted session below, using
> first a hand compiled version of the recent stable 1.8.8, and then a CentOS-provided packaged
> version of 1.8.1 [2].
> 
> I would appreciate it tremendously if parted developers could lend me some insight as to what I
> should be expecting?  Has parted undergone thorough testing with devices of non-standard sector
> size?  Is there another utility that you know of that can support both very large devices and
> non-standard sector size?  Any thoughts or recommendations would be very much appreciated. 
> Thanks so much for your consideration =)
> 
> - John Quigley
> Cleversafe, Inc.
> 
> [1] http://www.gnu.org/software/parted/faq.shtml
> 
> [2] Example session:
> 
> <session>
> $ cat /etc/redhat-release
> CentOS release 5 (Final)
> $ ./parted /dev/sdf
> Warning: Device /dev/sdf has a logical sector size of 4096.  Not all parts of GNU Parted support
> this at the moment,
> and the working code is HIGHLY EXPERIMENTAL.
> 
> GNU Parted 1.8.8
> Using /dev/sdf
> Welcome to GNU Parted! Type 'help' to view a list of commands.
> (parted) mklabel
> 
> You found a bug in GNU Parted! Here's what you have to do:
> 
> (snipped text here)
> 
> Command History:
> mklabel
> 
> Error: SEGV_MAPERR (Address not mapped to object)
> Aborted
> # /sbin/parted /dev/sdf
> Warning: Device /dev/sdf has a logical sector size of 4096.  Not all parts of GNU Parted support
> this at the moment,
> and the working code is HIGHLY EXPERIMENTAL.
> 
> GNU Parted 1.8.1
> Using /dev/sdf
> Welcome to GNU Parted! Type 'help' to view a list of commands.
> (parted) mklabel
> New disk label type?
> Error: Expecting a disk label type.
> (parted) q
> Information: Don't forget to update /etc/fstab, if necessary.
> 
> [root at qwchi-lab-pd05 parted]# /sbin/parted /dev/sdf
> Warning: Device /dev/sdf has a logical sector size of 4096.  Not all parts of GNU Parted support
> this at the moment,
> and the working code is HIGHLY EXPERIMENTAL.
> 
> GNU Parted 1.8.1
> Using /dev/sdf
> Welcome to GNU Parted! Type 'help' to view a list of commands.
> (parted) mklabel gpt
> Error: Invalid argument during write on /dev/sdf
> Retry/Ignore/Cancel? r
> Error: Invalid argument during write on /dev/sdf
> Retry/Ignore/Cancel? i
> Error: Invalid argument during write on /dev/sdf
> Retry/Ignore/Cancel? r
> Error: Invalid argument during write on /dev/sdf
> Retry/Ignore/Cancel? i
> Error: Invalid argument during write on /dev/sdf
> Retry/Ignore/Cancel? c
> (parted)
> </session>
> 
> I would provide you with the following:
> 
>  parted DEVICE unit co print unit s print
> 
> However, the software bombs in this case as well.
> 
> 
> _______________________________________________
> parted-devel mailing list
> parted-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/parted-devel





More information about the parted-devel mailing list