Appearance
Storage & RAID on OVH bare metal
Before managed can install MySQL on your OVH bare-metal box, you set up the box's disks once, by hand, in the OVH manager. This page explains exactly what to do and why.
Here's the key thing to understand: managed apply never touches your disks. It does not set up disk mirroring, it does not resize partitions, and it does not decide where MySQL's data lives. That is on purpose (more on why at the bottom). It means the disk layout is a one-time decision you make in the OVH manager before you ever point managed at the box. If you skip it, nothing later will fix it, managed will happily install MySQL onto a fragile or too-small disk and never warn you.
Good news: you don't need to be a storage expert. There's really one decision to get right, and the rest is a short checklist.
This page is for OVH bare-metal (dedicated) servers you adopt with kind: dedicated. Cloud servers (DigitalOcean, Vultr, OVH Public Cloud, and the rest) set their own storage up automatically, you only need this page for bare metal.
When this happens
There are only two moments you can set up the disks, and both are in the OVH manager, not in managed:
- When you order the server. You choose the hardware, the model and how many disks it has. You do not pick the disk layout at checkout; ordering only decides how many disks you get to work with.
- When you install (or reinstall) the operating system. This is where the disk mirroring and partition layout are actually chosen. On a brand-new box you'll do an OS install anyway, and that's your chance.
Reinstalling erases EVERYTHING
Reinstalling the operating system permanently deletes all data on the box, every disk on it. Only do this on a fresh box that has no data on it yet. If MySQL is already running and holds real data, do not reinstall to fix the disk layout, you would lose the database. Get the disk layout right before any data exists.
The one decision: pick a layout that survives a dead disk
A bare-metal box usually has 2 disks (sometimes 4). On its own, a single disk can die and take your whole database with it. The fix is disk mirroring (its technical name is "RAID"), the box keeps a live copy of your data across more than one disk, so if one disk fails, you don't lose anything.
OVH labels these layouts by number. You pick one during the OS install.
If you only remember one thing
- 2-disk box → choose RAID 1. Your data is mirrored across both disks. One can die and you're fine.
- 4-disk box → choose RAID 10. Same idea, spread across four disks, and it stays fast even under heavy database writes.
Both keep a full, live copy of your data, so a single dead disk never loses the database.
Two things to actively avoid. (Quick rule: the mirroring layouts, RAID 1 and RAID 10, keep a full copy and stay fast; the ones below either keep no copy or are slow for a database.)
- Never choose RAID 0. It keeps no copy at all, if one disk dies, the entire database is gone. It's only for throwaway test machines.
- Avoid RAID 5 and RAID 6. They squeeze out a little more usable space, but they make every small write much slower, and a database does a huge number of small writes. RAID 1 and RAID 10 don't have that slowdown, which is why they're the right pick here.
If you change nothing, OVH's default is RAID 1, a mirror across all the disks. On a 2-disk box that's already a safe choice. On a 4-disk box the default is still RAID 1 across all four disks: safe, but it wastes space (you only get one disk's worth of room) and isn't as fast for writes, so on a 4-disk box choose RAID 10 instead, as above. Either way, the thing the default gets wrong for a database is space, that's next.
Make sure MySQL has room to grow
managed installs MySQL, and MySQL keeps all of its data in one folder on the box:
/var/lib/mysqlThat folder must live on the mirrored disks and have plenty of free space, because a database grows over time.
Here's the catch with OVH's default layout: it puts most of the disk's space into a separate area (usually called /home) and leaves the system area, where /var/lib/mysql ends up, surprisingly small. How small depends on the OS image (often only tens of gigabytes, sometimes much less), so don't trust a fixed number, read the size shown on OVH's install summary screen. The space is mirrored and safe, but MySQL isn't pointed at it. The result is a database that runs out of room and stops, while most of the disk sits empty and unused. This is one of the most common OVH surprises, and it's exactly the thing managed can't fix for you.
Simplest safe choice (great for a 2-disk box)
During the OS install, choose one large root partition (/) that fills the whole mirrored array. Then /var/lib/mysql automatically gets all the space and all the redundancy, with nothing extra to configure.
In practice: in the partition editor, remove the separate large partition (the /home one) and let / take all the remaining space.
On a 4-disk box, give the database its own RAID 10 space
OVH requires the root / partition to use RAID 1, so you can't put one big / on RAID 10. To get RAID 10's speed for the database, keep / small on RAID 1 and add a separate partition mounted at /var/lib/mysql, set to RAID 10, filling the rest of the disks.
A simpler alternative is fine too: one large / on RAID 1 across all four disks. It's fully mirrored and safe, it just uses only one disk's worth of space and isn't as fast for writes. Start there if RAID 10 feels like too much.
What to do
Follow this at order/install time, in the OVH manager:
Order the box with at least 2 disks. (This is the only disk-related choice at checkout, it sets how many disks you have to mirror across.)
Start an OS install on the box. In the manager, open your dedicated server, find the operating-system section, and choose to install (or reinstall) from an OVH template. OVH occasionally restyles this screen and the wording varies a little by region and language, look for the option to install the OS.
Choose your OS, for example, a recent Ubuntu LTS.
Turn on custom partitioning. Before continuing, tick the checkbox to customise the partition configuration. (It may read "Customise" or "Customize.") If you skip this, you silently get OVH's default layout, safe disks, but the too-small-space problem above.
Set the mirroring and give MySQL room. This is the one step that depends on how many disks you have:
- 2-disk box: Set the root
/partition to RAID 1, remove the separate/homepartition, and let/fill the whole array. Done,/var/lib/mysqlis now mirrored with all the space. - 4-disk box: Leave the root
/partition on RAID 1 (OVH requires this) but keep it modest. Add a new partition mounted at/var/lib/mysql, set it to RAID 10, and let it fill the rest of the disks. (Or take the simpler path: one large/on RAID 1 across all four disks, safe, just less space and slower writes.)
In the partition editor you change a partition by its edit icon (usually a pencil) and pick the RAID level from a drop-down.
- 2-disk box: Set the root
Confirm and let the install run. Finish the wizard and wait for the box to be delivered or reinstalled.
Now hand it to
managed. Only once the disks are set up, add the box to yourmanaged.yamland runmanaged apply. A bare-metal box is adopted withkind: dedicated, which needs three things together, theprovider, the box's publicip, and itsservice_name(the name OVH gives the box, likens3012345.ip-1-2-3.eu, shown in the OVH manager):yamlservers: db-box: provider: ovh kind: dedicated ip: 203.0.113.10 service_name: ns3012345.ip-1-2-3.eu # the OVH manager's name for this box services: production-database: package: mysql server: db-boxmanagedinstalls MySQL 8.0 onto the storage you just prepared. See the OVH provider page for the provider credentials this needs, and the MySQL service page for the database options.
How to check it worked
After the box is delivered, you want to confirm two separate things: the data folder is on the mirrored disks, and it has lots of free space. They're checked differently, a folder can have plenty of space and still sit on a single, unmirrored disk.
The gentle way: when you (or whoever helps you set up the box) are logged in, ask them to confirm that "the MySQL data folder is on the mirrored disks, with plenty of free space." That's the whole check in plain terms.
If you're comfortable on the command line, log in to the box over SSH (see SSH keys) and run two quick checks.
Is the data folder mirrored?
cat /proc/mdstatThis lists the box's mirrors (Linux calls a software mirror an "md" device). Each healthy mirror line ends in [UU] on a 2-disk box (or [UUUU] on a 4-disk box), every U is one disk that's present and in sync. If you see a _ instead of a U, a disk is missing or rebuilding. If this command shows nothing at all, the disks aren't mirrored, go back and redo the install with RAID 1 or RAID 10 before putting any real data on the box.
Does it have room?
df -h /var/lib/mysqldf lists free space for a folder. The "Size" column should be large, most of the disk, not a small number, and "Avail" should show plenty of free space. If instead you see a small size, the database is sitting on the cramped system area, redo the install with one large / (2-disk) or a dedicated /var/lib/mysql partition (4-disk) before adding any data.
Why managed doesn't do this for you
This is a deliberate, safety-first choice, not a missing feature.
Setting up disks is destructive and one-time: it reformats drives and erases everything on them. A tool that quietly reformatted your disks could wipe out a database in an instant. So managed apply never touches disks, RAID, or partitions. It trusts the safe, well-tested OVH manager to do the one-time disk setup, and then takes over to install and run MySQL.
In short: you make the disks safe and roomy once, in OVH. After that, managed does the rest, and never puts your data at risk by reformatting.
RAID is not a backup
Mirroring protects you from a disk dying. It does not protect you from an accidental DROP, a bad migration, or corruption, those get copied to every mirror instantly. managed's MySQL package runs automated backups to object storage for exactly this reason; keep them on. See MySQL → Backups.