Red Hat Linux

How to Configure Synology NAS for Diskless Booting RHEL 9 via iSCSI and iPXE

“Diskless booting is the process of booting an operating system on your computer from a remote disk. The remote disk can be an iSCSI SAN, Fibre Channel SAN via FCoE (Fibre Channel over Ethernet) or AoE SAN.

The benefits of diskless booting are:

  • Storage costs can be saved as not all the computers/servers on your firm/lab will need to have a disk for installing an operating system.
  • Storage utilization will be more efficient as the disks of the central server (In this case, your Synology NAS) can be shared among a lot of computers/servers.
  • Easy to manage as the data of all the computers/servers will be stored in a central server (In this case, your Synology NAS).
  • Easy to take backups of the data of your computers/servers as it will be stored in a central server (In this case, your Synology NAS).
  • Snapshots of the remote disk can be taken. So, you can easily recover a computer/server from any disaster in case there’s any.

In this article, I am going to show you how to configure your Synology NAS for diskless booting Red Hat Enterprise Linux 9 (RHEL 9 in short) on your computers from iSCSI SAN via iPXE. So, let’s get started.”

Table of Contents

  1. Technical Terms
  2. Network Topology
  3. Setting Up a Static IP Address on your Synology NAS
  4. Preparing Synology NAS for PXE Booting with iPXE
  5. Creating the Necessary iPXE Configuration Files for Diskless Booting
  6. Creating an iSCSI LUN for Installing RHEL 9
  7. Installing RHEL 9 on iSCSI LUN
  8. Configuring iPXE to Boot from iSCSI Target
  9. Booting RHEL 9 from iSCSI Disks via iPXE
  10. Diskless Booting Other Linux Distributions
  11. Conclusion
  12. References

Technical Terms

SAN: The full form of SAN is Storage Area Network. It is the iSCSI server. In this case, it is your Synology NAS.

iSCSI disk/LUN: The logical disk that is shared on the network via iSCSI is called an iSCSI LUN (Logical Unit Number). In this article, I will also call it an iSCSI disk.

iSCSI Target: One or more iSCSI disks/LUNs will be mapped to an iSCSI target. You will be login into an iSCSI target to access the iSCSI disks/LUNs mapped to it.

IQN: The full form of IQN is iSCSI Qualified Name. It is a unique identifier for the iSCSI target and iSCSI client.

For more in-depth information on iSCSI and how it works, read the article Configure iSCSI Storage Server on CentOS 8.

Network Topology

The network topology used in this article is shown below. Here, I have a Synology NAS and two diskless computers, pc-01 and pc-02, connected to my home network. pc-01 has the MAC address 00:0c:29:5a:e5:56 and pc-02 has the MAC address 00:0c:29:af:38:6a. I will show you how to configure your Synology NAS and the iPXE boot server in a way that the computers pc-01 and pc-02 will automatically boot from different iSCSI disks/LUNs depending on their MAC addresses.

NOTE: Your network topology will be different. So, don’t forget to make the necessary adjustments in the later sections of this article.

Setting Up a Static IP Address on Your Synology NAS

If the IP address of your Synology NAS changes frequently, you will have problems with PXE booting with iPXE and diskless booting RHEL 9 on your computers.

So, it’s a good idea to set up a static IP address on your Synology NAS before you set up diskless booting from iSCSI SAN with iPXE. If you need any assistance with setting a static IP address on your Synology NAS, read the article How to Assign a Static IP Address to a Synology NAS?.

Preparing Synology NAS for PXE Booting With iPXE

Before you move any further, make sure to prepare your Synology NAS for PXE booting with iPXE.

To prepare your Synology NAS for PXE booting with iPXE, read the article How to Configure Synology NAS as PXE Boot Server for Netbooting Linux Installation Images with iPXE (BIOS and UEFI version).

Once your Synology NAS is configured for PXE booting with iPXE, you should see the following files and folder in the pxeboot shared folder of your Synology NAS.

In the config/ folder, you will see an iPXE boot configuration file boot.ipxe as well.

Make sure that you have all the necessary files and folders in the pxeboot shared folder before going any further. Don’t forget to read and follow the article How to Configure Synology NAS as PXE Boot Server for Netbooting Linux Installation Images with iPXE (BIOS and UEFI version) if you’re having any difficulties setting up iPXE on your Synology NAS.

Creating the Necessary iPXE Configuration Files for Diskless Booting

In this article, I will configure iPXE in a way that a different boot configuration file is used for each computer on the network, depending on the MAC address of the computers. This way, you can configure PXE booting for each of the computers on the network separately. You can also configure multiple boot options for each of the computers separately. This gives you a lot of flexibility.

To do what I have just explained, open the [pxeboot]/config/boot.ipxe boot configuration file with a text editor and type in the following lines of codes:

#!ipxe

set nas_ip          192.168.0.114
set boot_url tftp://${nas_ip}/config/boot-${net0/mac:hexhyp}.ipxe

echo Booting from URL ${boot_url}
chain ${boot_url}

Here, 192.168.0.114 is the IP address of my Synology NAS. Make sure to replace it with yours from now on. If you need any assistance in finding the IP address of your Synology NAS, read the article How Do I Find the IP Address of My Synology NAS?.

Once you’re done, save the boot.ipxe configuration file.

Here, iPXE will look for boot configuration files boot-<hyphened-mac-addr>.ipxe in the config/ folder of the pxeboot shared folder. <hyphened-mac-addr> is the MAC address of the computer being booted via iPXE. So, if the computer pc-01 with the MAC address 00:0c:29:5a:e5:56 boots via iPXE, iPXE will run the boot configuration file boot-00-0c-29-5a-e5-56.ipxe. Notice how the colons (:) of the MAC address are replaced with hyphens ().

Now, create a new boot configuration file boot-00-0c-29-5a-e5-56.ipxe for the computer pc-01 with the MAC address 00:0c:29:5a:e5:56 and type in the following lines in that file.

Once you’re done, save the boot-00-0c-29-5a-e5-56.ipxe file.

Create another boot configuration file boot-00-0c-29-af-38-6a.ipxe for the computer pc-02 with the MAC address 00:0c:29:af:38:6a and type in the following lines in that file.

Once you’re done, save the boot-00-0c-29-af-38-6a.ipxe file.

Once you’ve created the required boot configuration files, you can PXE boot the computers on your network.

In this case, if I PXE boot the computer pc-01, it will show the message Booting on pc1 as marked in the screenshot below. It means that PXE boot on pc-01 works, and iPXE read the configuration file boot-00-0c-29-5a-e5-56.ipxe when PXE booted on pc-01.

In the same way, if I PXE boot the computer pc-02, it will show the message Booting on pc2 as marked in the screenshot below. It means that PXE boot on pc-02 works, and iPXE read the configuration file boot-00-0c-29-af-38-6a.ipxe when PXE booted on pc-02.

Creating an iSCSI LUN for Installing RHEL 9

In this section, I am going to show you how to create an iSCSI target and LUN on your Synology NAS and map the iSCSI LUN to the iSCSI target so that you can install RHEL 9 on it and boot RHEL 9 diskless on your computer/server with iPXE. If you want to learn more about creating an iSCSI target on your Synology NAS, read the article How Do You Make an iSCSI Target in Synology?.

First, open the SAN Manager app from the Application Menu of the DSM web interface of your Synology NAS.

The SAN Manager app should be opened.

To create a new iSCSI target, navigate to the iSCSI section and click on the Add button.

If you have created some iSCSI targets already, then you will have to click on the Create button instead to create a new iSCSI target, as marked in the screenshot below.

iSCSI target creation wizard should be displayed. You can create a new iSCSI target from here. For more information on the available options of the iSCSI target creation wizard, read the article How Do You Make an iSCSI Target in Synology?.

I am going to show you how to create an iSCSI target for diskless booting the computer pc-01 only. You can create an iSCSI target for the computer pc-02 in the same way.

Type in pc-01-target as the iSCSI target name1, iqn.2022-05.com.linuxhint:pc-01-target as the IQN2, and click on Next3.

NOTE: IQN is a unique identifier for the iSCSI targets of your Synology NAS. The IQN follows a specific format. To learn more about IQN and its format, read the Creating an iSCSI Target section of the article How Do You Make an iSCSI Target in Synology?.

Select Create a new LUN and click on Next.

Type in pc-01-disk01 as the name for the iSCSI LUN1, select a volume where you want to store the iSCSI LUN data from the Location dropdown menu2, and type in the amount of disk space (in GB/gigabyte unit) you want to allocate for the LUN3, select a space allocation method from the Space allocation dropdown menu4, and click on Next5.

