Re-installing an OS from your ISO image
Yandex BareMetal allows users to install and re-install a server OS from their own ISO images. In this way, you can install Linux
When installing or re-installing an OS from your ISO image, you can freely redistribute the disk space available on the server.
Fault-tolerant disk partitioning requires experience and understanding of RAID
For example, you may need installation from your ISO image if the required OS is not available in Cloud Marketplace, or if you need a non-standard disk partitioning configuration, UEFI
Warning
Incorrect disk partitioning or RAID configuration can result in reduced or no fault tolerance, unexpected lack of free space on partitions, or inability to start the server.
This guide provides an example of installing Ubuntu
Run the server from your own ISO image in UEFI mode
To create a BareMetal image from your ISO image and run the server from it:
-
Download
the required OS image to your local computer. -
Upload the downloaded ISO image to Yandex Object Storage and create a BareMetal image from it.
-
Connect to the server's KVM console.
Note
You will perform all further actions in the KVM console window.
-
In the KVM console window, in the top menu, select Media → Virtual Media Wizard... or click the CD icon. In the window that opens:
- In the CD/DVD Media1 section, click Browse and select the previously uploaded ISO image of the OS in the
user-iso
directory. - Click Connect CD/DVD.
- Check the Status section for the Virtual CD 1 device to make sure the Connected To field now indicates the path to the ISO image you selected and click Close.
Depending on the server settings, you may need to force selection of bootable media or
UEFI
mode in BIOS . For example, on a server with aBA-i201-H
configuration, you must boot from a CD drive in UEFI mode to install an OS in UEFI mode. - In the CD/DVD Media1 section, click Browse and select the previously uploaded ISO image of the OS in the
-
To start a server from the selected ISO image:
-
Click Reboot to cdrom in the top-right corner of the KVM console.
-
While the server is loading, press F11 or Del on the POST
screen. The following message will appear on the screen:Entering Setup...
. -
Wait until the BIOS system menu opens and use the ← and → keys to navigate to the Security section.
-
Using the ↑ and ↓ keys, select
UEFI: AMI Virtual CDROM0 1.00
in the Boot Override section and press Enter.The server will restart again and boot from the virtual CD drive in
UEFI
mode.
Warning
Default BIOS settings are optimal for a BareMetal server. We do not recommend changing them.
-
Configure the basic OS settings
At this stage, you will configure the basic settings for the OS being installed. Perform all the above actions in the KVM console terminal window:
-
In the GRUB
bootloader menu, select Try or Install Ubuntu Server and press Enter. -
Select the system language:
Navigate through the menu items using the ↑ and ↓ keys.
-
Select your keyboard layout, move the cursor to Done, and press Enter. Depending on the selected layout, you may need to set a keyboard shortcut to switch the input language.
-
Select the server installation option, either full or minimal:
-
Configure the network interface settings. By default, it is enough to leave DHCP
for all interfaces: -
If required, configure a proxy and a mirror address for repositories to install OS packages.
For example, when using Ubuntu, you can specify the following mirror address:
http://mirror.yandex.ru/ubuntu
. Usually, you do not have to make any edits. -
Select the Custom storage layout option. To do this, move the cursor to this menu item and press Space.
We do not recommended using the default option the Ubuntu installer offers, i.e., installing the system on a single drive. This option does not provide fault tolerance, and if the disk selected for system files fails, you will need to re-install the OS at the very least.
Partition your disks and create the RAID10 arrays
Alert
When partitioning disks, the partitions will be formatted. This will result in the loss of all data stored on the disks. Before proceeding, make sure you have a backup of all important files stored on the server.
Disk partitioning is the most important stage of installing an OS. Disk subsystem performance, data storage reliability, server fault tolerance, and redundancy restoration speed in the event of failure all boil down to ensuring partitioning is correct and you selected the right partition configuration.
At this stage, you can create any disk configuration, from repeating the partitioning proposed when installing the OS from a Cloud Marketplace image to setting up LVM with encryption.
You will create the following partitions to continue installing the OS:
-
/
: OS кoot partition. -
/boot
: Partition for the OS boot files. -
swap
: Swap partition. -
/home
: Partition for user home folders. -
/srv
: Service data partition. -
ESP
:UEFI
system partition with a size of1
GB.If you boot the server in
Legacy
mode, this will create aBIOS grub spacer
system partition of300
MB instead of theESP
partition.Note
There is no need to manually create the
ESP
andBIOS grub spacer
system partitions: they appear on the disk automatically when you select it as the primary or additional boot device.
To create a RAID10
-level fault-tolerant disk array, you need at least four disks or disk partitions. RAID arrays are usually created from partitions of disk devices, so you first need to repartition all disks and create a partition table on each of them:
-
If the server already has an OS installed and the disks have already been partitioned, remove the current partitioning. If you rented the server without an operating system and have not installed the OS on it yet, skip this step and proceed to the next one.
-
In the AVAILABLE DEVICES section, delete all disk partitions and RAID arrays on the server.
To do this, use the ↑ and ↓ keys to select a partition or RAID, press Enter, select
DELETE
in the menu that appears, and confirm the deletion.To delete all partitions on the disk, move the cursor to the line with this disk’s name, press Enter, select
Reformat
, and confirm the deletion. -
Repeat the previous step for all partitions, disks, and RAID arrays displayed in the AVAILABLE DEVICES section.
As a result, you should only have disk devices with unallocated disk space (
free space
) in the AVAILABLE DEVICES section:
-
-
Select your boot disks:
-
Using the ↑ and ↓ keys, select any disk and press Enter.
-
In the additional menu that appears on the right, select
Use As Boot Device
and press Enter.To install the bootloader, you must mark one disk as bootable, but to ensure fault tolerance, we recommend selecting at least two boot disks.
-
Select another disk, press Enter, and select
Add As Another Boot Device
.
-
-
Create an identical set of partitions on each disk based on the expected disk space consumption. In this example, three separate partitions are created on the disks:
-
Partition the first disk:
- Select the free space line of the first disk in the list, press Enter, and select
Add GPT Partition
in the additional menu that appears. - In the form that opens, in the Size: field, set the size of the first partition to create:
4G
. - In the Format: field, select
Leave unformatted
. - Move the cursor to Create and press Enter.
- Repeat the previous steps to create two more partitions on the first disk: one
2 GB
in size, the other occupying all the space left after the first two partitions.
- Select the free space line of the first disk in the list, press Enter, and select
-
Partition the remaining three server disks in the same way: the partition sizes on all four disks must match.
-
-
Build RAID arrays from the partitions created in the previous step:
-
Move the cursor to the Create software RAID (md) menu item and press Enter. In the form that opens:
- In the RAID Level: field, select
10
. - Use the Space key to mark
4 GB
partitions on all four disks. - Move the cursor to Create and press Enter.
- In the RAID Level: field, select
-
Similarly, create a
10
-level RAID array of2-GB
partitions and then, a10
-level RAID array of the largest partitions.
-
-
Create partitions for the server file system in the RAID arrays you got:
-
Create a
swap
partition:- Move the cursor to the
md0
RAID array of8 GB
, press Enter, and selectFormat
from the menu that appears. - In the form that opens, select
swap
in the Format: field. - Move the cursor to Done and press Enter.
- Move the cursor to the
-
Create a
/boot
partition:- Move the cursor to the
md1
RAID array of4 GB
, press Enter, and selectFormat
from the menu that appears. - In the form that opens, leave
ext4
in the Format: field; in the Mount: field, select/boot
. - Move the cursor to Done and press Enter.
- Move the cursor to the
-
-
From the
md2
RAID array built from the largest partitions, create avg0
LVM group:-
Create an LVM group:
- Move the cursor to the Create volume group (LVM) menu item and press Enter.
- In the form that opens, use Space to mark the
md2
array in the Devices: field. - Move the cursor to Create and press Enter.
-
Create an
lv-root
logical volume for the root partition:- Under AVAILABLE DEVICES, in the section with the
vg0
device, move the cursor to the free space line, press Enter, and selectCreate Logical Volume
in the menu that opens. - In the Name: field, enter
lv-root
. - In the Size: field, set the volume size to
100G
. - In the Format: field, leave the
ext4
value; in the Mount: field, leave the/
value. - Move the cursor to Create and press Enter.
- Under AVAILABLE DEVICES, in the section with the
-
Create logical volumes in the same way:
lv-home
,512 GB
in size with a/home
mount point for user home folders.lv-srv
,1 TB
in size with an/srv
mount point for service data.
You can use the space left unallocated in the
vg0
LVM group to expand existing logical volumes or create new ones later. -
Alternative disk partitioning options
The above disk partitioning is an example. In each case, you need to partition disk space based on the projected usage scenarios for the server. In addition, disk partitioning will vary depending on the boot mode set on the server: Legacy
or UEFI
.
Here are some other possible server disk partitioning configurations:
Partitioning similar to that created by the BareMetal installer from the Cloud Marketplace image (Legacy
boot mode):
Partitioning similar to that created by the BareMetal installer from the Cloud Marketplace image (UEFI
boot mode):
Partitioning with the root partition in an LVM group with encryption created in the RAID10
array:
Note
Partition encryption can have a number of downsides, such as reduced server performance, the need to enter the encryption key at each restart (or having a correctly configured TPM
Installing system files
Once you have created the required disk partitioning on your server, you can start installing the system files.
Alert
Up to this point, you have not yet physically made any changes to the server's disk structure, and you can cancel the OS installation process without losses. Continuing the installation will result in the deletion of all data on the disks and the physical creation of new partitions.
-
To continue the installation, move the cursor to Done and press Enter.
In the Confirm destructive action form that appears, click Continue to confirm your consent to format the disks.
-
Set the hostname, create the first user, configure SSH if required, and install additional software:
Wait for the installation of the OS files on the server to complete.
-
Disable the virtual CD drive in the KVM console:
- In the KVM console window, in the top menu, select Media → Virtual Media Wizard... or click the CD icon.
- In the window that opens, click Disconnect under CD/DVD Media1.
- Click Close.
-
To restart the server to the new OS, move the cursor to Reboot Now and press Enter:
-
Configure the server to boot in UEFI mode:
-
While the server is booting, press F11 or Del on the POST screen. The following message will appear on the screen:
Entering Setup...
. -
Wait until the BIOS system menu opens and use the ← and → keys to navigate to the Boot section.
-
Select 1st Boot Device, press Enter, and select
UEFI: Built-in EFI Shell
. -
Select UEFI Boot Drive BBS Priorities and press Enter. In the menu that opens:
- In the 1st Device field, press Enter and select any of the
UEFI OS
fields. - Press Esc to return to the previous menu.
- In the 1st Device field, press Enter and select any of the
-
Make sure the value in the 1st Boot Device field has changed to
UEFI OS
. -
Use the ← and → keys to navigate to the Save & Exit section.
-
Select Save Changes and Reset, press Enter, and confirm the action by pressing Yes.
-
As a result, the server will boot into the new OS in UEFI mode.