<div dir="ltr">Confirmed that this revised patch continues to work for the >32G SDHC cards.<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 18, 2016 at 8:14 AM, David Cantrell <span dir="ltr"><<a href="mailto:dcantrell@redhat.com" target="_blank">dcantrell@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Right, the 512b block size thing.  Thanks for the update on this.  I'll give it a try on the 32GB card.<br></div><div><div class="h5"><div class="gmail_quote"><br>On Thu, Mar 17, 2016 at 7:53 PM, Brian C. Lane <span dir="ltr"><<a href="mailto:bcl@redhat.com" target="_blank">bcl@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dev->length is in 512b blocks, sectors should also be in the same units,<br>
so divide sector_size by PED_SECTOR_SIZE_DEFAULT.<br>
<br>
CHS sectors also start at 1, so add 1 to it and use 2 as the fallback<br>
default.<br>
<br>
FWIW the HDIO_GETGEO ioctl returns this on a 2048 sector 512b/sector scsi_debug<br>
disk:<br>
<br>
cyl=1024 heads=1 sectors=2<br>
<br>
With this change all tests pass, but it should also be tried with the<br>
32G SD card.<br>
---<br>
 libparted/arch/linux.c | 12 +++---------<br>
 1 file changed, 3 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c<br>
index 6422c56..326b956 100644<br>
--- a/libparted/arch/linux.c<br>
+++ b/libparted/arch/linux.c<br>
@@ -871,7 +871,7 @@ _device_probe_geometry (PedDevice* dev)<br>
<br>
         if (!ioctl (arch_specific->fd, BLKSSZGET, &sector_size)) {<br>
                 /* get the sector count first */<br>
-                dev->bios_geom.sectors = sector_size;<br>
+                dev->bios_geom.sectors = 1 + (sector_size / PED_SECTOR_SIZE_DEFAULT);<br>
                 dev->bios_geom.heads = 255;<br>
         } else if (!ioctl (arch_specific->fd, HDIO_GETGEO, &geometry)<br>
                         && geometry.sectors && geometry.heads) {<br>
@@ -885,20 +885,14 @@ _device_probe_geometry (PedDevice* dev)<br>
                         _("Could not determine sector size for %s: %s.\n"<br>
                           "Using the default sector size (%lld)."),<br>
                         dev->path, strerror (errno), PED_SECTOR_SIZE_DEFAULT);<br>
-                dev->bios_geom.sectors = PED_SECTOR_SIZE_DEFAULT;<br>
+                dev->bios_geom.sectors = 2;<br>
                 dev->bios_geom.heads = 255;<br>
         }<br>
<br>
-        dev->hw_geom.heads = dev->bios_geom.heads;<br>
-        dev->hw_geom.sectors = dev->bios_geom.sectors;<br>
-<br>
         dev->bios_geom.cylinders<br>
                 = dev->length / (dev->bios_geom.heads<br>
                                  * dev->bios_geom.sectors);<br>
-        dev->hw_geom.cylinders<br>
-                = dev->length / (dev->hw_geom.heads<br>
-                                 * dev->hw_geom.sectors);<br>
-<br>
+        dev->hw_geom = dev->bios_geom;<br>
         return 1;<br>
 }<br>
<span><font color="#888888"><br>
--<br>
2.5.0<br>
<br>
</font></span></blockquote></div><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div><div>David Cantrell <<a href="mailto:dcantrell@redhat.com" target="_blank">dcantrell@redhat.com</a>><br></div></div>Manager, Installer Engineering Team<br></div>Red Hat, Inc. | Westford, MA | EST5EDT<br></div></div></div></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div><div>David Cantrell <<a href="mailto:dcantrell@redhat.com" target="_blank">dcantrell@redhat.com</a>><br></div></div>Manager, Installer Engineering Team<br></div>Red Hat, Inc. | Westford, MA | EST5EDT<br></div></div></div></div>
</div></div></div>