Larger than 2 TB disks not possible
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-utils |
Fix Released
|
Medium
|
Unassigned | ||
cloud-utils (Ubuntu) |
Fix Released
|
Medium
|
Scott Moser | ||
Xenial |
Fix Released
|
Medium
|
Scott Moser | ||
Artful |
Fix Released
|
Medium
|
Scott Moser | ||
Bionic |
Fix Released
|
Medium
|
Scott Moser |
Bug Description
=== Begin SRU Template ===
[Impact]
Growpart will not grow a partition past the 2TB mark.
The code to do this is present by design for MBR partitioned disks but
was active both for MBR and for GPT.
The primary impact is that guests with very large root disks will
not have their root filesystem grown completely.
[Test Case]
There is a test case in cloud-utils 'test/test-
It can be invoked to test this path.
a. Install cloud-guest-utils.
# add -proposed or otherwise add apt to have correct version.
apt-get update
apt-get install cloud-guest-utils
dpkg-query --show cloud-guest-utils
b. get test case
url=https:/
wget "$url" -O test-growpart
chmod 755 test-growpart
c. run test case growing from 1TB disk to 5TB disk.
## Note you do not want to run this on an encrypted disk as it would
## actually take 5TB and would be terribly slow.
$ sudo PT_TYPE=gpt DISK_SIZE_NEW=5T DISK_SIZE_ORIG=1T ./test-growpart
This should result in a 5TB filesystem.
d. make sure MBR doesnt grow past 2TB.
$ sudo PT_TYPE=dos DISK_SIZE_NEW=5T DISK_SIZE_ORIG=1T ./test-growpart
This should show a warning about the disk having unused space,
and should result in a 2TB filesystem.
e. Verify that cloud image correctly resizes.
1. Get a cloud image of correct release with cloud-guest-utils updated inside it
get-
https:/
$ get-proposed-
xenial xenial-proposed.img
2. create a disk larger than 2TB
qemu-img create -f qcow2 -b xenial-proposed.img large-disk.img 5T
3. boot image with large disk and nocloud seed.
$ cat > my-user-data <<"EOF"
#cloud-config
password: passw0rd
chpasswd: { expire: False }
ssh_pwauth: True
EOF
$ echo "instance-id: $(uuidgen || echo i-abcdefg)" > my-meta-data
$ cloud-localds my-seed.img my-user-data my-meta-data
$ qemu-system-x86_64 -enable-kvm \
-device virtio-
-drive file=large-
-device virtio-
-drive file=my-
-device virtio-
-snapshot -m 1G -nographic
Then log in as 'ubuntu' with 'passw0rd'
and run 'df -h /' to verify 5TB root filesystem.
[Regression Potential]
The most likely regression here would be to have mbr attempt to grow
past 2TB and fail. This is called out in test case part 'd' above.
[Other Info]
Upstream merge proposal:
https:/
Upstream commit:
https:/
=== End SRU Template ===
Hi,
We run Openstack and need to provide instances that have very large root disks (> 2 TB) and it looks like cloud-init doesn't want to use the entire space.
The regular Ubuntu cloud image has MBR and it doesn't see more than 2 TB, but even the GPT version (http://
root@ubuntu-16:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 121G 0 121G 0% /dev
tmpfs 25G 8.6M 25G 1% /run
/dev/vda1 2.0T 857M 2.0T 1% /
tmpfs 121G 0 121G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 121G 0 121G 0% /sys/fs/cgroup
tmpfs 25G 0 25G 0% /run/user/1000
root@ubuntu-16:~# parted /dev/vda p
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 5583GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 2199GB 2199GB primary ext4 boot
root@ubuntu-16:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 5.1T 0 disk
└─vda1 253:1 0 2T 0 part /
root@ubuntu-16:~# dpkg -l | grep cloud-init
ii cloud-init 17.2-35-
ii cloud-initramfs
ii cloud-initramfs
The cloud-init.log looks like the disk growing and file system resizing went fine:
018-04-10 14:14:31,332 - stages.py[DEBUG]: Running module growpart (<module 'cloudinit.
2018-04-10 14:14:31,332 - handlers.py[DEBUG]: start: init-network/
2018-04-10 14:14:31,332 - helpers.py[DEBUG]: Running config-growpart using lock (<cloudinit.
2018-04-10 14:14:31,332 - cc_growpart.
2018-04-10 14:14:31,332 - util.py[DEBUG]: Running command ['growpart', '--help'] with allowed return codes [0] (shell=False, capture=True)
2018-04-10 14:14:31,352 - util.py[DEBUG]: Reading from /proc/1192/
2018-04-10 14:14:31,352 - util.py[DEBUG]: Read 2621 bytes from /proc/1192/
2018-04-10 14:14:31,353 - util.py[DEBUG]: Running command ['systemd-
2018-04-10 14:14:31,355 - util.py[DEBUG]: Running command ['running-
2018-04-10 14:14:31,356 - util.py[DEBUG]: Running command ['lxc-is-
2018-04-10 14:14:31,357 - util.py[DEBUG]: Reading from /proc/1/environ (quiet=False)
2018-04-10 14:14:31,358 - util.py[DEBUG]: Read 153 bytes from /proc/1/environ
2018-04-10 14:14:31,358 - util.py[DEBUG]: Reading from /proc/self/status (quiet=False)
2018-04-10 14:14:31,358 - util.py[DEBUG]: Read 906 bytes from /proc/self/status
2018-04-10 14:14:31,358 - util.py[DEBUG]: Reading from /sys/class/
2018-04-10 14:14:31,358 - util.py[DEBUG]: Read 2 bytes from /sys/class/
2018-04-10 14:14:31,358 - util.py[DEBUG]: Reading from /sys/devices/
2018-04-10 14:14:31,359 - util.py[DEBUG]: Read 6 bytes from /sys/devices/
2018-04-10 14:14:31,359 - util.py[DEBUG]: Running command ['growpart', '--dry-run', '/dev/vda', '1'] with allowed return codes [0] (shell=False, capture=True)
2018-04-10 14:14:31,504 - util.py[DEBUG]: Running command ['growpart', '/dev/vda', '1'] with allowed return codes [0] (shell=False, capture=True)
2018-04-10 14:14:31,567 - util.py[DEBUG]: resize_devices took 0.215 seconds
2018-04-10 14:14:31,567 - cc_growpart.
2018-04-10 14:14:31,567 - handlers.py[DEBUG]: finish: init-network/
2018-04-10 14:14:31,567 - stages.py[DEBUG]: Running module resizefs (<module 'cloudinit.
2018-04-10 14:14:31,568 - handlers.py[DEBUG]: start: init-network/
2018-04-10 14:14:31,568 - helpers.py[DEBUG]: Running config-resizefs using lock (<cloudinit.
2018-04-10 14:14:31,568 - schema.py[DEBUG]: Ignoring schema validation. python-jsonschema is not present
2018-04-10 14:14:31,568 - util.py[DEBUG]: Reading from /proc/1192/
2018-04-10 14:14:31,568 - util.py[DEBUG]: Read 2621 bytes from /proc/1192/
2018-04-10 14:14:31,569 - cc_resizefs.
2018-04-10 14:14:31,569 - util.py[DEBUG]: Running command ['systemd-
2018-04-10 14:14:31,571 - util.py[DEBUG]: Running command ['running-
2018-04-10 14:14:31,572 - util.py[DEBUG]: Running command ['lxc-is-
2018-04-10 14:14:31,574 - util.py[DEBUG]: Reading from /proc/1/environ (quiet=False)
2018-04-10 14:14:31,574 - util.py[DEBUG]: Read 153 bytes from /proc/1/environ
2018-04-10 14:14:31,574 - util.py[DEBUG]: Reading from /proc/self/status (quiet=False)
2018-04-10 14:14:31,574 - util.py[DEBUG]: Read 906 bytes from /proc/self/status
2018-04-10 14:14:31,575 - cc_resizefs.
2018-04-10 14:14:31,575 - util.py[DEBUG]: Running command ('resize2fs', '/dev/vda1') with allowed return codes [0] (shell=False, capture=True)
2018-04-10 14:14:47,291 - util.py[DEBUG]: Resizing took 15.716 seconds
2018-04-10 14:14:47,291 - cc_resizefs.
2018-04-10 14:14:47,292 - handlers.py[DEBUG]: finish: init-network/
On the other hand, the Ubuntu 14.04 image with GPT works fine though and resizes the root to use the entire disk space provided, despite some errors in the cloud-init.log file:
root@14-gpt:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 121G 12K 121G 1% /dev
tmpfs 25G 352K 25G 1% /run
/dev/vda1 5.0T 811M 4.8T 1% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 121G 0 121G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/vda15 105M 3.2M 102M 4% /boot/efi
root@14-gpt:~# parted /dev/vda p
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 5583GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
14 1049kB 5243kB 4194kB bios_grub
15 5243kB 116MB 111MB fat32 boot
1 116MB 5583GB 5583GB ext4
root@14-gpt:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 253:0 0 5.1T 0 disk
├─vda1 253:1 0 5.1T 0 part /
├─vda14 253:14 0 4M 0 part
└─vda15 253:15 0 106M 0 part /boot/efi
root@14-gpt:~# dpkg -l | grep cloud-init
ii cloud-init 0.7.5-0ubuntu1.22 all Init scripts for cloud instances
Errors in the cloud-init.log file:
2018-04-10 14:42:40,537 - importer.py[DEBUG]: Looking for modules ['cc_growpart', 'cloudinit.
2018-04-10 14:42:40,538 - importer.py[DEBUG]: Failed at attempted import of 'cc_growpart' due to: No module named cc_growpart
2018-04-10 14:42:40,538 - importer.py[DEBUG]: Found cc_growpart with attributes ['handle'] in ['cloudinit.
2018-04-10 14:42:40,538 - importer.py[DEBUG]: Looking for modules ['cc_resizefs', 'cloudinit.
2018-04-10 14:42:40,538 - importer.py[DEBUG]: Failed at attempted import of 'cc_resizefs' due to: No module named cc_resizefs
2018-04-10 14:42:40,539 - importer.py[DEBUG]: Found cc_resizefs with attributes ['handle'] in ['cloudinit.
2018-04-10 14:42:40,539 - importer.py[DEBUG]: Looking for modules ['cc_set_hostname', 'cloudinit.
2018-04-10 14:42:40,539 - importer.py[DEBUG]: Failed at attempted import of 'cc_set_hostname' due to: No module named cc_set_hostname
2018-04-10 14:42:40,539 - importer.py[DEBUG]: Found cc_set_hostname with attributes ['handle'] in ['cloudinit.
2018-04-10 14:42:40,539 - importer.py[DEBUG]: Looking for modules ['cc_update_
2018-04-10 14:42:40,540 - importer.py[DEBUG]: Failed at attempted import of 'cc_update_
2018-04-10 14:42:40,540 - importer.py[DEBUG]: Found cc_update_hostname with attributes ['handle'] in ['cloudinit.
2018-04-10 14:42:40,540 - importer.py[DEBUG]: Looking for modules ['cc_update_
2018-04-10 14:42:40,540 - importer.py[DEBUG]: Failed at attempted import of 'cc_update_
2018-04-10 14:42:40,540 - importer.py[DEBUG]: Found cc_update_etc_hosts with attributes ['handle'] in ['cloudinit.
2018-04-10 14:42:40,540 - importer.py[DEBUG]: Looking for modules ['cc_ca_certs', 'cloudinit.
2018-04-10 14:42:40,541 - importer.py[DEBUG]: Failed at attempted import of 'cc_ca_certs' due to: No module named cc_ca_certs
2018-04-10 14:42:40,541 - importer.py[DEBUG]: Found cc_ca_certs with attributes ['handle'] in ['cloudinit.
2018-04-10 14:42:40,541 - importer.py[DEBUG]: Looking for modules ['cc_rsyslog', 'cloudinit.
2018-04-10 14:42:40,541 - importer.py[DEBUG]: Failed at attempted import of 'cc_rsyslog' due to: No module named cc_rsyslog
2018-04-10 14:42:40,542 - importer.py[DEBUG]: Found cc_rsyslog with attributes ['handle'] in ['cloudinit.
2018-04-10 14:42:40,542 - importer.py[DEBUG]: Looking for modules ['cc_users_groups', 'cloudinit.
2018-04-10 14:42:40,542 - importer.py[DEBUG]: Failed at attempted import of 'cc_users_groups' due to: No module named cc_users_groups
2018-04-10 14:42:40,542 - importer.py[DEBUG]: Found cc_users_groups with attributes ['handle'] in ['cloudinit.
2018-04-10 14:42:40,542 - importer.py[DEBUG]: Looking for modules ['cc_ssh', 'cloudinit.
2018-04-10 14:42:40,542 - importer.py[DEBUG]: Failed at attempted import of 'cc_ssh' due to: No module named cc_ssh
2018-04-10 14:42:40,543 - importer.py[DEBUG]: Found cc_ssh with attributes ['handle'] in ['cloudinit.
2018-04-10 14:42:40,543 - importer.py[DEBUG]: Looking for modules ['ubuntu', 'cloudinit.
2018-04-10 14:42:40,543 - importer.py[DEBUG]: Failed at attempted import of 'ubuntu' due to: No module named ubuntu
2018-04-10 14:42:40,543 - importer.py[DEBUG]: Found ubuntu with attributes ['Distro'] in ['cloudinit.
2018-04-10 14:42:40,543 - stages.py[DEBUG]: Using distro class <class 'cloudinit.
2018-04-10 14:42:40,544 - helpers.py[DEBUG]: Running config-migrator using lock (<cloudinit.
2018-04-10 14:42:40,544 - cc_migrator.
2018-04-10 14:42:40,544 - util.py[DEBUG]: Writing to /var/lib/
2018-04-10 14:42:40,544 - helpers.py[DEBUG]: Running config-seed_random using lock (<FileLock using file '/var/lib/
2018-04-10 14:42:40,544 - cc_seed_
2018-04-10 14:42:40,544 - util.py[DEBUG]: Writing to /dev/urandom - ab: [None] 512 bytes
2018-04-10 14:42:40,545 - util.py[DEBUG]: Running command ['pollinate', '-q'] with allowed return codes [0] (shell=False, capture=False)
2018-04-10 14:42:41,192 - helpers.py[DEBUG]: Running config-bootcmd using lock (<cloudinit.
2018-04-10 14:42:41,192 - cc_bootcmd.
2018-04-10 14:42:41,192 - util.py[DEBUG]: Writing to /var/lib/
2018-04-10 14:42:41,192 - helpers.py[DEBUG]: Running config-write-files using lock (<FileLock using file '/var/lib/
2018-04-10 14:42:41,192 - cc_write_
2018-04-10 14:42:41,193 - helpers.py[DEBUG]: Running config-growpart using lock (<cloudinit.
2018-04-10 14:42:41,193 - cc_growpart.
2018-04-10 14:42:41,193 - util.py[DEBUG]: Running command ['growpart', '--help'] with allowed return codes [0] (shell=False, capture=True)
2018-04-10 14:42:41,197 - util.py[DEBUG]: Reading from /proc/945/mountinfo (quiet=False)
2018-04-10 14:42:41,197 - util.py[DEBUG]: Read 1174 bytes from /proc/945/mountinfo
2018-04-10 14:42:41,197 - util.py[DEBUG]: Reading from /sys/class/
2018-04-10 14:42:41,197 - util.py[DEBUG]: Read 2 bytes from /sys/class/
2018-04-10 14:42:41,197 - util.py[DEBUG]: Reading from /sys/devices/
2018-04-10 14:42:41,197 - util.py[DEBUG]: Read 6 bytes from /sys/devices/
2018-04-10 14:42:41,197 - util.py[DEBUG]: Running command ['growpart', '--dry-run', '/dev/vda', '1'] with allowed return codes [0] (shell=False, capture=True)
2018-04-10 14:42:41,223 - util.py[DEBUG]: Running command ['growpart', '/dev/vda', '1'] with allowed return codes [0] (shell=False, capture=True)
2018-04-10 14:42:42,276 - util.py[DEBUG]: resize_devices took 1.080 seconds
2018-04-10 14:42:42,276 - cc_growpart.
I also attached the output generated from "cloud-init collect-logs" from a Ubuntu 16.04 (GPT) instance deployed with a disk of 5.1 TB
Thank you.
Related branches
- Registry Administrators: Pending requested
-
Diff: 74 lines (+16/-11)2 files modifiedbin/growpart (+9/-7)
test/test-growpart (+7/-4)
affects: | cloud-init → cloud-utils |
Changed in cloud-utils: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in cloud-utils (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in cloud-utils: | |
status: | Confirmed → Fix Committed |
Changed in cloud-utils (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-utils (Ubuntu Artful): | |
status: | New → Confirmed |
Changed in cloud-utils (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in cloud-utils (Ubuntu Artful): | |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
This bug was fixed in the package cloud-utils - 0.30-0ubuntu4
---------------
cloud-utils (0.30-0ubuntu4) bionic; urgency=medium
* sync to trunk at 323.
- growpart: fix bug that stopped GPT disks from being grown past 2TB.
(LP: #1762748)
-- Scott Moser <email address hidden> Thu, 12 Apr 2018 23:36:41 -0400