NOTE: For more information on Thin Provisioning and Thick Provisioning, read the Creating a LUN section of the article How Do You Make an iSCSI Target in Synology?.

A summary of the settings used to create a new LUN, and iSCSI target will be displayed.

To create a new LUN and iSCSI target with these settings, click on Done.

A new iSCSI target pc-01-target should be created. A new LUN pc-01-disk01 should be created and mapped to the iSCSI target pc-01-target as well.

In the same way, create a new iSCSI target pc-02-target for the computer pc-02, create a new LUN pc-02-disk01, and map it to the iSCSI target pc-02-target.

You will find a lot of information about all the LUNs that you’ve created in the LUN section of the SAN Manager app, as you can see in the screenshot below.

For iSCSI diskless booting of RHEL 9 to work perfectly without any issues, you will have to enable multiple sessions to the iSCSI targets that you’ve created for the computers pc-01 and pc-02.

To enable multiple sessions for the iSCSI target pc-01-target, select it and click on Edit.

Check the Allow multiple sessions from one or more iSCSI initiators checkbox from the Advanced tab and click on Save.

Multiple sessions should be enabled for the iSCSI target pc-01-target, as you can see in the screenshot below.

In the same way, enable Multiple sessions for the iSCSI target pc-02-target.

Installing RHEL 9 on iSCSI LUN

To install RHEL 9 on the iSCSI LUNs that you’ve created in the previous section of this article, you will have to create a bootable USB thumb drive of RHEL 9 using the official ISO image and boot the RHEL 9 installer on your computer from the USB bootable thumb drive.

You can download an ISO image of Red Hat Enterprise Linux 9 or RHEL 9 from the official downloads page of RHEL. Once you’ve downloaded an ISO image of RHEL 9, follow the procedures shown in the article How to Install Fedora Workstation 35 from USB to create a bootable USB thumb drive of RHEL 9.

Once you boot from the bootable USB thumb drive of RHEL 9, you will see the following window. Select Install Red Hat Enterprise Linux 9.0 and press E.

Type in inst.nonibftiscsiboot at the end of the linuxefi line as marked in the screenshot below and press F10 to boot.

RHEL 9 installer is being booted. It will take a few seconds to complete.

RHEL 9 installer window should be displayed once it’s booted.

Select a language and click on Continue.

You have to configure your RHEL 9 installation from here.

To add an iSCSI disk and configure it to install RHEL 9, click on Installation Destination.

Click on Add a disk…

Click on Add iSCSI Target…

Type in the IP address of your Synology NAS in the Target IP Address section1.

Type in a unique IQN for the iSCSI client/initiator in the iSCSI Initiator Name section2. In this article, I will use the IQN iqn.2022-05.com.linuxhint:ipxe-pc-01 as the client/initiator IQN. If you need an in-depth explanation of the IQN format, read the iSCSI Target and Initiator Naming Conventions section of the article Configure iSCSI Storage Server on CentOS 8.

Once you’re done, click on Start Discovery3.

All the iSCSI targets that you’ve created on your Synology NAS should be listed.

Select iqn.2022-05.com.linuxhint:pc-01-target and click on Log In.

Click on OK.

You should see a new iSCSI disk. Select it and click on Done.

The iSCSI disk should be selected as the installation destination.

NOTE: In this article, I will do automatic partitioning just to keep things simple. If you want to do manual partitioning, be sure to check the article How to Install Fedora Workstation 35 from USB.

Click on Done.

Now, click on Connect to Red Hat.

Type in the login User Name and Password of your Red Hat account and click on Register.

NOTE: If you don’t have a Red Hat account, you can create one from https://sso.redhat.com.

This computer is being registered with Red Hat. It will take a few seconds to complete.

At this point, your computer should be registered with Red Hat, and a Red Hat license should be attached to it.

Click on Done.

Now, click on Software Selection.

You can select from a few environments1. You can also select additional software for your selected environment2.

Once you’ve selected your desired environment and software for your selected environment, click on Done.

NOTE: I will select the Server with a GUI environment in this article.

Now, click on Network & Host Name.

Type in pc-01 as the hostname and click on Apply.

The hostname of your RHEL 9 installation should be set to pc-011. Click on Done2.

Now, click on User Creation.

