(k)inaddy@kvirtclone:~$ sudo fdisk /fakedisk

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p
Disk /fakedisk: 128 MiB, 134217728 bytes, 262144 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9953d6a9

Device     Boot Start    End Sectors  Size Id Type
/fakedisk1       2048 262143  260096  127M 83 Linux

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-262143, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-262143, default 262143): 
+100mb

Created a new partition 1 of type 'Linux' and of size 95 MiB.

(k)inaddy@kvirtclone:~$ sudo qemu-nbd -c /dev/nbd8 -f raw /fakedisk

(k)inaddy@kvirtclone:~$ ls /dev/nbd8*
/dev/nbd8  /dev/nbd8p1

(k)inaddy@kvirtclone:~$ sudo growpart  /dev/nbd8 1
CHANGED: partition=1 start=2048 old: size=194560 end=196608 new: size=260063 
end=262111


(k)inaddy@kvirtclone:~$ sudo mv /fakedisk /fakedisk.ext4

(k)inaddy@kvirtclone:~$ sudo fdisk /fakedisk.ext4

(m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-262143, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-262143, default 262143): 
+100mb

Created a new partition 1 of type 'Linux' and of size 95 MiB.

Command (m for help): p
Disk /fakedisk.ext4: 128 MiB, 134217728 bytes, 262144 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9953d6a9

Device           Boot Start    End Sectors Size Id Type
/fakedisk.ext4p1       2048 196607  194560  95M 83 Linux

Command (m for help): w
The partition table has been altered.
Syncing disks.


(k)inaddy@kvirtclone:~$ sudo growpart /fakedisk.ext4 1
FAILED: failed to get start and end for /fakedisk.ext41 in /fakedisk.ext4

### BEFORE YOUR PATCH ^^^^^^^^

### AFTER YOUR PATCH vvvvvvvvv

(k)inaddy@kvirtclone:~/work/sources/ubuntu/cloud-utils$ sudo dpkg -i ./*.deb
(Reading database ... 129124 files and directories currently installed.)
Preparing to unpack .../cloud-guest-utils_0.30-52-g97fddc7b-0ubuntu1_all.deb ...
Unpacking cloud-guest-utils (0.30-52-g97fddc7b-0ubuntu1) over 
(0.30-51-g7adb670f-0ubuntu1) ...
Preparing to unpack .../cloud-image-utils_0.30-52-g97fddc7b-0ubuntu1_all.deb ...
Unpacking cloud-image-utils (0.30-52-g97fddc7b-0ubuntu1) over 
(0.30-51-g7adb670f-0ubuntu1) ...
Preparing to unpack .../cloud-utils-euca_0.30-52-g97fddc7b-0ubuntu1_all.deb ...
Unpacking cloud-utils-euca (0.30-52-g97fddc7b-0ubuntu1) over 
(0.30-51-g7adb670f-0ubuntu1) ...
Preparing to unpack .../cloud-utils_0.30-52-g97fddc7b-0ubuntu1_all.deb ...
Unpacking cloud-utils (0.30-52-g97fddc7b-0ubuntu1) over 
(0.30-51-g7adb670f-0ubuntu1) ...
Setting up cloud-guest-utils (0.30-52-g97fddc7b-0ubuntu1) ...
Setting up cloud-image-utils (0.30-52-g97fddc7b-0ubuntu1) ...
Setting up cloud-utils-euca (0.30-52-g97fddc7b-0ubuntu1) ...
Setting up cloud-utils (0.30-52-g97fddc7b-0ubuntu1) ...
Processing triggers for man-db (2.8.5-2) ...

(k)inaddy@kvirtclone:~$ sudo growpart /fakedisk.ext4 1
CHANGED: partition=1 start=2048 old: size=194560 end=196608 new: size=260063 
end=262111

and now it works.

Thanks, I'll give a +1 on the MR.

** Changed in: cloud-utils (Ubuntu)
   Importance: Wishlist => Low

** Changed in: cloud-utils (Ubuntu)
       Status: Triaged => In Progress

** Changed in: cloud-utils (Ubuntu)
     Assignee: (unassigned) => Scott Moser (smoser)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1835124

Title:
  growpart mishandles image filenames that end in a number

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-utils/+bug/1835124/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to