3

I have a server, with a single hard disk (500GB Ubuntu OS 14.04), and I bought a new one having 1 SSD (250GB, which I thought I could use for the OS) and 2 normal SATA disk (2000GB, to use in RAID).

Now, I'd want to restore the content of the first server on the second. The ideal situation for the second is having the OS on the SSD and the data/applications on one SATA, so to use the RAID to backup. (right?)

Using clonezilla I can save an image of the first server and restore on one SATA of the second (SSD is too small), then, hopefully, activate RAID and see what happens, but in this way the SSD power is unused.

There is a software I don't know about, that can manage this situation? What is the best way to deal with this, excluding, obviously, reinstalling OS and then all the content and settings of the first server?

EDIT: Using @s1lv3r reply like the bible resulted in all working in the end, but I had also to deal with a couple of things:

  • The cloned ssd had the same uuid of the spinning disk so I had to change it with 'tune2fs -U random /dev/your_sd_id'

  • grub did not react well to the whole process so I had to launch a live version of linux and repair it with a tool named 'boot-repair'.

  • I have a nvidia card on the new server so, in order to make system start, I had to make it start with 'nomodeset' instead of 'quiet splash' (In grub menu choose your starting system option, press 'e' and change it) then manually install nvidia driver.

Truly, solving these things took a lot of time and tests, but these general indications could make the difference for someone trying to solve them.

4 Answers4

4

Important things first; you seem to have a misconception about RAID. RAID is no backup, what ever disk layout you end up choosing, you'll need to make external backups of your data if you care for it.

If you plan on using the SSD (or any non RAID disk for this matter), you'll have to be aware, that even if the SSD only contains the operating system and no data, a failure of this SSD will result in your server beeing completely down until you fix this. I'm not saying that you shouldn't do so, but you should be aware of this. If uptime is really important for you, you would be better off only using the spinning disks in a mirrored setup.

If you want to go on with your plan (single SSD for system, RAID1 spinning disks for data) I would suggest the following steps for a safe migration process:

  1. Clone the image of the 500G disk to one of the 2000GB disks.
  2. Mount the 2000GB disk from a Live-CD, clean the 500G partition on it (delete the data you won't need on the system disk) and defragment it.
  3. Use Clonezilla to rezize the 500G partition on the above mentioned 2000G disk to 250G (this is a critical step which may destroy the data if you are really unlucky, but while this is very unlikely, if this happens you'll still have the original 500G disk in place - so you don't have to worry).
  4. Clone the resulting 250G partition to the SSD.
  5. If everything worked out and the new system boots from the SSD you can create the RAID for the spinning disks and copy the files for the data partition from the original 500G disk to the newly setup RAID device.
s1lv3r
  • 1,155
3

You can try installing the same OS to the new server and using rsync to migrate all data.

rsync -avzAXS --numeric-ids --progress --exclude={lib/modules,etc/udev,lib/udev,boot,dev,proc,sys,run,etc/fstab,etc/inittab,tmp,var/tmp} --exclude={home/virtfs,backup} -e ssh . XX.XX.XX.XX:/

To ensure successful migration, you can try doing this either from rescue CD, or with putting your fs in readonly.

2

In case you have several partitions on 500 drive (/sda1 as /, /sda2 as home, /sda3 /var etc.) try run clonezilla to create and save drive using separate image file for each partition. Therefore, when you would try to restore, you could restore ubuntu OS root onto SSD and let say /home onto RAID.

1

Warning! before you do anything! When you want to use clonezilla or any other tool what process the data from A disk to B disk. You should resize partitions of your A disk (500GB HDD) to maximal size of your B disk (250 GB SSD). Be aware of your partition table cos simple clonning will clone all your data (blocks) to blocks what do not exist on disc B (250GB SSD).

You should do complete defragmentation, resize the partitions to maximum size of you disc B (250GB , in disc A [500GB] an size of 250GB should be free and non-partitioned). After repartition it is recommend to make 2nd defragmentation to avoid data loos and problems.