Saturday, November 02, 2013

Ubuntu 13.10 Upgrade - Lessons Learned & VIDMA utility found

A few weeks ago a new release of Ubuntu came out.

Naturally that meant it was update time!

I have been getting pretty good at this now so I though I had it all figured out.

Wrong.

Here you go…documented for your entertainment and my education.

  1. Find in RSS feeds that my Ubuntu 13.04 Raring Ringtail install has a Ubuntu 13.10 Saucy Salamander update available.
    ●  Upgrade your PCs, servers, and phones: Ubuntu 13.10 lands tomorrow - Ars Technica
    ●  Ubuntu 13.10 review: The Linux OS of the future remains a year away - Ars Technica
    ●  Ubuntu 13.10 Released - But Is It An Essential Upgrade? - OMG! Ubuntu
    ●  Ubuntu 13.10 Saucy Salamander Review: A Boring Amphibian - Desktop Linux Reviews
    ●  Ubuntu 13.10 (Saucy Salamander) review: Smart Scopes in, Mir out - ZDNet
    ●  Saucy Salamander/Release Notes - Ubuntu Wiki
  2. Excitedly start the in-place upgrade of my VirtualBox Ubuntu build.
  3. Remembered this time (3rds the charm) that VirtualBox upgrades screw with Ubuntu (and I had recently upgraded to a new VirtualBox release and hadn’t ran my Ubuntu guest since) unless you first disable 3D acceleration in the VM machine settings. So I disabled it, launched the Ubuntu VM and now was able to load the desktop!
    hk3ijk2t.dbz
    At that point I was able to install/upgrade to the latest VirtualBox Extension pack within Ubuntu proper. It ran slow as molasses but got the job done. For some reason I keep forgetting what the correct option clicks to get the Extension pack installer auto-running after I mount the CD/ISO file. I did better this time. For some reason the dialog window prompts aren’t fully intuitive to me as a Windows user.
    1. First, run the installer from the host.
      rlkvvpwv.u4z
    2. Next choose the “Ask what to do” option (I think this is where I get tripped up and select another option incorrectly).
      egm215wp.p3c
    3. Run the auto installer
      zdshppbk.nv0
    4. Authenticate and install
      rf4k25to.2tb
      ●  How do I install Guest Additions in VirtualBox? - Ask Ubuntu.
      ●  Installing Guest Additions on Ubuntu - VirtualBoxes
  4. Once done, I rebooted the system after re-enabling the 3D Acceleration option in the VM settings.
  5. From there I continue by using Daniel Benny Simanjuntak’s tip in a previous Ubuntu post comments I did to run the following command from the terminal to start the upgrade process.
         …through terminal one can upgrade as well using the command:
          sudo do-release-upgrade -d
  6. Watch with anticipation.
  7. Installation failed.
  8. What!
  9. Try again.
  10. Failed again.
  11. Read error and log dialogs carefully and figure out I don’t have enough free space on my virtual hard drive. Apparently I set it up for a fixed disk size of about 8 GB.
  12. Started simple and ran command “sudo apt-get clean”. I seem to recall I had to do that last time I did an Ubuntu upgrade.
  13. That cleaned a bunch of stuff but when I tried to do the upgrade, I still didn’t have enough free space left to perform the upgrade. It eventually became clear that it was time to increase the size of my virtual hard drive. Goody.
  14. I tried a number of processes to expand (in place) my VM’s VDI virtual HDD file. None of them seemed to work successfully. It was super frustrating.
  15. Found vidma - Virtual Disks Manipulator (tool for resizing VDI). It’s a tiny standalone command line tool for resizing (fixed and dynamic type) VDI files. It is “Alpha” software but I figured I had little to loose at this point as if this didn’t work, I’d probably be going back to square one anyway.
    1. To make things easy I copied the utility over into the same location of my VDI file.
    2. Opened a command line window in this location
    3. Ran the command “vidma Xplico.vdi 20480” and fed it confirmations as needed. (Actually I  used the even value amount “20000” and resulted in a 19.53 GB expanded drive…not quite 20 GB even which the 20480 figure would have done.)
    4. Watched and waited patiently as it processed the file.
    5. When it was done I relaunched the VM (hurray it came up fine) and using GParted inside the current Ubuntu VM, checked the /dev/sda drive. It was showing the full 19.53 GiB partition. Up from the original 8 GiB.
  16. That was part one. Now I had to resize my active partition to incorporate the additional unallocated space that I had created in step 13 with vidma.
  17. I shut down the VM and rebooted it after attaching a GParted ISO. This would let me manipulate the internal partition information of my VDI file.
    1. Basically I followed (starting down the page at Step 4 “Expand the partition in the larger virtual disk”) the guide found posted by Eugene over at Trivial Proof: Resizing a VirtualBox Virtual Hard Disk
    2. Because I had set my Ubuntu drive up with a swap partition, I had to deal with it first as explained in the addendum in that guide.
    3. For some reason I was not able to move the swap partition out of the way as it describes. So I ended up following a tip in the comments from “jayesh” after carefully noting what size it originally was set at.

      ”I had an extended partition containing a swap partition between my root partition and unallocated space. So i tried to follow ADDENDUM steps but i was not able to move the extended partition in one step. So, i extended the "extended partition" with unallocated space, then moved the swap partition to the end of this new partition and finally shrink the extended partition to its original size, leaving unallocated space close to my root partition.”

      This post guide over at mwpreston.net expands that process in wonderful detail if you want more information before trying: Expanding a Linux disk with gparted (and getting swap out of the way) - mwpreston.net
    4. I then was able to expand the existing (in use partition) to take in (almost) all of the newly created unallocated space.
    5. Whew!
    6. Rebooted and detached the GParted ISO.
    7. My VM guest came up just fine and after another check in the GParted tool, confirmed things were put right again and I now had 18.43 GB of available space.
      0kiq0qqt.5i2
  18. Time to retry the Ubuntu 13.10 upgrade!
  19. From a terminal session: “sudo do-release-upgrade -d”
  20. Let it run forever…do a few reboots…
  21. When it is all settled down, I log in and kick the tires a bit, and change the desktop to the charming “Saucy Salamander” image.
    xefhiohv.gp2
  22. Looked for and updated any pending applications needing updating. Done.
  23. Check “Upgrade to Saucy Salamander” off my to-do list.

