Hello, I want to increase the size of the disk but my hosting provider doesn’t easily let me do that. Instead I want to deploy a new disk /dev/vdc1
So I can move SOME of the clients to that new disk
I would mount /disk2/home/
Will it work if i just? :
service exim stop
service dovecot stop
cp -a $origin $destination
rm -Rf $origin
ln -s $destination $origin
service exim start
service dovecot start
Probaly best solution would be to expand the filesystem with lvm or a similar filebased system. So you would have one partition which can be expanded over multiple files.
so what i do is
mounting new disk/volume
then
create new directory such as “newhome”
and i rsync home folder with newhome
the last one is
mounting folder “newhome” inside newdisk/volume as home folder
set the /etc/fstab
so when the rebooting the mount newhome will stay not lose
and it works
but cannot some clients it move all the clients
in return i got new space and big storage for home folder
wait…it seems got problem…hehehehe
let me tested again
so the step above is not completely wrong
but must be carefull and recheck one by one
but should stop all services before continue
the most better way is before you set up hestia better you mount it first
and it works
Although @Raphael had a wonderful idea, I took my risks with a variant of @jtdoank because lvm does not allow to downsize easily.
#I ommited the test parts that check if origin is a symlink and if destination has not been previously created.
#set origin and destination
origen="/home/$1"
destino="/home2/$1"
origenb="$origen/"
destinob="$destino/"
#stop all services
#/usr/local/hestia/bin/v-list-sys-services | grep running | cut -d" " -f1 | xargs -I {} sh -c "echo 'Parando {}'; service {} stop; echo 'Fin.'"
#stop some services (I tried with all and took very long) I am also not hosting websites in that server.
service bind9 stop
service dovecot stop
service exim4 stop
#copy files to destination
mkdir $destino
rsync -alH $origenb $destino
#remove files on origin
chattr -i $origen/conf
rm -Rf $origen
#create link
ln -s $destino $origen
#start all stopped services
/usr/local/hestia/bin/v-list-sys-services | grep stopped | cut -d" " -f1 | xargs -I {} sh -c "echo 'Iniciando {}'; service {} start; echo 'Fin.'"
For now, all my tests seem to work.
___ EDIT ____
Problem1:
Okay. Had trouble with permissions and bind.
Very subtle stuff. Migrated DNS zones didn’t load correctly.
Fix:
EDIT /etc/apparmor.d/local/usr.sbin.named
ADD LINE: /home2/** rwm,
Problem2: Maybe unrelated
rc-local.service didn’t load upon restart.