Moving 11.10 complete system to a new bigger Harddisk

478

Solution 1

Use clonezilla.

It will allow you to clone your current system including the mbr without actually copying unused space that dd does hence doing it faster

Since its reading / writing on a filesystem level you can only use it on a supported filesystem, on the contrary to dd, which works on a device level, allowing the copy of any filesystem.

Clonezilla's front page has a list of the software's limitations:

  • The destination partition must be equal or larger than the source one.
  • Differential/incremental backup is not implemented yet.
  • Online imaging/cloning is not implemented yet. The partition to be imaged or cloned has to be unmounted.
  • Software RAID/fake RAID/firmware RAID is not supported by default. It can be done manually only.
  • Due to the image format limitation, the image cannot be explored or mounted. You can not recovery single file from the image. However, you still have workaround to make it, read this.
  • Recovery Clonezilla live with multiple CDs or DVDs is not implemented yet. Now all the files have to be in one CD or DVD if you choose to create the recovery iso file.

Solution 2

I'd use Gparted.

  1. start from your Gparted LiveCD or LiveUSB (using Lily)
  2. Plug in both of your HD (old and new one)
  3. select partitions on the old disk and "COPY" it on the new disk
  4. Resize partitions on your new disk according to your willing
  5. Start from Ubuntu liveCD/liveUSB
  6. Use blkid to check the UUID of the partitions on the new disk
  7. Edit your /etc/fstab located on your new disk according to your UUID
  8. Open a terminal (Ctrl + Alt + T) in order to re-install Grub on your new disk.

    fdisk -l
    

    fdisk to Check the name of the Ubuntu partition on your new disk. In my case, it's sda1 so let's continue by mounting this partition :

    mount /dev/sda1 /mnt
    

    Finally, let's re-install Grub in your new disk sda :

    grub-install --boot-directory=/mnt /dev/sda
    
  9. Shut down and re-start from your new disk !

[EDIT] Thanks to tomodachi, I edited my answer to reflect his advices :

  • No need to edit the fstab on the new HD because Gparted is supposed to copy the partition as well as its UUID

  • I added some extra steps to make your new HD bootable.

maybe there are simpler methods ?

Share:
478

Related videos on Youtube

Lukas Hamrla
Author by

Lukas Hamrla

Updated on September 18, 2022

Comments

  • Lukas Hamrla
    Lukas Hamrla over 1 year

    I'm reading with my c++ program csv file:

    abc;def;ghi
    
    10;;10
    

    by this code:

        while(getline(in, str, '\n')){
          stringstream ss;
          while(getline(ss, str, ';')){
             line.add(str);
          }
        }
    

    Where in is input file, str is string variable and line is my collection (like vector). But getline jumped over the empty string in csv file.

    Can anyone help me to reading empty string, too?

    Thanks :)

    • pl1nk
      pl1nk almost 12 years
      @James It's not a duplicate, in the question that you mentioned the OP doesn't want to re-install everything. I'm open to suggestions and prefer answers that depict advantages/disadvantages of any given approach.
    • artahian
      artahian about 11 years
      How do you know that it jumped? Anyway it will not enter second loop when the line is empty.
    • Lukas Hamrla
      Lukas Hamrla about 11 years
      aram90: i have temp variable that counts numbers of reading and also in my list there is only 2 strings.
  • jasonwert
    jasonwert almost 12 years
    Will Clonezilla bring over grub & the MBR also?
  • Samik
    Samik almost 12 years
    @jasonwert here you can see how to include MBR and GRUB while disk copying, but while copying partition MBR won't be included as it's not a part of a partition.
  • tomodachi
    tomodachi almost 12 years
    @jasonwert yes it will clone the mbr. I've added it to the response. Thanks for the feedback!
  • jasonwert
    jasonwert almost 12 years
    This worked great. I moved my root partition to an SSD two days ago using clonezilla. I used boot-repair from a live cd to setup grub. Thanks!
  • pl1nk
    pl1nk almost 12 years
    It works like a charm! Do you know how can I enlarge my partitions to use the available space --or should I make a new question?
  • Lukas Hamrla
    Lukas Hamrla about 11 years
    I've initialized it before by this: ifstream in ( inFileName ); if (in.fail()) return false; It's ok. But compiler doesnt like your code :( error: no matching function for call to ‘std::basic_istringstream<char>::basic_istringstream(std::if‌​stream)'
  • Kerrek SB
    Kerrek SB about 11 years
    You seem to be doing something completely different. There is no ifstream in my code at all. Are you misspelling ln as in? Let me rename the variables.
  • Kerrek SB
    Kerrek SB about 11 years
    @LukasHamrla: I find that hard to believe. The code does exactly what it should.
  • Serge Stroobandt
    Serge Stroobandt over 7 years
    The option -t ext3 is outdated and can be left out. The option --root-directory=/mnt should read --boot-directory=/mnt, according to man grub-install.