<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Tim's blog (Posts about OVH)</title><link>https://blog.thechases.com</link><description></description><atom:link href="https://blog.thechases.com/categories/ovh.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2025 &lt;a href="mailto:blog@tim.thechases.com"&gt;Tim Chase&lt;/a&gt; </copyright><lastBuildDate>Thu, 02 Oct 2025 19:32:43 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Installing FreeBSD on OVH</title><link>https://blog.thechases.com/posts/bsd/installing-freebsd-on-ovh/</link><dc:creator>Tim Chase</dc:creator><description>&lt;p&gt;
While
&lt;a href="https://ovh.com"&gt;OVH&lt;/a&gt;
has a number of Linux-based options for their low-end VPS offerings, I
wanted to try installing
&lt;a href="https://freebsd.org"&gt;FreeBSD&lt;/a&gt;.
As far as I can tell, OVH doesn't offer the ability to provide a bootable
&lt;code&gt;.iso&lt;/code&gt;
or
&lt;code&gt;.img&lt;/code&gt;
installer image for their VPS offerings (unlike their dedicated server
instances).
Fortunately, their VPS offers a recovery console with SSH access along with
the use of
&lt;code&gt;dd&lt;/code&gt;,
&lt;code&gt;gzip&lt;/code&gt;/&lt;code&gt;gunzip&lt;/code&gt;,
and
&lt;code&gt;xz&lt;/code&gt;.
This grants SSH access to the recovery console, allowing me to write the disk
image directly to the virtual drive which I learned from
&lt;a href="https://murf.se/freebs/"&gt;murf&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
The following was all done within a fairly stock FreeBSD 11 install (ZFS-on-root).
&lt;/p&gt;

&lt;p&gt;
My first problem was that the official downloadable
&lt;code&gt;.raw&lt;/code&gt;
&lt;a href="ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/11.0-RELEASE/amd64/Latest/"&gt;hard-drive image&lt;/a&gt;
was something like 20.1GB which was just
&lt;em&gt;slightly&lt;/em&gt;
larger than my available 20.0GB of space so I couldn't directly write the
image provided on the FreeBSD site.
&lt;/p&gt;

&lt;p&gt;
Time to do it the hard way and build my own image.
&lt;/p&gt;

&lt;h2 id="reconnaissance"&gt;Preliminary reconnaissance&lt;/h2&gt;

