Backup - Moving Entire Linux Installation To Another Drive - Ask Ubuntu
Backup - Moving Entire Linux Installation To Another Drive - Ask Ubuntu
Ubuntu Community Ask! Developer Design Hardware Insights Juju Shop More
sign up log in tour help
_
Ask Ubuntu is a question and answer Here's how it works:
site for Ubuntu users and developers.
Join them; it only takes a minute:
Sign up
Anybody can ask Anybody can The best answers are voted
a question answer up and rise to the top
I have Ubuntu 14.04 with a lot of packages and work related stuff that I am very happy with it. It is installed on my main SSD drive which is a
120GB one (I had choosen "/" when I installed ubuntu, so I beleive everything should be on this drive). It shows up as /dev/sda
Now I have added another SSD to my computer which is a 240Gb. I do not have any other storage media at hand at the moment (e.g.
external hard drive).
Since the new 240GB drive has obviously more capacity and is faster (a newer generation than my 120GB one), I want to move my Linux to
this new drive. This new drive shows up as /dev/sdb and at the moment it is not formatted or anything (I have literally unpackaged and
inserted in my PC right now :P)
I can change the SATA cable so the new drive shows as /dev/sda if necessary.
backup dd
3 It sounds like you're planning to use both of them now. If so, you should consider just using the newer, bigger one as
/home instead of the entire system. It should be an easier change (just move everything over and add a single line
to /etcs/fstab), and most large files are likely to go into your home directory (and so onto the larger disk). Kevin Mar
3 '16 at 21:56
Possible duplicate of How to move Ubuntu to an SSD David Foerster Mar 14 '16 at 7:33
4 Answers
Clonezilla is a free partition and disk imaging/cloning tool which can be used to backup all your
data (whole disks or partitions) in a highly compressed way and later clone it back to your hard
disk to get it into exact same condition. This is faster than installing the OS most of the times.
https://askubuntu.com/questions/741723/moving-entire-linux-installation-to-another-drive 1/3
9/26/2017 backup - Moving entire Linux installation to another drive - Ask Ubuntu
Boot from the created Clonezilla media.
Now you have many options :
1. Create an image of only '/' (saveparts) and clone it to any partition of your other SDD.
2. Create an image of the full disk (savedisk) and clone it to your new SSD.
In your case you can use the "device-device" option too, but I am not familiar with it.
1 I suggest you watch these two tutorial videos before : youtube.com/watch?v=41tTudaQb0I and youtube.com/watch?
v=LS6VhLDw-io Severus Tux Mar 3 '16 at 19:15
This is also a good option. But I am too lazy to create the clonezilla stick ;-) Pilot6 Mar 3 '16 at 19:15
I found clonezilla didn't copy over mbr so a whole disk image and a bit of worked with gparted should do the trick
adampski Mar 4 '16 at 10:39
1 wow! glad to hear this ;-) , The boot time, It is because of changed UUIDs , i.e, The new UUIDs and Old ones of your
important partitions (home,Swap) has chamged. To correct this, please follow the instructions given here with
suitable changes : askubuntu.com/a/737340/497359 If you find any problem, please comment it. Severus Tux
Mar 4 '16 at 13:52
1 @adampski : This seems to be a bug in Clonezilla 2.4.5. As a workaround you can use Clonezilla 2.4.2 or Clonezilla
2.4.2 Server Edition (DRBL) until it is fixed. :) cl-netbox Mar 4 '16 at 14:24
It can be done in a few ways. But the easiest one is to just copy all files from the old drive to
the new one.
So all files, groups and stuff would remain intact? Saeid87 Mar 3 '16 at 18:57
@Saeid87 Forgot about fstab . Added that too. Pilot6 Mar 3 '16 at 19:03
1 +1 - it's also possible to avoid booting from a LiveUSB and do everything while booted from the original drive, do all
the changes, reboot, voila. Sergey Mar 8 '16 at 20:17
1 @tienne: Do not copy those directories (also /dev ), simply create empty dirs on the destination drive and set the
same owner/permissions on them as they had on the source drive. Sergey yesterday
https://askubuntu.com/questions/741723/moving-entire-linux-installation-to-another-drive 2/3
9/26/2017 backup - Moving entire Linux installation to another drive - Ask Ubuntu
This will basically create an image of you disk sda and write it onto sdb (same partition layout
etc.) Ofcourse this'll write the whole 120GB as it's file-agnostic. Thus very safe, but not the
fastest, if you only use small portions of the disk. However if the input disk is rather full it might
even be faster.
BUT:
After that you probably want to resize the partitions as otherwise you cannot take
advantage of the extra space.
In any case it might be needed to edit the /etc/fstab file.
This is the case if Hardware-IDs are used to recognize the disks.
2 Your dd command will run forever. Consider adding bs=1M to it Dmitry Grigoryev Mar 4 '16 at 11:07
Afaik blocksize doesn't need to be 1M on SSDs but I'll look up on this and update larkey Mar 4 '16 at 11:09
The limitation is not in the SSD technology, but in bs default value which is 512 bytes. Dmitry Grigoryev Mar 4 '16
at 11:13
1 extended answer with bs, thanks for the heads-up larkey Mar 4 '16 at 11:25
1 Thanks for detailed answer...I learned some stuff! but I decided to go with clonezilla and resize the partitions
afterwards. Saeid87 Mar 4 '16 at 12:26
https://askubuntu.com/questions/741723/moving-entire-linux-installation-to-another-drive 3/3