When we purchase a dedicated server on Hetzner, we usually get two disks each with 512 GB of memory. Of course, it depends on what disk space you select and the server specs you choose. But most of the time when we purchase the server, the disk is usually not one whole disk. I was looking for solutions online to find out how I can merge both disks and use them as one whole disk with around 1 TB of space for my server.
This is when I came up with a few tutorials that helped me do this. I wanted to compile all the steps in one document so that it is easy for the readers.
Step 1: Log in to the Hetzner console
Hetzner provides us with a nice and simple tool that helps in managing our server. The first step is to log in to the server and do an automatic hardware reset. I was initially confused by this option and was worried that I would lose my data. But it was just the hard reset button we see on our desktop machines.
After the reset is done, we have to log in to the Rescue system. If you look at the above image, there you can find the next tab that says Rescue. Inside that, you will find options to boot your server to the rescue system. If you select that option, you would get a password generated and that password can be used to log in to the rescue system.
Step 2: Boot to your server inside the rescue system
After you reboot your server, you will automatically get connected to the rescue system. This is where we can do configurations on our server and do the initial setup.
Step 3: Type installimage
and follow the commands
This is the next step to install your operating system with the help of the console. You can also install it from another image. The option provides multiple actions that you can perform.
If you select any of the operating systems from the list you see above, there will be a configuration window displayed. This will open an install.conf file with the standard configuration. If you don't make any changes to this file and continue as it is the disk space you finally get on your machine would be only 512 GB. This is where we have to make changes and merge both our disks.
As you see in the above screenshot, SWRAID 1 should be retained and SWRAIDLEVEL 0 should be set. This will set up the hard drives. You can also enter your desired HOSTNAME.
The 3 lines of code highlighted above should be deleted. Some people might even find 4 lines of code there. It can be removed.
Step 4: Enable and setup LVM
You have to find the place where LVM is commented and it should be uncommented. Along with these 4 lines, the PART comment should also be uncommented. The PART lines would give 512 M for us in the boot and the rest can be configured in LVM.
The above is what the default would look like. I don't want to use the defaults and would like to change the LV configurations. I configured it similar to the one below.
This will basically put all my storage on one partition called root. If you would like to split it, you can go ahead and do it accordingly and based on your need. The same applies to swap and tmp. I have 10G for both and you can have whatever values you want.
After you are done, you can hit F10 to save it.
As we are making configurations to the disk, there would be a question saying that the existing drives would be deleted. As this is the very first step and we don't have any data already in the drive, it is safe to go ahead and delete them. Based on the number of disks you have, you would get multiple confirmations similar to the above.
Note: People who are trying to do this activity on an existing drive should make sure their data is backed up as this will clear the drives.
The configuration is fully done and you will start seeing something like the above that starts installing the image for you with the new disk configurations. In my case, I was installing Ubuntu.
Based on the operating system you choose and the server specs this can take some time to complete. You can relax until it is done. After it is done, you can reboot the server with the command reboot
.
This will get you out of the rescue system and login you to Ubuntu. The password would be the same as the password you had for the rescue system. You can then make changes to the credentials accordingly.
If you look at the above screenshot, the disk size is displayed as 916 GB which means that what we tried to do has worked out. Both the drives have been combined into a single partition with around 1 TB of disk space. Your server is now ready and you can continue your other activities.
If you like what I'm doing on Hive, you can vote me as a witness with the links below.
|
|
|
|
|
|