Step by step guide to merge disks in Linux on Hetzner Dedicated Server
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.
|
|
|
|
|
|
Posted with STEMGeeks
I prefer to not use swap partition and handle it manually (if needed). I also like to give 1G to /boot, then rest to /.
I also like ZFS personally, but with only two disks and a remote machine I end up going LVM as well.
I am no used to this type of server ! But it is a great tutorial
!1UP
You have received a 1UP from @gwajnberg!
@stem-curator, @vyb-curator, @pob-curator, @neoxag-curator
And they will bring !PIZZA 🍕.
Learn more about our delegation service to earn daily rewards. Join the Cartel on Discord.
I gifted $PIZZA slices here:
@curation-cartel(10/20) tipped @balaz (x1)
Join us in Discord!
This post has been manually curated by @bhattg from Indiaunited community. Join us on our Discord Server.
Do you know that you can earn a passive income by delegating to @indiaunited. We share 100 % of the curation rewards with the delegators.
Here are some handy links for delegations: 100HP, 250HP, 500HP, 1000HP.
Read our latest announcement post to get more information.
Please contribute to the community by upvoting this comment and posts made by @indiaunited.
Congratulations @balaz! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
Your next target is to reach 8000 upvotes.
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Check out the last post from @hivebuzz:
Support the HiveBuzz project. Vote for our proposal!
Congratulations @balaz! You received a personal badge!
You can view your badges on your board and compare yourself to others in the Ranking
Check out our last posts:
Support the HiveBuzz project. Vote for our proposal!