In the example below /dev/sdb was presented to the VM. You would use whatever disk was presented in your setup.
- Get the disks presented to the system
fdisk -l
- Create the partition on the disk. Using fdisk but you can use others i.e. gdisk
fdisk /dev/sdb
Type **n** for new partition and you can take the defaults to the end.
Type **p** for print and make sure that everything is good, and then press **w** to write the changes.
- Format the partition using xfs and ensure d_type is supported.
mkfs.xfs -n ftype=1 /dev/sdb1
- Mount the partition to a temp location so we can move files
mount /dev/sdb1 /mnt
-
Before we start the work ensure that all of the sessions have had the work saved and committed, and the sessions stopped.
-
Stop gravity on the server
systemctl stop gravity__gravitational.io__planet-dbtools__5.1.4-1906-2.service
systemctl stop gravity__gravitational.io__teleport__2.4.7.service
- Disable the services so that things do not start up while work is being done
systemctl disable gravity__gravitational.io__planet-dbtools__5.1.4-1906-2.service
systemctl disable gravity__gravitational.io__teleport__2.4.7.service
- Start the copy of the files
cd /mnt
cp -av /var/lib/gravity .
- After the copy is done need to move the files up one directory
cd /mnt/gravity
cp * ../
- Move out of the directory and unmount
cd
umount /mnt
-
Edit the /etc/fstab file to permanently create the new mount point. If there is an existing mount for /var/lib/gravity comment it out, and set up the new mount point similar to the below example.
# Adding the line below in the /etc/fstab file /dev/sdb1 /var/lib/gravity xfs defaults,noatime,nodiratime 0 0
-
Mount the mounts and check to ensure the /etc/fstab file is good to go.
mount -a
- Check to make sure you see the mount /var/lib/gravity using /dev/sdb1
df -h
- Enable and start gravity back up
systemctl enable gravity__gravitational.io__planet-dbtools__5.1.4-1906-2.service
systemctl enable gravity__gravitational.io__teleport__2.4.7.service
systemctl start gravity__gravitational.io__planet-dbtools__5.1.4-1906-2.service
systemctl start gravity__gravitational.io__teleport__2.4.7.service
- Enter gravity and make sure that things start up properly
gravity enter
watch kubectl get pods