Ubuntu Notes and How-Tos

Sunday, August 21, 2005

Moving my Ubuntu Hoary to another partition without reinstalling


/dev/hda1 was where My Windows XP Home resided. After weeks of waiting for that one reason why I shouldn't wipe it out and go Ubuntu all the way, I didn't find any. So tonight I made that final decision --no more Windows (dual-booting).


/dev/hda3 was where my Ubuntu was temporarily and happily serving. Now is the time for it to be moved to its rightful place.


As usual, I googled first and took me to linuxquestions.org. One thread looked promising. It was a question about how to move his Mandriva to another drive. After reading the whole posting, I decided to try the solution given by kilgoretrout; it worked without a hitch. Thanks dude, you da man!


So here's a play-by-play account of how I did it.But first, a backgrounder. I had a bunch of Live CDs in my arsenal including Knoppix but I opted for sysrescd. Remember, I wanted to move my Ubuntu which was in /dev/hda3 to /dev/hda1 (which was then occupied by WIndows XP Home); but the rest of the partitions are left intact such as the swap, the /home, etc. So now I proceed to where just after sysrescd gave me the root prompt (after I booted my laptop using CD-ROM, of course):



  1. # mkdir /mnt/x

  2. # mkdir /mnt/x/{orig,new}

  3. # mount -t ext3 /dev/hda3 /mnt/x/orig

  4. # mount -t ext3 /dev/hda1 /mnt/x/new

  5. # cd /mnt/x/orig

  6. # tar -cf - . | (cd /mnt/x/new; tar -xvf -)

  7. Waited for a few minutes, and then...

  8. I edited /mnt/x/new/etc/fstab to reflect the new reality --really minor changes

  9. And then I edited /mnt/x/new/boot/grub/menu.lst --again, to reflect the new reality

  10. # reboot



I crossed my fingers, expecting for the worst. First came the Debian3 splash screen (from Splashy), then the gdm, and after logging in, came the familiar login sound, and finally my desktop. Mission accomplished. Bye bye Windows.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home