LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to link a file from /var to / ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-link-a-file-from-var-to-4175449760/)

RaviTezu 02-12-2013 01:46 AM

How to link a file from /var to / ?
 
Hi LQ,

I have a Mysql file(which may grow to 14G) residing in /var directory. Total size of the /var is just 10GB,so i want to link(hard/sym) it(if possible..I'm not sure) to some other file(may be a new file) on / dir. As i have 30G of / dir.


Thanks in Advance.

fortran 02-12-2013 02:06 AM

When you are trying to make sym-link using ln -s, does it show link (broken) (inode/symlink) for linked file?
Does it show size approx 10 bytes?
or
Are you implementing it using another method?

ali.abry 02-12-2013 02:12 AM

hard links are only usable in a partition that file is exist.
you can move your file to / and then make symbolic link to var.
symbolic links make in this way :
Code:

ln -s SOURCE-FILE LINK-FILE

smbhandary 02-13-2013 04:12 AM

Ravi, Im not aware of your systems physical configuration, so this suggestion will be vagueish....

If this is long term or not a fun activity, Id suggest get yourself a separate filesystem for mysql and if you cannot migrate your mysql installation from /var to the new mysql filesystem, move your mysql data files to the new filesystem and link the files from there.

Placing non OS files on / is not a good idea...


All times are GMT -5. The time now is 08:10 PM.