LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-25-2013, 03:36 AM   #1
hahacc
Member
 
Registered: Oct 2010
Posts: 87

Rep: Reputation: 1
Question can I make /var a symbolic link


Hi guys,
Currently my /var is on its own partition. But as the free space of /var is now only several Mb, so I want to do this:

Code:
cd /
cp -a /var /Backup
mv /var /var.bak
ln -s /Backup/var var
Is this ok to do this? Thanks in advance.
 
Old 10-25-2013, 03:44 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Should be good to go. Just dont do this on a running system that has var mounted.. Also this might work it can go wrong. Boot into a lifesystem to do this. And as you should boot a lifesystem you can also take a look if you can resize the partition of /var. And then dont need to copy stuff around.

Nother thing that comes to my mind is that there might be programs that dont like to be run through a symlink. But those are few. But to be extra sure you could rebind the part of the filesystem where the new var is and mount it under /var. Check out the man page of mount.
 
1 members found this post helpful.
Old 10-25-2013, 03:49 AM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,103

Rep: Reputation: 181Reputation: 181
check out this thread below, it might give you an idea

http://www.linuxquestions.org/questi...ve-var-199391/

if you move var to another drive or partition, i guess it should work but i'm not sure.

Quote:
better try it on a virtual machine, delete the /var directory on the virtual hard drive.

Plug in a FAT or NTFS thumb drive, create a /var directory and check how it goes.

Edit fstab to make sure it knows where is /var located.
try it on a virtual machine before rolling out to the production

Last edited by JJJCR; 10-25-2013 at 03:50 AM. Reason: edit
 
1 members found this post helpful.
Old 10-25-2013, 04:01 AM   #4
hahacc
Member
 
Registered: Oct 2010
Posts: 87

Original Poster
Rep: Reputation: 1
Thumbs up

Quote:
Originally Posted by zhjim View Post
Should be good to go. Just dont do this on a running system that has var mounted.. Also this might work it can go wrong. Boot into a lifesystem to do this. And as you should boot a lifesystem you can also take a look if you can resize the partition of /var. And then dont need to copy stuff around.

Nother thing that comes to my mind is that there might be programs that dont like to be run through a symlink. But those are few. But to be extra sure you could rebind the part of the filesystem where the new var is and mount it under /var. Check out the man page of mount.
Thanks a lot! I moved /var to another partition and it worked.

---------- Post added 10-25-13 at 04:01 PM ----------

Quote:
Originally Posted by JJJCR View Post
check out this thread below, it might give you an idea

http://www.linuxquestions.org/questi...ve-var-199391/

if you move var to another drive or partition, i guess it should work but i'm not sure.



try it on a virtual machine before rolling out to the production
Thanks, I tried on one test box and it worked.
 
Old 10-25-2013, 04:02 AM   #5
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Another happy fellow
 
Old 10-25-2013, 04:55 AM   #6
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
Should be good untill you don't know /var is the directory where multiple most required files reside including default location for DNS zone files, FTP's default and many more...

In your case it should have no severe effect because of you managed to make a symlink back to the same place but yes some programs would not like the way it would be!!! (depends upon when the check for /var directory performs it should returns true)

Quote:
But as the free space of /var is now only several Mb, so I want to do this
the above would be a temporary fix in that condition, i would recommend what @zhjim has suggested to resize /var.
 
1 members found this post helpful.
Old 10-25-2013, 05:21 AM   #7
hahacc
Member
 
Registered: Oct 2010
Posts: 87

Original Poster
Rep: Reputation: 1
Wink

Quote:
Originally Posted by SAbhi View Post
Should be good untill you don't know /var is the directory where multiple most required files reside including default location for DNS zone files, FTP's default and many more...

In your case it should have no severe effect because of you managed to make a symlink back to the same place but yes some programs would not like the way it would be!!! (depends upon when the check for /var directory performs it should returns true)



the above would be a temporary fix in that condition, i would recommend what @zhjim has suggested to resize /var.
Thanks pal for the remind. I would do the resizing work when ready.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can I make a symbolic link that is dynamic link->$HOME/file? croog Linux - General 4 10-14-2012 08:55 PM
symbolic link from /var/www/html NirvanaBaby Linux - Server 8 07-30-2012 07:15 AM
Apache2 root server showing directory contents of a symbolic link in the /var/www dir rtoney5 Linux - Server 7 09-03-2010 08:50 PM
Symbolic Link For FTP Access To /var/www/html ERRRRRRRRRRRR! JustinK101 Linux - Software 3 01-31-2007 12:32 PM
How to make symbolic link? Tommi Linux - General 9 05-07-2003 09:58 AM


All times are GMT -5. The time now is 10:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration