Changes between Version 13 and Version 14 of UpgradeNotes


Ignore:
Timestamp:
Aug 16, 2012 10:18:51 AM (12 years ago)
Author:
Ted Faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UpgradeNotes

    v13 v14  
    5858The sources are in {{{~mikeryan/dev/benito/vde}}} but the changes were not completely clear.
    5959
     60= Compressing The Image =
     61
     62After getting everything installed on the image, it gets to be sizeable.  The qcow2 image was 3+ GB.  To reduce this, convert the image to a raw disk image
     63
     64{{{
     65$ qemu-img convert -p -O raw pangolin.img pangolin.raw.img
     66}}}
     67
     68Now we need to run {{{zerofree}}} to clear out the dirty sectors.  (zerofree is in the repo)
     69
     70I fooled around quite a bit with trying to boot a qemu instance from the qcow2 image and mount the raw image for zerofreeing.  This failed in many ways.  Attaching both disks always mounts the raw image and corrupts the qcow2.  You can make teh qcow2 image a disk and boot from it, with the raw image on a USB disk, but the zerofree is too slow.
     71
     72Ultimately the easy way to do this was to mount the raw image through the loopback, using the mechanism [http://askubuntu.com/questions/69363/mount-disk-device-image here].  Basically:
     73
     74{{{
     75$ fdisk -lu pangolin.raw.img
     76
     77Disk pangolin.raw.img: 10.7 GB, 10737418240 bytes
     78255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors
     79Units = sectors of 1 * 512 = 512 bytes
     80Sector size (logical/physical): 512 bytes / 512 bytes
     81I/O size (minimum/optimal): 512 bytes / 512 bytes
     82Disk identifier: 0x0000b82d
     83
     84           Device Boot      Start         End      Blocks   Id  System
     85pangolin.raw.img1   *        2048    18874367     9436160   83  Linux
     86pangolin.raw.img2        18876414    20969471     1046529    5  Extended
     87pangolin.raw.img5        18876416    20969471     1046528   82  Linux swap / Solaris
     88$ dc
     89512 2048 * p
     901048576
     91# (sector size * start of partition)
     92$ sudo losetup -o 1048576 /dev/loop0 pangolin.raw.img
     93$ sudo mount /dev/loop0 /mnt
     94$ sudo zerofree -v /dev/loop0
     95247417/1655938/2359040
     96$ sudo losetup -d /dev/loop0
     97# Don't forget -c for compression
     98$ qemu-img convert -p -c -O qcow2 pangolin.raw.img pangolin-dev.img
     99}}}
     100
     101The resulting image is roughly 1.1 GB.  A considerable savings.
    60102
    61103= Making DEBs for ViewOS =