1

I bought a new (used) laptop with Windows 7 installed. and now I am in need to port everything I have in my previous laptop with Ubuntu on it.

I don't really need dual boot, I just want to stick with Ubuntu alone on the new machine as well.

If I use Clonezilla to clone the HDD with Ubuntu from my old laptop to an external HDD (disk to image) and then, use this image to perform a disk to disk cloning onto the new HDD with Windows, will this do the trick?

Obviously, the external and new HDD have enough space for storing what's on the old HDD. Is it a good idea to do this or would you suggest to perform a fresh Ubuntu install on the new machine and using the deja-dup application to perform a restore of files and folders, given that then I would need to reinstall all the programs I need?

If it might be of interest, my new laptop is a ThinkPad T440p.

umbe1987
  • 125

2 Answers2

1

Since you don't care about the current contents of the new laptop, there seems to be little downside to the Clonezilla aproach. It's probably faster than the install/restore approach and if it doesn't work you can always try plan b.

You may run into video driver problems if the laptops have different cards but they can be fixed in the normal manner.

Caveat: I've done many partition clones like this but I've only done a full disk clone once and it was real -> virtual.

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
  • 1
    Thanks for the answer. I accepted the other one although your was written before just because it was more detailed. Thank you anyway for the help, really appreciate it! +1 – umbe1987 May 05 '18 at 13:38
  • It's totally up to you, that's the beauty of stack exchange! Best of luck with your system migration. – Organic Marble May 05 '18 at 14:16
1

Installed Ubuntu systems are portable

I have some installed systems in external drives (USB and eSATA), and they are portable between computers. So it should work to do what you want. You can even move your current drive to the new computer (connect it internally or via an external box) and test how it works before you start cloning.

If you have installed proprietary drivers (typically for graphics and wifi), it is a good idea to uninstall them and use the built-in linux drivers, when you clone and start using the system in the new computer. Later on you may or may not install suitable proprietary drivers depending on the hardware.

Cloning works

  • if the target drive is at least as big as the source disk (not one single byte smaller, it is not enough, that the nominal sizes are the same), and

  • if the physical sector size in the target drive is the same as in the source drive. (I am not talking about the intermediate drive, where you store the Clonezilla image.)

    You can check the physical sector sizes with

    sudo parted -ls
    

    The classic physical sector size is 512 bytes, and some new drives have 4096 byte size.

    Even if it might work if you clone anyway, there will be performance issues, so you should really avoid it.

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • Great answer! I'll check the "physical sector size". Do you know how can I fo it on the windows 7 machine? One last thing: if I'll add an SSD later and want to move the OS part on it, will it be super hard? Just "yes" or "no" is ok as answer, as I know I should search/ask this separately :P – umbe1987 May 05 '18 at 13:23
  • Also, I knew I had to consider the graphics driver thing. I actually have installed proprietary driver for NVIDIA. Do you know which is the best way to uninstall them or (better) is it ok to do that after cloning? Thanks again! – umbe1987 May 05 '18 at 13:26
  • 1
  • You can boot the windows machine from a USB pendrive with Ubuntu (and run it live 'Try Ubuntu') and run sudo parted -ls from there; 2. No, I think you can split the system by moving your /home directory to a separate 'home' partition (and add a line for it in /etc/fstab) or use a separate 'data' partition for your personal data; 3. I would remove the nvidia driver before (and use the boot option nomodeset to get the old computer going with simpler graphics).
  • – sudodus May 05 '18 at 13:31
  • @umbe1987, You are welcome and good luck :-) – sudodus May 05 '18 at 13:37
  • 1
    Just for the sake of knowledge: to see the phtsical sector size in Windows 7 open a command prompt as admin, type fsutil fsinfo ntfsinfo c: and search for Bytes Per Sector. Mine was 512 fortunately! Source: this SO answer – umbe1987 May 05 '18 at 13:46
  • 2
    For your future reference, this wiki is how to move your home to it's own partition. I did this a couple of times once I learned the advantages, now I set up all systems with a separate home partition. https://help.ubuntu.com/community/Partitioning/Home/Moving – Organic Marble May 05 '18 at 14:19
  • @umbe1987, does fsutil say if it is logical or physical sector size? – sudodus May 05 '18 at 14:54
  • @sudodus strangely, differently from the SO answer whose link I provided in the above comment, my cmd output is a bit different and doesn't specify if it is "logical" or "physical" sector. What I see is just Bytes Per Sector which is equal to 512. Then I also have Bytes Per Cluster (4096) and Bytes Per FileRecord Segment (1024). Nothing that reads "physical" really... – umbe1987 May 05 '18 at 15:01
  • Can you boot the windows machine from a USB pendrive with Ubuntu (and run it live 'Try Ubuntu') and run sudo parted -ls from there? That way you know, that you are comparing apples with apples (and not pears) ;-) – sudodus May 05 '18 at 15:06
  • Yeah, I definitely should do this before cloning. Guess what: my laptop gets so warm during device to image process with Clonezilla that it shuts down... Tomorrow I will try with an external fan pointing at my laptop at maximum power. Do you have better suggestions? Grrrrrrrr!!!!..... – umbe1987 May 05 '18 at 22:11
  • 1
  • Put the laptop on some sticks (for example pencils or maybe thicker) and make the fan blow so that cool air will pass also under the laptop (between the table and the laptop); 2. The CPU will be less busy if you clone directly to the target drive. Creating an image needs a lot of computing power because of the compression; 3. Connecting the target drive via USB 2 will make the process slower (than via USB 3), which should also decrease the load on the CPU (but I hope this step is not necessary).
  • – sudodus May 05 '18 at 22:53
  • The HDD in the new laptop has physical sector size 4096. Just checked with Ubuntu on a usb and the parted -ls command. So I guess I am left with just the option of doing a fresh ubuntu install, restoring with dejadup and reinstalling the programs. The option to directly replace the HDD from old to new is not good for me 'cause I still use the old laptop. Good to know though. Really appreciated all the suggestions and comments, you were super helpful, for real! Cheers. – umbe1987 May 06 '18 at 07:37
  • @umbe1987, Yes, it seems you are left with just the option of doing a fresh ubuntu install, restoring with dejadup and reinstalling the programs. But that can be a good alternative. You get rid of old junk, that you are no longer using, and will install only the program packages, that you really need :-) – sudodus May 06 '18 at 10:19
  • Wow, DejaDup did a mess... The restore function failed after a while and now I have the home folder restored only partially. I've been reading some discussion on how to restore the rest manually, but I think I'm gonna drop DejaDup, backup everything again, reinstall Ubuntu and restore with a different software. What do you think about backintime? I read about it in this discussion where they are litterally destroying DeajDup (wish I knew it before...). – umbe1987 May 07 '18 at 15:43
  • I don't know backintime. I do my backups with sudo rsync -Havn source/ target (which is a command line method). You can use sudo tar too. sudo is used to manage also files/directories where your user might not have permissions. – sudodus May 07 '18 at 15:50