• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Moving data to other partition

Frater

Regular Pleskian
I just took a server at a hosting service where I already have several Plesk servers running.
The servers I already have running are equipped with 2 conventional disks in RAID1

This new server is equipped with a 2 x 2 TB and a 128 GB SSD disk.
With a setup wizard you can install Plesk which comes with licenses.

This new server has a bit different partition model where /var is mounted on the SSD and there's a /data that's mounted on the 2 TB RAID.
This /data will then not be used for Plesk.

I can think of many scenarios to change this, but I don't want to find out in the near future that back-ups aren't working because I'm using a symlink somewhere (just an example).
The increased speed of the SSD is of course good for the databases, so maybe it's better not to move everything to that partition.


What is the most elegant way?

I'm thinking of creating mount points instead of /var/www , /var/qmail and /var/lib/psa
Copy its content to /data/var/www , /data/var/qmail and /data/var/lib/psa

Then modify /etc/fstab so these will point to the appropriate folder

I think it's more robust and transparent instead of using symlinks.

What do you guys think?
And what are your thoughts about the folders I chose to move?

Apache didn't want to start due to a permission problem..
I think I solved it by making SELINUX permissive
grep SELINUX= /etc/selinux/config
Code:
# SELINUX= can take one of these three values:
#SELINUX=enforcing
SELINUX=permissive

Code:
mkdir -p /data/var/lib/psa
mkdir     /data/var/qmail
mkdir     /data/var/www

rsync -avv /var/lib/psa /data/var/lib/
rsync -avv /var/qmail /data/var/
rsync -avv /var/www /data/var/

mv /var/www /var/www-old
mv /var/qmail /var/qmail-old
mv /var/lib/psa /var/lib/psa-old

mkdir /var/www
mkdir /var/qmail
mkdir /var/lib/psa

mount --bind /data/var/www/       /var/www
mount --bind /data/var/qmail/       /var/qmail
mount --bind /data/var/lib/psa/     /var/lib/psa

Everything should be working now, but it will be lost after a reboot.
To make it stick we need to modify /etc/fstab
Add these lines to /etc/fstab

Code:
# added to save space on SSD
/data/var/www/         /var/www            none defaults,bind 0 0
/data/var/qmail/         /var/qmail            none defaults,bind 0 0
/data/var/lib/psa/       /var/lib/psa        none defaults,bind 0 0

Reboot the system and verify the new settings....
 
Last edited:
I'm still in progress with tweaking my system so I can take advantage of both the speed of the SSD and the space of the conventional disks (2 TB)

The permission of both /tmp and /data/tmp was modified with chmod 1777

My current /etc/fstab ends like this:

Code:
# added to save space on SSD
/data/tmp/                      /tmp                    none defaults,bind 0 0
/data/usr/local/psa/tmp/        /usr/local/psa/tmp      none defaults,bind 0 0
/data/usr/local/psa/PMM/tmp/    /usr/local/psa/PMM/tmp  none defaults,bind 0 0
/data/usr/local/psa/PMM/var/    /usr/local/psa/PMM/var  none defaults,bind 0 0
/data/var/www/                  /var/www                none defaults,bind 0 0
/data/var/qmail/                /var/qmail              none defaults,bind 0 0
/data/var/lib/psa/              /var/lib/psa            none defaults,bind 0 0
 
Last edited:
Back
Top