1

On my support machine, my / filesystem is very small and I frequently get alerts.

df -h /
Filesystem                Size  Used Avail Use% Mounted on
/dev/mapper/vg00-lv_root  7.8G  6.6G  805M  90% /

How can I create symlink for / filesystem so that size of all logs, its files or applications will be reflected to a different filesystem - as /data mount has lot of space.

-1

It sounds like what you want to do is create a symlink from / to /data.

Which would be:

ln -s / /data

However that sounds like it will re-direct all items on your OS to /data rather than some of them.

Rather, it would probably be better to re-direct a certain logfile to this /data volume. The example below will create a symbolic link (-s) from /var/log/ to /data/log.

ln -s /var/log/ /data/log/

See the manual page for ln for more information.

  • Hello, thanks for your reply. how ever even after adding softlinks, my disk utization is showing same. may be i am doing something wrong .. here is the o/p before softlink => #-> df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg00-lv_root 7.8G 6.3G 1.2G 85% / Creating soft link as mysqld logs are here ==> #-> ln -s /usr/sbin/ /data/sbin (after soft link is created, checking again ) #-> df -h / Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg00-lv_root 7.8G 6.3G 1.2G 85% / – Kumar Aug 31 '18 at 3:19
  • Did you try your suggestion (or one similar)? ln -s / /data will error out with, ln: failed to create symbolic link '/data': File exists – roaima Sep 9 '18 at 22:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.