example resize info with vivid:
$ qemu-img create -f qcow2 -b vivid-server-cloudimg-amd64-disk1.qcow2.dist 
vivid-server-cloudimg-amd64-disk1.qcow2
Formatting 'vivid-server-cloudimg-amd64-disk1.qcow2', fmt=qcow2 size=2361393152 
backing_file='vivid-server-cloudimg-amd64-disk1.qcow2.dist' encryption=off 
cluster_size=65536 lazy_refcounts=off 

$ sudo mount-image-callback --system-resolvconf --system-mounts \
   vivid-server-cloudimg-amd64-disk1.qcow2 -- chroot _MOUNTPOINT_ \
    bash -ec 'set -o pipefail;
      dev=$(awk "\$2 == \"/\" { d=\$1 }; END { print d }" "mp=$MOUNTPOINT" 
/proc/mounts);
      df -k /; resize2fs $dev; df -k /; ' 2>/dev/null
Filesystem     1K-blocks   Used Available Use% Mounted on
-                 933848 859096     58368  94% /
Filesystem at /dev/nbd0p1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/nbd0p1 is now 524032 (4k) blocks long.

Filesystem     1K-blocks   Used Available Use% Mounted on
-                2018256 859604   1142268  43% /


** Description changed:

  The cloud image qcow filesystems require resizing before use.
  This is really just silly.
  
  Additionally, growpart can grow them.  We should distribute them with
  the filesystem grown to the full size.
  
  In summary of below, what I see is:
-   * all images are 2.2G disks (seems like 2.0 might be a better choice)
-   * filesystem on partition 1 is:
-     1.4G in trusty and utopic
-     ~900M in vivid and wily
-   * While the partition sizes are consistent (which is good), in all cases
-     there is > 200M of unallocated space at the end of the disk.
+   * all images are 2.2G disks (seems like 2.0 might be a better choice)
+   * filesystem on partition 1 is:
+     1.4G in trusty and utopic
+     ~900M in vivid and wily
+   * While the partition sizes are consistent (which is good), in all cases
+     there is > 200M of unallocated space at the end of the disk.
+   * i failed to show it well, but in each case, the fs doesnt even take up 
all space it could inside the partition.  In vivid, there is *plenty* of room 
in the image, but not in the filesystem.
+ 
  
  cloud-init and growpart fix all of these before a booted system finds them, 
but it is pointless to distribute them like this and require that additional IO.
  Additionally, the user who is trying to modify the image outside of booting 
it has complexity added as they have to grow the partition and resize the 
filesystem.
  
  $ ./image-info get
  ...
  
  $ ./image-info trusty* utopic* vivid* wily* 2>/dev/null
  ==== file size info ===
  -rw-rw-r-- 1 ubuntu ubuntu  257360384 Jun  9 05:28 
trusty-server-cloudimg-amd64-disk1.img
  -rw-r--r-- 1 ubuntu ubuntu 2361393152 Jun 10 19:02 
trusty-server-cloudimg-amd64-disk1.img.raw
  -rw-rw-r-- 1 ubuntu ubuntu  268370432 Jun  8 17:08 
utopic-server-cloudimg-amd64-disk1.img
  -rw-r--r-- 1 ubuntu ubuntu 2361393152 Jun 10 19:02 
utopic-server-cloudimg-amd64-disk1.img.raw
  -rw-rw-r-- 1 ubuntu ubuntu  285344256 Jun  9 07:50 
vivid-server-cloudimg-amd64-disk1.img
  -rw-r--r-- 1 ubuntu ubuntu 2361393152 Jun 10 19:03 
vivid-server-cloudimg-amd64-disk1.img.raw
  -rw-rw-r-- 1 ubuntu ubuntu  285540864 Jun  8 23:50 
wily-server-cloudimg-amd64-disk1.img
  -rw-r--r-- 1 ubuntu ubuntu 2361393152 Jun 10 19:03 
wily-server-cloudimg-amd64-disk1.img.raw
  ==== filesystem usage info ===
  == trusty-server-cloudimg-amd64-disk1.img.raw ==
  -               1.4G  767M  501M  61% /
  Block count:              360448
  Block size:               4096
  == utopic-server-cloudimg-amd64-disk1.img.raw ==
  -               1.4G  791M  477M  63% /
  Block count:              360448
  Block size:               4096
  == vivid-server-cloudimg-amd64-disk1.img.raw ==
  -               912M  839M   58M  94% /
  Block count:              245248
  Block size:               4096
  == wily-server-cloudimg-amd64-disk1.img.raw ==
  -               911M  837M   58M  94% /
  Block count:              244736
  Block size:               4096
  ==== growpart info ====
  == trusty-server-cloudimg-amd64-disk1.img.raw ==
  CHANGE: partition=1 start=2048 old: size=4192256 end=4194304 new: 
size=4610048,end=4612096
  == utopic-server-cloudimg-amd64-disk1.img.raw ==
  CHANGE: partition=1 start=2048 old: size=4192256 end=4194304 new: 
size=4610048,end=4612096
  == vivid-server-cloudimg-amd64-disk1.img.raw ==
  CHANGE: partition=1 start=2048 old: size=4192256 end=4194304 new: 
size=4610048,end=4612096
  == wily-server-cloudimg-amd64-disk1.img.raw ==
  CHANGE: partition=1 start=2048 old: size=4192256 end=4194304 new: 
size=4610048,end=4612096

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

Title:
  qcow2 cloud image filesystem not resized to full

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/1463963/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to