Type in your Full name1, login User name2, and check the checkbox Make this user administrator3. Then, type in your login Password4 and click on Done5.

Once everything is set up, click on Begin Installation.

The installation should start. It will take a while to complete.

RHEL 9 is being installed on the iSCSI disk…

RHEL 9 is being installed on the iSCSI disk…

RHEL 9 is being installed on the iSCSI disk…

RHEL 9 is being installed on the iSCSI disk…

At this point, RHEL 9 should be installed on the iSCSI disk. Click on Reboot System.

In the same way, you can install RHEL 9 on the other iSCSI LUN/disk that you’ve created.

Configuring iPXE to Boot from iSCSI Target

Now that you’ve installed RHEL 9 on the iSCSI disks, it’s time to configure iPXE computer-specific boot configuration files so that you can boot RHEL 9 on your computers from the iSCSI disks via iPXE.

To configure pc-01 (which has the MAC address 00:0c:29:5a:e5:56) to boot RHEL 9 from the iSCSI disk pc-01-disk01 (which is mapped to the iSCSI target pc-01-target with the IQN iqn.2022-05.com.linuxhint:pc-01-target), open the iPXE boot configuration file boot-00-0c-29-5a-e5-56.ipxe with a text editor and type in the following lines:

#!ipxe

set initiator-iqn iqn.2022-05.com.linuxhint:ipxe.pc-01
sanboot --filename \EFI\redhat\shimx64.efi iscsi:192.168.0.114:::1:iqn.2022-05.com.linuxhint:pc-01-target

Once you’re done, the iPXE boot configuration file boot-00-0c-29-5a-e5-56.ipxe should look as follows:

Here, iqn.2022-05.com.linuxhint:ipxe.pc-01 is the IQN of the iSCSI initiator name1. It should be the same value as you’ve set in the Installing RHEL 9 on iSCSI LUN section of this article.

iqn.2022-05.com.linuxhint:pc-01-target is the IQN of the iSCSI target of your Synology NAS that you want to log in and boot RHEL 9 from the mapped iSCSI disk pc-01-disk012.

192.168.0.114 is the IP address of your Synology NAS3.

In the same way, you can configure pc-02 (which has the MAC address 00:0c:29:af:38:6a) to boot RHEL 9 from the iSCSI disk pc-02-disk01 (which is mapped to the iSCSI target pc-02-target with the IQN iqn.2022-05.com.linuxhint:pc-02-target). Just open the iPXE boot configuration file boot-00-0c-29-af-38-6a.ipxe with a text editor, type in the same lines as in the boot configuration file boot-00-0c-29-5a-e5-56.ipxe, and make the necessary adjustments.

Booting RHEL 9 From iSCSI Disks via iPXE

Now that everything is ready, you can boot the computer pc-01 via iPXE. Your computer should start booting RHEL 9 from the iSCSI disk pc-01-disk01, as you can see in the screenshot below.

Shortly, you will see the GRUB menu of RHEL 9.

Select Red Hat Enterprise Linux (*) 9.x (Plow) and press <Enter>.

RHEL 9 should boot from the iSCSI disk. You will see the login screen of RHEL 9 as well. Log in to the desktop using the username and password that you’ve set during the installation.

Once you’ve logged in, you can use RHEL 9 on your computer as usual. You won’t need any physical disk installed on your computer.

In the same way, you can boot RHEL 9 on the computer pc-02 from the iSCSI disk pc-02-disk01 via iPXE.

Diskless Booting Other Linux Distributions

If you need any assistance in configuring Synology NAS for diskless booting other Linux distributions from iSCSI disks via iPXE, read the following articles:

  1. How to Configure Synology NAS for Diskless Booting Ubuntu 22.04 LTS via iSCSI and iPXE
  2. How to Configure Synology NAS for Diskless Booting Fedora Workstation 36 via iSCSI and iPXE

Conclusion

In this article, I have shown you how to configure a Synology NAS for diskless booting (from iSCSI disks) RHEL 9 on the computers/servers on your network via iPXE. I have shown you how to configure iPXE to use different iPXE boot configurations for different computers/servers on your network, depending on their MAC address. This way, you will be able to configure/control booting for each of the computers/servers on the network separately and also configure multiple booting. This will also make diskless booting seamless, like booting from local disks.

References

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_a_standard_rhel_installation/iscsi-disks-in-installation-program_installing-rhel

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.