Hawaiʻi's Technology Community

Migrating an Ubuntu Karmic installation from SD to SSHD

Aloha e Kakou!  (Hello to us all!)

I am but a humble convert prostrating myself before you, the all-knowing collective.  Here is my story and my humble request...

One day, in the depths of misery evident in every Vista, I decided to give Karmic a spin.  Yet, I being mired in an insane and skewed Vista of computing life akin to looking through $hit caked Windows, was of little faith in Karmic salvation.  I needed more proof of this path to Karmic freedom.  I didn't want to abandon the relative safety of the Vista installation on my Thinkpad X200S (/dev/sda2) while learning more about Karmic salvation.  So, I bought a 16Gb SD card with the idea of installing Karmic to the SD (so I could always pop the SD out and boot via the HD).

I installed Karmic to the USB (/dev/sdb1) and configured GRUB to allow me to choose the OS that I wanted at boot time.  Well, the experience with Karmic has been ECSTATIC ENLIGHTENMENT, and now I want to but both feet in the boat and "close the Windows" for good.  That's a big step for this old dinosaur!  :-)

Something I've learned during the process is that now the SD MUST be in the laptop in order for it to boot.  If I have the SD out, the BIOS boots and when it hands off to GRUB, GRUB cannot be found and the boot halts.  This is understandable because the Karmic install is on the SD.

I've also found that when running Karmic, it likes to read from the SD a lot and that the SD is now a performance bottleneck compared to the solid state hard drive that Vista (/dev/sda2) sits on.  I'm ready to take the leap of faith.  Ideally, I'd like to take the Karmic installation (and other packages installed) and "copy" the whole thing onto the the solid state hard drive.  I know that I will have to modify GRUB if it is even possible to just "copy" the install over to the solid state hard drive.

Alas, I've searched high and low in the forums and on the internet for any kind of wisdom that some bodhisattva may have on my quest. 

And so I put my call for enlightenment out to you, the community of "Illuminati Cognoscenti", in hopes that you might feel merciful and grace this unworthy convert with any guidance or wisdom.

Me ka mahalo palena'ole (With my unbounded gratitude) for your consideration of my ha'aha'a (humble) request!

Aloha and Be Well!


Views: 220

Reply to This

Replies to This Discussion

Since /dev/sda is considered "throw-away", you could clone the Karmic 16Gig device onto the SSD:

dd if=/dev/sdb of=/dev/sda

and maybe add bs=4M to the above dd command to have it copy in 4-megabyte blocks (versus 512 K blocks) to speed up the process.

After that, you should be able reboot without the Karmic SD card inside, and the Grub copy on the SSD will hopefully be able to figure out your install's root device (hd0,0) and do the right thing. If not, you may need to drop into the Grub Shell and tweak some options.

Assuming all of that went well, all you need to do is get a bootable copy of GParted (either CDrom or Bootable Flash Image). This will let you grow the Linux partition from 16GB to the full capacity of the SSD drive.

If any part of the above fails, you should still be able to boot and run your original Karmic installation by reinserting the SD card and booting from that, so it's reasonably safe to experiment a bit and play around.

Please note that the above totally wipes out the SSD and replaces it with Linux -- you will lose Vista, and the contents of /dev/sda1 (which is likely either a Vista Boot partition, or a sytem-recovery partition for Vista). There's no turning back if you need anything in the Vista Partition, so back up anything you want to keep before doing this.

Good luck!

Laurence A. Lee
Aloha e Laurence!

Thanks for sharing of your experience and wisdom!

For clarification, the ideal solution for this situation would be to NOT destroy the Vista installation that is already on SSD, but instead to "copy" what is on /dev/sdb onto /dev/sda. Then upon boot GRUB will still permit a dual boot to either Karmic or Vista.

Although my heart's purpose is to exist in Open Source, a reality exists that there may be a need to descend into Vista for some unforeseen purpose for a period of time after this "migration" is complete.

Off topic, but relevant to an expression of my "faith" is my intention to use VirtualBox for future "Windows" into alternative realities.

Aloha and Be Well!

You're going to be in for a loooong day. :o)

Assuming the Vista install consumed the entire SSD, you'll need to get a bootable copy of GParted (or similar partition management tool), boot from it, and shrink your Vista Partition to make some room for Karmic on the SSD.

After that, you should have /dev/sda1 (Vista Boot/Recovery), and /dev/sda2 (Vista Data), and empty space at the tail-end of the SSD.

From there, I'd consider just using the Karmic installer for a fresh install and tell it to install onto /dev/sda -- but being VERY careful to ensure the installer doesn't clobber /dev/sda1 and /dev/sda2 . I'm more of a Fedora Linux guy, so I don't know the exact details for Ubuntu.. but there's probably an "Advanced Installation" option you can select to get at the fine-tuning details. Using the installer will take care of setting up Grub, the Linux Partition, and -- the biggest source of your grief -- the Linux Swap Partition.

Non-Installer Alternative
If you don't trust the installer (and I wouldn't blame you), you're going to need to boot into the Karmic SD, and do some low-level Partitioning work in fdisk, some Logical Volume Management work in lvm to create a new Volume Group and Logical Volume -- using names different from those used in your Karmic Install -- and then copy the filesystem contents from the running Karmic install to the newly defined Volume.

