diff -Nru parted-2.3/debian/changelog parted-2.3/debian/changelog --- parted-2.3/debian/changelog 2014-04-14 06:56:14.000000000 -0400 +++ parted-2.3/debian/changelog 2015-07-14 10:49:56.000000000 -0400 @@ -1,3 +1,11 @@ +parted (2.3-19ubuntu1non512bsectors1) trusty; urgency=medium + + [ Mauricio Faria de Oliveira ] + * Support disks with non 512-byte sectors (LP: #1441930 for 14.04 series) + - Added dm-512b-sectors.patch: fix partition sizes for device-mapper (multipath/lvm devices). + + -- Mauricio Faria de Oliveira Tue, 14 Jul 2015 11:09:55 +0300 + parted (2.3-19ubuntu1) trusty; urgency=medium * Upload from Debian git repository to fix a release-critical bug. diff -Nru parted-2.3/debian/patches/dm-512b-sectors.patch parted-2.3/debian/patches/dm-512b-sectors.patch --- parted-2.3/debian/patches/dm-512b-sectors.patch 1969-12-31 19:00:00.000000000 -0500 +++ parted-2.3/debian/patches/dm-512b-sectors.patch 2015-07-14 10:45:34.000000000 -0400 @@ -0,0 +1,51 @@ +Origin: backport, http://git.savannah.gnu.org/cgit/parted.git/commit?id=f98f791e19669b900345dad7d96ea4df974e4596 +From f98f791e19669b900345dad7d96ea4df974e4596 Mon Sep 17 00:00:00 2001 +From: Brian C. Lane +Date: Thu, 05 Feb 2015 00:46:07 +0000 +Subject: libparted: device mapper uses 512b sectors + +device mapper doesn't use the device's sector size when creating a +table. It always uses 512b units. This causes partitions to be created +8x smaller than expected on devices with 4906b sectors. +--- +(limited to 'libparted/arch/linux.c'; removed resize-related functions, inexistent.) + +Index: parted-2.3/libparted/arch/linux.c +=================================================================== +--- parted-2.3.orig/libparted/arch/linux.c 2015-07-14 10:45:08.518601002 -0400 ++++ parted-2.3/libparted/arch/linux.c 2015-07-14 10:45:08.514601001 -0400 +@@ -2913,6 +2913,12 @@ + if (sscanf (params, "%d:%d %Ld", &major, &minor, start) != 3) + goto err; + rc = 1; ++ ++ /* device-mapper uses 512b units, make sure we return length and start in terms of the device's ++ * sector size. ++ */ ++ *start /= (part->disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT); ++ *length /= (part->disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT); + err: + free (path); + dm_task_destroy(task); +@@ -2952,8 +2958,10 @@ + dm_task_destroy (task); + task = NULL; + ++ /* device-mapper uses 512b units, not the device's sector size */ + if (asprintf (¶ms, "%d:%d %lld", arch_specific->major, +- arch_specific->minor, part->geom.start) == -1) ++ arch_specific->minor, ++ part->geom.start * (disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT)) == -1) + goto err; + + task = dm_task_create (DM_DEVICE_CREATE); +@@ -2961,7 +2969,8 @@ + goto err; + + dm_task_set_name (task, vol_name); +- dm_task_add_target (task, 0, part->geom.length, ++ /* device-mapper uses 512b units, not the device's sector size */ ++ dm_task_add_target (task, 0, part->geom.length * (disk->dev->sector_size / PED_SECTOR_SIZE_DEFAULT), + "linear", params); + if (dm_task_run (task)) { + //printf("0 %ld linear %s\n", part->geom.length, params); diff -Nru parted-2.3/debian/patches/series parted-2.3/debian/patches/series --- parted-2.3/debian/patches/series 2014-04-14 06:33:11.000000000 -0400 +++ parted-2.3/debian/patches/series 2015-07-14 10:44:20.000000000 -0400 @@ -45,3 +45,4 @@ gpt-prep.patch new-style-readline-typedef.patch fat-ntfs-large-sectors.patch +dm-512b-sectors.patch