&lt;p&gt;
First, we need to gather some network information from the OVH install.
I'm assuming your initial machine image was either an Ubuntu or Debian
install.
If not, modify accordingly, but the goal is to obtain the following
from your management console and your
&lt;code&gt;/etc/networks.d/*&lt;/code&gt;
or
&lt;code&gt;/etc/network/*&lt;/code&gt;
file:
&lt;/p&gt;&lt;ul&gt;
 &lt;li&gt;your static IPv4 address (should be available in your management
  console or as the
  &lt;code&gt;address &lt;var&gt;${EXTERNAL_IPv4}&lt;/var&gt;&lt;/code&gt;
  line in your interface file, or by issuing
  &lt;code&gt;ipconfig eth0&lt;/code&gt;
  and looking for the IPv4 address)
  &lt;/li&gt;
 &lt;li&gt;your static IPv6 address (should be available in your management
  console or from
  &lt;code&gt;ipconfig eth0&lt;/code&gt;
  referenced later as
  &lt;code&gt;${EXTERNAL_IPv6}&lt;/code&gt;
  )
  &lt;/li&gt;
 &lt;li&gt;your default gateway (should be available in your interface file
  from the line that reads
  &lt;code&gt;
  post-up /sbin/ip route add &lt;var&gt;${GATEWAY_IPv4}&lt;var&gt; dev eth0
  &lt;/var&gt;&lt;/var&gt;&lt;/code&gt;
  or from the output of
  &lt;code&gt;route | grep default&lt;/code&gt;
  )
  &lt;/li&gt;
 &lt;li&gt;your DNS server (should be available in your interface file from
  the line that reads
  &lt;code&gt;dns-nameserver &lt;var&gt;${DNS_NAMESERVER}&lt;var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/code&gt;
  or
  &lt;code&gt;nameserver &lt;var&gt;${DNS_NAMESERVER}&lt;var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/code&gt;
  )
  &lt;/li&gt;
 &lt;li&gt;your DNS search suffix (should be available in your interface file from
  the line that reads
  &lt;code&gt;dns-search &lt;var&gt;${DNS_SEARCH}&lt;var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/code&gt;
  however this may be optional)
  &lt;/li&gt;
&lt;/ul&gt;
With these items noted, we can use them later on when creating the
corresponding configurations in FreeBSD.


&lt;h2 id="create-file"&gt;Create a local image file&lt;/h2&gt;

&lt;p&gt;
First, create a drive-image file that is the right size:
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
user@localhost$ truncate -s &lt;var&gt;20G&lt;/var&gt; &lt;var&gt;$HOME/freebsd.img&lt;/var&gt;
&lt;/pre&gt;
&lt;/figure&gt;



&lt;p&gt;
This will create a 20GB image file that should fit exactly in the available
space on the OVH VPS.
If you're using the lowest-end VPS, change that to 10G to make a 10GB
drive instead.
&lt;/p&gt;

&lt;h2 id="create-device"&gt;Create a device for the file&lt;/h2&gt;
&lt;p&gt;
In order to install to this file as a disk, FreeBSD needs to recognize it.
This can be done with the
&lt;kbd&gt;mdconfig&lt;/kbd&gt;
command as root.
This needs to be done as
&lt;code&gt;root&lt;/code&gt;
so first
&lt;code&gt;su -&lt;/code&gt;
to root:
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
user@localhost$ su -
Password: ********
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
On most systems, there won't already be a
&lt;code&gt;md0&lt;/code&gt;
device, but it's good to check first:
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
mdconfig -l
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
On most systems, that will return no pre-existing devices so you can use
&lt;var&gt;0&lt;/var&gt;
as the device-number, but if other
&lt;code&gt;md&lt;/code&gt;
devices exist, add 1 to the highest device number returned.
&lt;/p&gt;

&lt;p&gt;
Create the (in this case
&lt;code&gt;md0&lt;/code&gt;
) disk-backed memory device:
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
mdconfig -f &lt;var&gt;~user/freebsd.img&lt;/var&gt; -u &lt;var&gt;0&lt;/var&gt;
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
This will create a
&lt;code&gt;md0&lt;/code&gt;
device to which FreeBSD can be installed.
Note that if you already have a
&lt;code&gt;md0&lt;/code&gt;
device, change the
&lt;code&gt;-u 0&lt;/code&gt;
to a higher number that doesn't already exist
&lt;/p&gt;

&lt;h2 id="install-freebsd"&gt;Install FreeBSD&lt;/h2&gt;
&lt;p&gt;
Before installing, it's good to specify the root-pool as something other
than the default pools you likely have:
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
export ZFSBOOT_POOL_NAME=ovhzpool
bsdinstall
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
With the
&lt;code&gt;md0&lt;/code&gt;
device created we can run
&lt;kbd&gt;bsdinstall&lt;/kbd&gt;
and choose
&lt;code&gt;md0&lt;/code&gt;
as our target drive.
&lt;/p&gt;

&lt;p&gt;
For the Keymap Selection, continue with the default keymap unless you have
reason not to.
&lt;/p&gt;

&lt;p&gt;
For the hostname, this post uses "ovh".
&lt;/p&gt;

&lt;p&gt;
For your mirror selection, choose something geographically close.
&lt;/p&gt;

&lt;p&gt;
If you're using UFS on your local machine or installing UFS on your OVH
server, feel free to investigate whether the other automated installers
work for you. 
However, if your current/host setup uses ZFS like this guide,
choosing "Guided Root-on-ZFS" or the "Manual Disk Setup (experts)" in
&lt;a href="https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214911"&gt;
&lt;code&gt;bsdinstall&lt;/code&gt;
will find your existing zpools &amp;amp; GELI devices and try to forcibly
detach them
&lt;/a&gt;,
killing your local system in the process, requiring a reboot.
So for ZFS-on-existing-ZFS, use the "Shell" option.
Also, make note of the warning/instructions:
 &lt;/p&gt;&lt;blockquote&gt;
 Use this shell to set up partitions for the new system.
 When finished, mount the system at
 &lt;code&gt;/mnt&lt;/code&gt;
 and place an fstab file for the new system at
 &lt;code&gt;/tmp/bsdinstall_etc/fstab&lt;/code&gt;
 .
 Then type 'exit'.
 You can also enter the partition editor at any time by entering
 &lt;code&gt;bsdinstall partedit&lt;/code&gt;.
 &lt;/blockquote&gt;


&lt;p&gt;
confirm that our ZFSBOOT_POOL_NAME is set correctly
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
export ZFSBOOT_POOL_NAME=ovhzpool
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Clear any existing traces of a partition table.
If it doesn't have an existing partition table, it may complain, but
since the goal is to nuke it if it does exist, any such error can be
safely ignored.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
gpart destroy -F md0
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Create a GPT partition table 
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
gpart create -s gpt md0
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Create a 512k boot partition
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
gpart add -t freebsd-boot -s 512k -l boot md0
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Install the boot-loader code on the first (only so far) partition
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 md0
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Create a ZFS data partition, filling the rest of the drive
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
gpart add -t freebsd-zfs -l &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt; -a 1M md0
&lt;/var&gt;&lt;/var&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Create an encrypted disk
(optionally add -T to skip passing TRIM commands to the SSD
as this can leak information about how much space is actually in use)
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
geli init -e AES-XTS -l 128 -s 4096 -b -g gpt/&lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;
&lt;/var&gt;&lt;/var&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
At this point, it will prompt you to enter and confirm your GELI
password.
Next, attach this GELI device:
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
geli attach gpt/&lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;
&lt;/var&gt;&lt;/var&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Now, create a pool on that encrypted device.
With a single-but-larger disk, I'd set
&lt;code&gt;copies=2&lt;/code&gt;
on my root pool to get a little redundancy by default on everything.
But since 20GB is a little tight, I set it selectively on my datasets
for user data and assume I can regenerate anything in system datasets.
Your own needs will determine whether you make everything redundant,
just your user data, or nothing.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
zpool create -R /mnt -O canmount=off -O mountpoint=/ -O atime=off -O compression=on &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt; gpt/&lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;.eli
zfs create -o mountpoint=/ &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/ROOT
zpool set bootfs=&lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/ROOT &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;
zfs create -o copies=2 &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/home
zfs create -o canmount=off &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/usr
zfs create &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/usr/local
zfs create &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/usr/local/jails
zfs create &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/usr/obj
zfs create &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/usr/src
zfs create &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/usr/ports
zfs create &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/usr/ports/distfiles
zfs create -o canmount=off &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/var
zfs create &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/var/log
zfs create &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/var/tmp
zfs create &lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;var&gt;/tmp
&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Because of a quirk in the installer, it requires
&lt;code&gt;/usr/freebsd-dist/MANIFEST&lt;/code&gt;
to be present in the
&lt;code&gt;chroot&lt;/code&gt;
environment.
It also seems to clean this up if the installer hiccups for any reason,
so I recommend putting a copy into your local directory.
It may already be on your install media, or you can download a copy
from the corresponding directory on the FTP site.
Check your mirror, architecture, and release, but it should be something
like
&lt;/p&gt;
 
&lt;figure&gt;
&lt;pre&gt;
mkdir freebsd-dist
cd freebsd-dist
fetch ftp://ftp8.freebsd.org/pub/FreeBSD/&lt;var&gt;releases&lt;/var&gt;/&lt;var&gt;amd64&lt;/var&gt;/&lt;var&gt;amd64&lt;/var&gt;/&lt;var&gt;11.0-RELEASE&lt;/var&gt;/MANIFEST
cd ..
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
and then copying it into
&lt;code&gt;/usr/&lt;/code&gt;
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
cp -va freebsd-dist /usr/
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
That way, you'll have a local copy in the event something goes awry and
you have to recreate the
&lt;code&gt;/usr/freebsd-dist/MANIFEST&lt;/code&gt;
again.
&lt;/p&gt;

&lt;p&gt;
Finally,
&lt;code&gt;exit&lt;/code&gt;
the shell to return to the installer.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
exit
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
The rest of the installer should be fairly straight-forward.
At the end of the install, it will prompt to drop to a shell.
Do that.
&lt;/p&gt;

&lt;p&gt;
First, create/edit
&lt;code&gt;/etc/rc.conf&lt;/code&gt;
to include the following lines, making use of the information gleaned
in the
&lt;a href="https://blog.thechases.com/posts/bsd/installing-freebsd-on-ovh/#reconnaissance"&gt;reconnaissance&lt;/a&gt;
step above.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
ifconfig_vtnet0="inet &lt;var&gt;$EXTERNAL_IPv4&lt;/var&gt; netmask 255.255.255.255 broadcast &lt;var&gt;$EXTERNAL_IPv4&lt;/var&gt;"
static_routes="net1 net2"
route_net1="&lt;var&gt;$GATEWAY_IPv4&lt;/var&gt; -interface vtnet0"
route_net2="default &lt;var&gt;$GATEWAY_IPv4&lt;/var&gt; "
ifconfig_vtnet0_ipv6="inet6 &lt;var&gt;$EXTERNAL_IPv6&lt;/var&gt; prefixlen 64"
ipv6_defaultrouter="&lt;var&gt;$GATEWAY_IPv6&lt;/var&gt;"
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
If you plan to use jails, don't let syslogd listen on all addresses
and it's worthwhile to set up a loopback interface to use while you're
in the
&lt;code&gt;/etc/rc.conf&lt;/code&gt;
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
syslogd_flags="-ss"
cloned_interfaces="&lt;var&gt;lo1&lt;/var&gt;"
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Next up, edit
&lt;code&gt;/etc/resolv.conf&lt;/code&gt;
using the DNS information gathered during
&lt;a href="https://blog.thechases.com/posts/bsd/installing-freebsd-on-ovh/#reconnaissance"&gt;reconnaissance&lt;/a&gt;
to contain the
&lt;code&gt;nameserver&lt;/code&gt;
and optionally the
&lt;code&gt;search&lt;/code&gt;
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
nameserver &lt;var&gt;$DNS_NAMESERVER&lt;/var&gt;
search &lt;var&gt;$DNS_SEARCH&lt;/var&gt;
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Assuming you set up a user during the install and that they're a member
of the
&lt;code&gt;wheel&lt;/code&gt;
group to let you
&lt;code&gt;su -&lt;/code&gt;
and perform administrative commands, it's worth editing the
&lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;
to allow SSH login and prohibit root login by adding/modifying these
lines:
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
ListenAddress &lt;var&gt;$EXTERNAL_IP&lt;/var&gt;
PermitRootLogin no
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
You may also want to add your SSH public key to
&lt;code&gt;$USER/.ssh/authorized_keys&lt;/code&gt;
for your non-root
&lt;code&gt;$USER&lt;/code&gt;
so you can SSH in without a password.
&lt;/p&gt;

&lt;p&gt;
With changes done in the
&lt;code&gt;chroot&lt;/code&gt;
we can now exit the
&lt;code&gt;chroot&lt;/code&gt;
and return to the parent shell.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
exit
&lt;/pre&gt;
&lt;/figure&gt;

&lt;h2 id="disconnecting"&gt;Freeing up the image&lt;/h2&gt;

&lt;p&gt;
Before shipping the image over to the server, it first needs to be shut
down cleanly.
Start by unmounting all the new ZFS items under.
The following finds them and creates a series of commands that can be
used to unmount them:
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
mount | awk '/\/mnt/{print "umount " $3}' | sort -r
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
If they all look good, you can execute them.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
mount | awk '/\/mnt/{print "umount " $3}' | sort -r | sh
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
ZFS still has these pools active so disconnect them
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
zpool export &lt;var&gt;$ZFSBOOT_POOL_NAME&lt;/var&gt;
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Detach the GELI devices if needed.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
geli detach /dev/gpt/&lt;var&gt;${ZFSBOOT_POOL_NAME}&lt;/var&gt;.eli
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
With all filesystems disassociated from the
&lt;code&gt;md0&lt;/code&gt;
it can now be disconnected too.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
mdconfig -d -u &lt;var&gt;0&lt;/var&gt;
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Can now leave the root shell and return to your unprivileged user
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
exit
&lt;/pre&gt;
&lt;/figure&gt;

&lt;h2 id="reconnecting"&gt;Reconnecting&lt;/h2&gt;

&lt;p&gt;
In the event you want to make further modifications, it's helpful to
know how to reattach the
&lt;code&gt;md0&lt;/code&gt;,
attach the GELI volume, and import the ZFS pool again.
So as root
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
mdconfig -f &lt;var&gt;~user/freebsd.img&lt;/var&gt; -u &lt;var&gt;0&lt;/var&gt;
geli attach gpt/&lt;var&gt;$ZFSBOOT_POOL_NAME&lt;/var&gt;
zpool import -R /mnt &lt;var&gt;$ZFSBOOT_POOL_NAME&lt;/var&gt;
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
From here, you can make changes and then repeat the
&lt;a href="https://blog.thechases.com/posts/bsd/installing-freebsd-on-ovh/#disconnecting"&gt;steps for disconnecting the disk image&lt;/a&gt;.
&lt;/p&gt;

&lt;h2 id="sending"&gt;Sending the image over&lt;/h2&gt;
&lt;p&gt;
Start by compressing the disk image to save bandwidth.
My 20GB image compressed to ~400MB, or roughly 2%.
I keep the original image around in case I need to reconnect to it to
make changes I forgot about.
The
&lt;code&gt;gzip&lt;/code&gt;
process takes a little while.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
gzip --keep freebsd.img
&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Log into your VPS console and restart your VPS in rescue mode.
&lt;/p&gt;

&lt;p&gt;
Once it has restarted, you should receive information via email on how
to log into that console.
Use this information to SSH into the rescue image.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
ssh root@&lt;var&gt;$EXTERNAL_IPv4&lt;var&gt;
&lt;figure&gt;
&lt;pre&gt;

&lt;p&gt;
Your normal root drive will be mounted under the rescue 
&lt;code&gt;/mnt/&lt;/code&gt;
First you have to find out its name.  It might be
&lt;code&gt;vdb1&lt;/code&gt;,
&lt;code&gt;sdb1&lt;/code&gt;,
or something similar so it will need to be unmounted before overwriting.
Once done, disconnect.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
mount | grep /mnt
umount /mnt/vdb1
exit
&lt;/pre&gt;
&lt;/figure&gt;
&lt;/pre&gt;&lt;/figure&gt;
&lt;/var&gt;&lt;/var&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;
Next, upload the image to the drive in question (make sure you specify
the correct root device based on the mount point, such as
&lt;code&gt;vdb&lt;/code&gt;
or
&lt;code&gt;sdb&lt;/code&gt;
).
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
ssh root@&lt;var&gt;$EXTERNAL_IPv4&lt;var&gt; "gunzip | dd of=/dev/sdb bs=1M" &amp;lt; freebsd.img.gz
&lt;/var&gt;&lt;/var&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
or, if you have
&lt;code&gt;pv&lt;/code&gt;
installed, you can get a rough estimate of the time needed
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
pv freebsd.img.gz | ssh root@&lt;var&gt;$EXTERNAL_IPv4&lt;var&gt; "gunzip | dd of=/dev/&lt;var&gt;sdb&lt;/var&gt; bs=1M"
&lt;/var&gt;&lt;/var&gt;&lt;/pre&gt;
&lt;/figure&gt;

&lt;p&gt;
Depending on your internet speed, this may take a while.
However, once the image has finished transferring, you should be able to
go into your management console and reboot the server.
If all has gone well, your server should start booting.
&lt;/p&gt;

&lt;p&gt;
Note that, since we have an encrypted drive, we need to log into the KVM
console to enter the boot password.
It should then boot in that KVM console to the login prompt.
If you can get in there, then you can attempt to SSH in directly.
&lt;/p&gt;

&lt;figure&gt;
&lt;pre&gt;
ssh &lt;var&gt;$USER&lt;var&gt;@&lt;var&gt;$EXTERNAL_IPv4&lt;var&gt;
&lt;figure&gt;
&lt;pre&gt;

&lt;p&gt;
If you installed your public key in
&lt;code&gt;$USER/.ssh/authorized_keys&lt;/code&gt;
it should let you right in.
If you didn't, you can enter your credentials and should hopefully be up
and running.
&lt;/p&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/var&gt;&lt;/pre&gt;&lt;/figure&gt;</description><category>FreeBSD</category><category>OVH</category><guid>https://blog.thechases.com/posts/bsd/installing-freebsd-on-ovh/</guid><pubDate>Sun, 06 Nov 2016 19:48:15 GMT</pubDate></item></channel></rss>