How to use soft link to resolve disk space issue - CloudMinister

How to use soft link to resolve disk space issue


One of my client is facing disk space issue on his Cheap Linux VPS Server but disk space is still available there in another partition .
He asked me for help.
I checked disk space on his server and I got below results:
root@server [~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_server-lv_root 50G 45G 2.5G 95% /
tmpfs 7.8G 0 7.8G 0% /dev/shm
/dev/sda1 477M 77M 376M 17% /boot
/dev/mapper/vg_server-lv_home 860G 2.7G 814G 1% /home

In this tutorial I am going to use /var folder disk space in /homefolder with the help of soft link concept
As we can see that space is available more then 800GB in /home partition but we are facing issues in / partition due to log folder is making disk space full in / partition.

Client asked me why his Reliable Managed Linux VPS Server is crashed again and again due to space issue his backup is also failing due to this.

I explained his that there is only 50 GB space is assign to / directory and its already full.
There are 2 ways to resolve this issue.

One that he reassign space from /home to /.

but its create some issue server down, data lose and he is already don’t have backup from more then 1 week.

So we decided to use other solution
We used soft link as a solution we moved his /var/log folder to /home/var/ directory and then created soft link form /var/log to /home/var/log to resolve his issue.

here is standard command to create soft link:
ln -s path-to-actual-folder name-of-link

to confirm, do:
ls -ld name-of-link

We ran following command on server to create soft link:
ln -s /home/var/log/ log

then we verified it with command:
root@server [/var]# ls -ld log
lrwxrwxrwx 1 root root 14 Jun 16 03:03 log -> /home/var/log/

we have restarted all services on his server and also check his website everything is working fine.

Learn how to scale, manage, and optimize your applications with a SLB. Read our solution brief "Get More from Your Enterprise Network".


Get started with CloudMinister Today