I have a dedicated server that I cannot access anymore, for some reason, after a reboot. It refuses SSH connections. The machine had otherwise been running for a month without issues, and multiple reboots occurred meanwhile.

What I can do is restart it in rescue mode and SSH into it this way, at which point I can mount the hard drives (currently in SW RAID 1).

I would like to reinstall Ubuntu (14.04 as it is now, or possibly 16.04, no difference), while in rescue mode, and keeping the home folder intact. There is a lot of data in the home folder, making it a little difficult to backup. Losing this data would not be a big deal, but not losing it would be preferrable.

I have found this guide for installation over SSH: https://help.ubuntu.com/community/Installation/OverSSH but it is unclear to me how to keep the home folder and avoid deleting it.

Ideally, I would like to have the same partition scheme as now, with all partitions except 'home' formatted. I seem to have found only guides to either install via SSH, or to install keeping home partition intact, but not both.

Any help is appreciated.


  • You could also mount an Ubuntu LiveCD ISO to boot into and just install overtop of your existing OS, but you'll need enough free space to put the ISO on your drive (~1.3gb). The ISO is mounted to its own partition and added to the grub menu, so it's like booting from a CD/USB, except it's a partition. See the secton "Live Ubuntu Desktop from Hard Drive" here : help.ubuntu.com/community/Installation/FromLinux
    – Delorean
    Jun 29 '16 at 16:22
  • If you truly have no physical access to the machine, you may want to look into preseeding. Or, follow the instruction in the link you posted, but skip the mke2fs -j /dev/hda1 part, since you already have partitions. Installation should overwrite your current OS but not delete anything. Just make sure you pick all the same mount points, same username and same password.
    – Delorean
    Jun 29 '16 at 16:38
  • Right at the start of the guide in the link, it says to partition the hard disk. However what I have now is SW raid1, and fdisk -l looks like this : pastebin.com/MYUTtdPp But I'm guessing I should skip the whole partitioning section in the guide?
    – mkln
    Jun 29 '16 at 19:10
  • Right, skip the partition creation because you already have them. But you'll still have to make sure they're mounted how they're supposed to be. So if you had for example /dev/sda3 mounted to /home, make sure it's mounted the same during installation.
    – Delorean
    Jun 29 '16 at 20:15

You can use preseed and grub image boot together, I write simple solution for that. https://github.com/mhf-ir/ubuntu-overssh-reinstallation

Newer version with wizard: https://gitlab.com/aasaam/ubuntu-overssh-reinstallation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.