1

I have a new Hetzner cloud server and added an extra 50GB disk volume (CEPH) to my server. The default disk is only 40GB. I thought it would be added to the default storage like the traditional servers but now I have two disks. I would appreciate if you help me how can I configure the partition scheme to have the maximum amount of /var partition to store my websites. Here is the current partitions schema:

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0 38.2G  0 disk
└─sda1   8:1    0 38.2G  0 part /
sdb      8:16   0   50G  0 disk /mnt/HC_Volume_1557115

Plesk for Linux OS stores user data in the /var directory, by default, so the partitioning should be set up as follows:

SWAP -> (2GB – 8GB Equal to the amount of RAM)
/boot -> 256 MB
/ -> OS and Plesk updates, At least 10 GB, 20GB is recommended.
/tmp -> greater than 4 GB for Plesk 11.0 and later
/var -> the rest of the space (domains, mail, backups, and databases are stored there)

Plesk partition details

1

2 Answers 2

1

I couldn't install CentOS from the scratch on Hetzner cloud server using their ISO, and I wasn't able to add my own ISO image. But you can follow these steps to add Hetzner storage as a new /var partition. I've done this on a production server and it is working like a charm.

First Mount the additional Storage:

Format Using Hetzner Command:
sudo mkfs.ext4 -F /dev/disk/by-id/scsi-0HC_Volume_1500115

Then Reboot in Rescue Mode. I think you should know how to do that or do a simple search. in rescue mode we backup the old /var and unmount it, then we mount the new disk as /var partition:

mkdir /mnt/root
mount /dev/sda1 /mnt/root
mkdir /mnt/newvar
mount /dev/sdb /mnt/newvar
cd /mnt/root/var
cp -R * /mnt/newvar
#(Get the UUID of the Disk via blkid /dev/sdb)
blkid /dev/sdb
#cp /mnt/root/etc/fstab /mnt/root/etc/fstab.orig
vi /mnt/root/etc/fstab
>> UUID=<UUID from blkid> /var ext4 defaults 0 2
cd
mv /mnt/root/var /mnt/root/var_old
mkdir /mnt/root/var
umount /mnt/root
umount /mnt/var
reboot

Test the new /var partition and if it's ok, you can safely remove the old /var to free more space.

0

One good way to do it is creating a LVM logical volume spanning on the two physicals volumes.

Take care, since enabling LVM requires changing the partitions types you'll need to erase and restore your server.

Actually one could follow those instructions, which may prove useful to understand what's going on if you're not used to LVM setups : https://www.linux.com/learn/weekend-project-migrate-direct-partitions-lvm-volumes

I found easier to boot on CentOS's DVD and defining the expected partition scheme using the GUI. I ended up with that setup, after having specified that I wanted to use the two drives (forgot to screenshot the first step sorry) : https://mattlabs.gaillet.be/nextcloud/index.php/s/EoPfQ8ZRNBMX9yJ

Tell me if it succeeded for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .