Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a server with an old arch linux.
We want to switch it to a different linux (CentOS or Ubuntu)

The thing is, people are using it. Do I have an option to fast change it without buying a new machine?
(I thought about something like preparing a VM in advance and then just switch to it permanently - but I'm not sure how...)

share|improve this question
    
What options you have is dependent on so many things you don't tell us that it is impossible to say anything useful here. What hardware do you use? Do you have budget for new one? Do you use any kind of virtualization right now? How much downtime could you afford? What kind of services does the server offer? etc.etc.etc. –  Sven Oct 23 '12 at 11:19
    
Well - it is not a killer server (small company) but there is no need for a new one. Currently with no virtualization - arch linux installed. We can take a down time of a few hours, but no time for complete ubuntu installation (and configuration and installation of some centralized software we have) My question is rather general because I don't need sophisticated solution... Hope it sheds some light on the subject –  Boaz Oct 23 '12 at 11:55

1 Answer 1

up vote 0 down vote accepted

Your VM idea is a good one. The process would be:

On a desktop machine, create image:

  1. Create a new virtual disk image to the same size as the server's disk
  2. Boot your VM and install your OS and software
  3. Reboot your VM but use a rescue disk (Ubuntu installer, for example) and don't mount the filesystems
  4. Plug in a USB hard disk with image on it
  5. Mount the the USB disk on /mnt
  6. Assuming the vm disk is sda run: dd if=/dev/sda of=/mnt/mysda.img bs=1M

Install image:

  1. Backup server
  2. Boot server from rescue disk/USB key
  3. Plug in a USB hard disk which is bigger than the virtual disk size
  4. Mount the the USB disk on /mnt
  5. dd if=/mnt/mysda.img of=/dev/sda bs=1M
share|improve this answer
    
and after step 5 in the install, the server will still be a VM or it will be a "real" ubuntu? –  Boaz Oct 23 '12 at 12:34
    
@Boaz it will be a real Ubuntu box. Make sure you use the same architecture (32/64bit) as your server when building your VM. You should definitely test this process on another box first! –  Alastair McCormack Oct 23 '12 at 12:45

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.