Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I currently have Ubuntu 10.04 server running on portable hdd. Want to move it to internal sata hdd. I've got 3 partitions /, /home and swap. On new hdd I plan to have different partition sizes. What's correct way of doing these 2 things(move,resize)?

share|improve this question
    
it would be useful if you let us know the sizes of origin/destination hard disk drives in order to have a better scenery of your situation, thus lead you to a better reference. –  Geppettvs D'Constanzo Feb 22 '12 at 17:02
    
Did you use the Clonezilla method in the end, I assume? How did it work? –  invert Apr 26 '12 at 12:09
    
@Wesley: I successfully transferred ubuntu installation from USB stick to HDD using clonezilla. However, the tricky part was to remove checkmark of reinstalling grub. With that checkmark I had lot of troubles. Not sure why by default that checkmark is on. –  Pablo Apr 26 '12 at 12:55

4 Answers 4

up vote 4 down vote accepted

Clonezilla may be useful for cloning your hard disk, even for those situations on which you need to do it with different size disks as mentioned here: http://www.tuxradar.com/content/how-clone-hard-drives-clonezilla

enter image description here

Moving to a bigger disk

It's easy to ensure that a clone of a SCSI disk is restored to a SCSI disk, but you'll have a tough time finding an exact replica size-wise. The good news is you don't have to restore a disk on another disk of the same size. The even better news is that you can in fact restore the image to a much larger disk.

When restoring a disk, Clonezilla enables you to resize the filesystem and create partitions on the new disk proportionally. But even if you are moving to a bigger disk, you might prefer to keep the partitions as they are. In that case you can ask Clonezilla to create the partition table as its listed in the image.

There is documentation about moving to a larger disk as mentioned here but I am not sure that you can do it the opposite (cloning to a smaller disk).

However, it's worth to try. Clonezilla offers several Live CD's and bootable USB images and there is also documented that you can resize the free space on the disk after the copy, in which case the suggestion by @maniat1k to use gparted is also a good idea.

If you use clonezilla, I would appreciate if you drop comments with your experiences over here in order to have well documented how does this work for future reference.

Thank you a lot and Good luck!

share|improve this answer

with an live cd open a terminal as root (sudo -i) and use dd.

example: dd if=origin of=destination.

you can do a copy from one hdd to another like this

dd if=/dev/sdx of=/dev/sdy

with the same live-cd you can use gparted and resize what you want.

share|improve this answer
1  
I have used this method to make a clone of a hard drive, It works great but the destination HDD needs to be at least as big as the origin and it is slow and has no progress meter. –  C.S.Cameron Feb 22 '12 at 15:59
    
that's true, I assumed that the disks are the same size. –  maniat1k Feb 22 '12 at 16:01
2  
Specify a larger dd block size to improve speed, dependant on your disk cache, but bs=4M is a good value. You can print dd status by sending it the SIGUSR1 signal, see prefetch.net/blog/index.php/2006/06/11/printing-dd-status –  invert Apr 26 '12 at 12:07

If I understand you correctly, you want to move your current installation of Ubuntu to a new disk of 300 GB. yes this can be done, but it's much easier to make a fresh install, and a lot faster. if you make a fresh install on the larger disk and then just move your files to the larger disk.

share|improve this answer
    
Your answer is contradictory of itself? Please edit –  Ringtail Mar 26 '12 at 16:47
    
if there any way to backup my programs and restore in new ubuntu? –  geoh Mar 26 '12 at 17:04
    
If you want a list of installed programs to reinstall in the new installation, check the answer of Ajenbo on the question askubuntu.com/questions/3659 –  Pipe Mar 26 '12 at 17:16
    
+1 This is the easiest way I know, even though it requires reinstallation. For backing up programs, you might try using apt-clone (manpages.ubuntu.com/manpages/precise/en/man8/apt-clone.8.html). –  zpletan Mar 26 '12 at 17:16
    
@BlueXrider what do you mean? –  Alvar Mar 26 '12 at 17:59
  1. Time consuming and perfect copy, with the bits in the same order on the disk is made with the unix command dd. Boot off your CD and open Disk Utility (palimpsest). Identify the device IDs of the two hard drives, for instance /dev/sda (the old hard drive) and /dev/sdb (the new one). Next, copy directly with the command dd if=/dev/sda of=/dev/sdb in this case. That step will take days even if the disk is not full. Lastly, open up Disk Utility (palimpsest) again and expand the partition to cover the whole 300GB drive and update grub.
  2. Another way would be to do a complete install on the other drive and then copy over your home folder.
  3. Also, you could simply take a directory and move its contents to the other drive and place a symbolic link from one drive to the other to save space - I do this for my ~/.wine folder on my Ubuntu-running desktop.

Just putting in the new drive and copying over all the files by themselves will not work because the disk will not be listed in GRUB and the partition is not set as bootable.

share|improve this answer
    
i think it esear to reinstall ubuntu –  geoh Mar 26 '12 at 17:21
    
It may well be, but I wanted to present all options. –  Andrew Mar 26 '12 at 17:30
    
I recently used dd on a 160GB disk and it took roughly 2h... It is not difficult to do (only looking for disk names, booting with live CD and issuing 1 command - expanding the partition after is optional) but don't mix the command parameters or you will have 2 blank disks! –  laurent Mar 26 '12 at 19:35
2  
Obs: I think the numbers of days to dd a disk are old. SATA disk are a lot faster now. –  laurent Mar 26 '12 at 19:40
    
Thanks. I was using IDE most recently :'( . –  Andrew Mar 27 '12 at 0:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.