On a bare metal server, I personally verified the setting memo that boots the OS with software RAID1 (mirror) configuration with two storages. I see information on RHEL and CentOS, but I would like to try it in the Ubuntu environment and make it versatile information in the Linux environment. It's easy to install a hardware RAID card, but it's not cheap, so let's easily make it redundant with software RAID with SATA.
If you search the net for this kind of information, there are many pages that I tried with Virtualbox, but please understand that it can not be said unconditionally whether it actually works with the bare metal server of the actual machine because the operation of the BIOS differs depending on the manufacturer and model. Please. For reference only. This time, we verified with the actual used rack mount server of FUJITSU's PRIMERGY series, which is often found in your home rack.
First, set the BIOS of the actual bare metal server. Use the [F2] or [DEL] keys to display the BIOS screen. Here, set the SATA mode in the BIOS settings to [AHCI Mode] instead of [RAID Mode]. This [RAID Mode] is a software RAID setting that requires driver software for Windows OS, which is also called Fake RAID. This kind of FakeRAID cannot be used in principle because the driver software is insufficient on Linux. There may be RHEL driver software in some cases.
When installing the software RAID environment of ubuntu, be sure to use the "Alternative Ubuntu Server installer" version because the installation cannot be done well with the "Desktop" version or the normal "Server (Live)" version.
This time, I used "Ubuntu Server 18.04.3 LTS".
If you select Japanese, it will stop in the middle, so install it in English. However, there was no problem with the keyboard and regional settings even in Japanese.
This time, we will create two partitions for the entire single storage. One is for OS booting and the other is for OS and users. Since it is configured as RAID1 (mirror) with 2 units "/ dev / sda" and "/ dev / sdb", there are a total of 4 partitions. That partition builds an Ext4 file format on a partition with RAID attributes. LVM will not be used this time.
Create a partition for OS boot at the beginning of storage. A size of 1GB is enough. Create "/ dev / sda1" and "/ dev / sdb1" in each of the two storages. Set the partition to the RAID attribute. Also, be sure to enable (on) the OS bootable flag :. The Ext4 file format is not set here as it is after RAID is configured. Don't make a mistake.
Create "/ dev / sda2" and "/ dev / sdb2" for the remaining free space of the storage for the OS and users, respectively. Also, set the partition to the RAID attribute. The Ext4 file format is not set here as it is after RAID is configured. Don't make a mistake.
RAID configuration storage is recognized as an MD device. Create an MD device by combining the RAID attribute partitions created in the two storages.
--Create a "md0" RAID device by combining the first created RAID attribute partitions "/ dev / sda1" and "/ dev / sdb1" with a capacity of 1GB for booting the OS.
--Combine the remaining "/ dev / sda2" and "/ dev / sdb2" to create a "md1" RAID device
If the screen display contents do not change after creation, it will be displayed by returning one screen and re-recognizing it.
Create an Ext4 file format partition on the created RAID MD device.
--Set the mount position of "md0" for OS boot to "/ boot"
--Set the mount position of "md1" for OS and user to "/"
Make sure that the software RAID configuration for your storage is as expected and then partition the installation. In particular, make sure that you have not forgotten the OS boot flag of the RAID partition for OS boot. I think that the installation is completed successfully until the end and you can restart.
After rebooting, the RAID synchronization settings are in progress, so let's check.
$ cat /proc/mdstat
After RAID synchronization is complete, let's check if the OS boots for each storage alone.
Work memo for HDD replacement due to RAID storage failure on CentOS
Recommended Posts