Rescuing your Server

This page will help you fix your Bytemark host, assuming it is running a Linux-based OS. We assume you’ve been able to follow the instructions on how to boot your server over the network or boot your legacy VM in rescue mode.

Mount your drives

Dedicated Servers

If you have a Dedicated Server, the first thing you will want to do is type:

mount /dev/md1 /target
mount /dev/md0 /target/boot

(For premium machines with hardware RAID, or some non-standard software RAID configurations the device names will differ. Contact support if you are unsure.)

Your filesystem should now be accessible in /target.

Cloud Servers

For Cloud Servers, you can mount your drives by entering the following commands:

mkdir /target
mount /dev/vda2 /target
mount /dev/vda1 /target/boot

Your filesystem should now be accessible in /target.

Legacy Virtual Machines

For legacy virtual machines, please type:

mount / -o rw,remount

to be able to change files as normal.

Once you have mounted your filesystem, you are free to edit any files, which may be all you need to do to fix your problem. If that’s all you need, just type reboot when you’re done and wait for your system to boot up normally.

Copying files on and off

If you need to copy files on or off your Dedicated Server or Cloud Server, you will need to set a root password for the recovery mode, then install then start an SSH server:

passwd
apk add openssh
echo PermitRootLogin yes >> /etc/ssh/sshd_config
service sshd start/etc/init.d/ssh start

Note that you will probably be presented with a host-key warning when you connect.

If you are using a Legacy VM, then you will need to start the network interface, but can then simply start the existing SSH server:

ifup eth0
/etc/init.d/sshd start

You can then use SCP or SFTP to copy files on and off the server as root – the server should have its normal IP address.

Jumping into your system

This step isn’t necessary for Legacy Virtual Machine customers.

On a Dedicated Server or Cloud Server, if you need to run programs on your real file system, type:

chroot /target

This will leave you at a prompt “inside” your normal system. You can use this to re-run lilo or grub. When you’re finished, you will probably need to type exit before you can issue the reboot command.

Changing your root password

Probably the most common operation that you can do is resetting your root password. While inside the system you can run:

passwd

and set yourself a new root password.

Updated on June 7, 2018

Was this article helpful?

Related Articles