I would swear I captured a ton of screen shots of the actual VDI expansion and post-GParted partition wrangling work to document what I was doing, but I just can’t find where I put the screen cap files. Despite my best efforts to scour my HDD’s looking for them they just haven’t turned up. If I do later stumble upon them, I’ll update the post accordingly.

The only other “gotcha” I discovered immediately after the upgrade is that my beloved power-button in the top-right bar in Ubuntu 13.04 had been removed.  How do I shut the figgin thing down now?

prdh4foo.lrr

Apparently I wasn’t the only dolt stumbling over this, post upgrade.

Per that thread, I ended up settling for the “open a terminal, type sudo shutdown -h now, press enter and put the password” shutdown method.

Since that original upgrade to 13.10, I have since ran the Software Updater again to bring it current and I find my familiar shutdown icon is now back. Hurrah!

j0ajwvzt.gnj

I hope this helps any Ubuntu noobies out there with the upgrade process if you are running it in VirtualBox.

Previous Ubuntu upgrade posts here on GSD.

--Claus Valca

2 comments:

Przemoc said...

I'm glad that you found vidma useful. I'm commenting here, because I would like to correct one thing you wrote above.

> It’s a tiny standalone command line tool for resizing (fixed size) VDI files.

Resizing fixed VDI files in place was the reason I wrote vidma, but since version 0.0.3 dynamic VDI files are also supported.

It's all there in the first post of the thread about vidma in VB forum you linked in the post, though. I guess it was kind of tl;dr-feeling you could get seeing small wall of the text, but I believe that it's rather an informative wall. :)

Claus said...

@ Przemoc - Thank you for pointing out the detail. I have updated the post to reflect the support of both dynamic & fixed VDI files.

I see now where it was clearly listed in the post:

Supported formats

VDI - Virtual Disk Image
Format introduced by VirtualBox and mostly used by VirtualBox. It has a few variants, but only two types, fixed and dynamic, are handled by vidma.

I was so excited to find something that just "worked" with no drama to the problem at hand that I must have overlooked that detail.

Thank you again for your work developing the utility. It will be a super-useful tool and you are brilliant for coding it as well as sharing it with the community.

Cheers!

--Claus V.