Categories:


- System -

- Internet -

- Video -

- Audio -

- Pictures -

- Other -


HOW TO install Ubuntu - complete guide

List of everyday used applications (in process)








HOW TO move your system partition to larger (or equal) partition on new hard drive



This is a tutorial that explains in detail how to move your system to new larger disk. In short, you have to boot to Ubuntu live CD, then using gparted prepare your new HDD by creating the partition of the same size of old system partition and leaving extra free space before creating any new partitions. Then backup partition using partimage, restore it to system partition on new HDD, fix grub, and then resize the new system partition to desired value.


Here is the explanation in details. Connect both hard drives and boot from Ubuntu Live CD. Then you need to enable universe/multiverse repositories. When this is done open terminal (Alt+F2 then type gnome-terminal) and type:

sudo apt-get install gparted partimage

and when this is done type:

sudo gparted

Find your hard drive where your old system partition is located.



Find the system partition (in this case and further text /dev/sdc1, replace this with your system partition location), click on it and then on resize, and copy the current size of partition



Now find your new hard drive



Add the new partition of type ext3 and for the size paste the size of the old system partition



Create the new partition of type swap, and if you want your new system partition to be larger leave some free space before the swap partition (here I leave 14000MB)



Remaining space format in ext3 type so you get one more partition for your music, videos, documents and similar



After that you should have something like on the next picture



If so press apply



In our case and further text new system partition on new disk is /dev/sdb1, and new partition for documents is /dev/sdb3, again in your case this can be something different so if you had /dev/sdc3 instead where I had /dev/sdb3 write /dev/sdc3 where I say to write /dev/sdb3 :)

Now close gparted. Again open terminal and navigate to desktop and create new folder

mkdir newdisk

Mount partition for documents on your new disk to the newdisk folder (in our case partition to mount is /dev/sdb3)

mount /dev/sdb3 newdisk

Navigate to new partition, create new folder, and add write options to it

cd newdisk
mkdir systemimage
chmod 777 systemimage

We need to unmount (if mounted) old system partition (/dev/sdc1 in our case) before we can proceed

sudo umount /dev/sdc1




Next, we need to create a backup image of old system partition. In terminal type:

sudo partimage

Select old system partiton (our case /dev/sdc1) and write the full path to where you will save the image file. Here we we'll save it to the documents partition mounted to newdisk folder at desktop



To continue press F5, and on next screen select none compression and automatic split



To continue again press F5, enter description, and say OK to all



Partimage will now exit but we need to start it again so again type

sudo partimage

Copy newly created image to prepared partition on new hard drive (/dev/sdb1), choose restore not backup, and write full path to the image



F5 to continue



Again F5 to continue and say Yes and OK to all



We're almost finished, but we can't boot from the new hard drive yet. To fix this we need to fix GRUB. Open terminal and type

sudo grub

Now type

find /boot/grub/stage1

This should give two output of type (hdX,Y). It's not so hard to figure out what output we need. For example, if our new partition image is /dev/sda1 we will need output of type (hd0,0), if it's /dev/sdb2 we need (hd1,1). Since our new partition is /dev/sdb1 output we need is (hd1,0). Next type (row at a time)

root (hd0,1)
setup (hd1)




Now type

quit

To exit grub. Only thing we need to do now is resize or new system partition.

Here I was forgetfull and forgot to resize the partition before I taken out old hard drive out of my computer. As consequence my new hard drive will be shown as /dev/sda and hence system partition on it will be /dev/sda1. Except that nothing has changed so we can continue to resize the partition to bigger size.

In terminal type

sudo gparted

Select your new harddrive (it's now /dev/sda instead of /dev/sdb)



Select the system partition, click on resize, stretch it to maximum size, click on resize and then apply (see pictures below)



Close gparted. Before you proceed you might want to increase available size of your new documents partition . After you've done that reboot your computer, and boot from your new hard drive.




You can leave a comment at the homepage.



SEARCH



  • Ubuntu official

  • Ubuntuguide, helps you start using Ubuntu

  • Order latest Ubuntu cd at your doorstep, for FREE


  • If you have problems installing programs with 'apt-get' or 'aptitude' be sure you have enabled universe repositories.
    Click here to see how to enable them.