All of that is yak-shaving to uniquely name your cloned Karmic root partition, which you'd then pass into Grub: make a duplicate entry in /boot/grub.conf, and just change the root= parameter to the Volume you constructed and cloned by hand.

You'll also want to create a logical volume or a partition for Linux Swap.

Considering how much effort all of the above is, I'd say it's better to have the Installer handle such small details, and just find a way to tell the installer to preserve /dev/sda1 and /dev/sda2... ;-)

Good luck, and I hope this points you in the right direction!

Laurence A. Lee
Ahhh! Kind Laurence!

You have given this convert valuable and valued wisdom! I now have a direction as I embark upon an odyssey of discovery upon which I might earn valuable scar tissue!

I will share with you the outcome and lessons which I may learn upon the way. :-)

Mahalo! And "A techHui Hou!" for now!

All hail “Lawrence The Omniscient”!

Lawrence The Omniscient of his infinitely benevolent beneficence has graced me with his wisdom, and because of this, my odyssey has been fruitful beyond measure.

So, as promised here is my tale.

I start with a Thinkpad X200S with a 128Gb solid state drive with OEM installed Vista. I have had this handy tool for over a year and it is loaded to the gills with valuable hardware, tools and data. The X200S should have been a screamer right from the start, and for a while it was. But, after many months of usage it became apparent to me that my Vista was of one of painful misery in slow motion. Friends and colleagues laughed and made mirth at my misfortune as they enjoyed the sweetness of the Fruit of The Forbidden Tree or frolicked merrily with cute black and white oily sea birds. I was but a scullery hand stuck “cleaning the Windows”.

And then my fortune turned and a good soul unloaded his virus ridden, worm eaten, ancient boat anchor of a Sony Vaio PCG-K35 onto me that I might be tortured in even the simple attempt to dispose of this toxic relic. I slogged the Vaio and its bambucha AC adapter home, and after making sure that it had no network connectivity whatsoever...tempted fate by plugging it in and booting it up.

All manner of horrors existed on this Pandora's Box of which I dare not even speak of!

Out of boredom and a desire to “learn something new”, I downloaded and created an Ubuntu Linux 9.10 “Karmic Koala” bootable CD, and annihilated all vestiges of scourge on that damned Vaio. And it was reborn. Pure. Innocent. And Fast! The install was as smooth as the haupia in Leonard's squishy kine malasadas. After first boot and connection to the network, it was aware of itself and capable of utilizing all of its physical constitution.

I was impressed, and at the same time curiously hopeful that I might have a life free of “cleaning Windows” in the world of Open Source. The thought of I was curious despite the rumors about what curiosity did to that famed cat.

A wise explorer of unknown frontiers will carefully consider what really is needed on the journey and will also always backup that which is precious and priceless, lest it be lost forever during mishap. I did not want to slog unnecessary baggage through my journey, so I made sure that I got rid of any data or programs that I knew that I wouldn't need in the future. Just like when I moved to Hawaii, I “de-stuffed” my hard drive. Then, I used “Clonezilla” and a 1.5TB external USB drive. I made backup images of both the SSD and the bootable SD. That done, it was off to bed. Adventure would await in the morning.

The day began early, before dawn, with my usual raw oatmeal, almonds, dried fruit, soymilk, and coffee. I placed the sacred Ubuntu 9.10 Karmic CD in the reader and pressed the power button. The OS from the CD loaded and I allowed it to load the full GNOME environment. I would run the installation from there. The installation began and appeared to run fine. The partitioning is where I ran into my first obstacle. Although Ubuntu recognized that there was Vista on the /dev/sda, and although it attempted to modify the partition table to allow Ubuntu to install in free space outside the partition, the operation failed. Subsequent attempts to install would require formatting. Not the ideal option for the optimal solution. I also faced the reality that I was not going to be able to preserve the Ubuntu install on the SD in a dual boot capacity. I reasoned that this first instance was really a learning instance, and why carry over any and all mistakes that I made into a “production” install. So, I decided upon a fresh Ubuntu / Vista dual boot configuration. The Idea: Restore a Vista generated MBR, then try the install again. After consulting with the oracle known as Google, I found that there were several ways for me to attempt the idea. The most promising was to use EasyBCD, as I did not have a Vista DVD with me on my journey. This did the trick. It was painless. And after removing the SD that I was using to boot my Thinkpad during my dual-boot curiosity phase, the laptop booted directly off the SSD and into Vista.

Now it was time to try the Ubuntu installation again. Worked like a charm! Painless.

Now, I could add any applications that I knew I did want, and bypass any that I knew that I didn't want or need during my curiosity phase. The price and gnashing of teeth of trying to carry over the install from the SD, was not worth the price of installing applications clean. That was my chosen tradeoff to what I originally thought would be an ideal solution. The ancient was preserved, bridges were built (not burned), and a new, fresh way lays before me.

As Lawrence the Omniscient noted in his most prescient way, “You're going to be in for a loooong day. :o) “ He was right. However, it has all been worth it in both the value of the journey and the destination. I now frolic with the oily birds. But, instead of laughing or making mirth at others who are still looking at the world through dirty Windows, I will share with them the story of how this tortured soul found his enlightenment in the universe of Open Source.

Aloha and Be Well!

Welcome fellow convert!

Reply to Discussion



web design, web development, localization

© 2024   Created by Daniel Leuck.   Powered by

Badges  |  Report an Issue  |  Terms of Service