Welcome! Log In Create A New Profile

Advanced

How to re-direct all logs to a second flash drive

Posted by davidnewton 
How to re-direct all logs to a second flash drive
April 09, 2011 01:55PM
My dockstar works fine with debian squeeze running asterisk, lighttpd, samba and cups. It looks like that there are many logging activities in the /var/log directory. To reduce the flash drive wearing, I would like to re-direct all the logs to another flash drive. Is there a way to mount or link /var/log to another drive? Thanks in advance.

UPDATE: found the answer. Please ignore. Thanks.



Edited 1 time(s). Last edit at 04/09/2011 02:19PM by davidnewton.
Re: How to re-direct all logs to a second flash drive
April 10, 2011 04:35AM
It would be nice if you can post the solution also here. Thanks.
Re: How to re-direct all logs to a second flash drive
April 10, 2011 06:04AM
Mounting the /var directory on the second drive, through /etc/fstab should be it. Copying everything over from the existing /var-directory before using the new drive is needed, if you want to use the trick on a system that was already used. And then rename the old dir, just to make sure.

That should be all that is needed to make it work, if I didn't forget something.
Re: How to re-direct all logs to a second flash drive
April 10, 2011 12:29PM
ingmar_k Wrote:
-------------------------------------------------------
> Mounting the /var directory on the second drive,
> through /etc/fstab should be it. Copying
> everything over from the existing /var-directory
> before using the new drive is needed, if you want
> to use the trick on a system that was already
> used. And then rename the old dir, just to make
> sure.
>
> That should be all that is needed to make it work,
> if I didn't forget something.

This is basically what I did. I mount the second drive to /var/log directory in rc.local file. Probably using /etc/fstab file would be better.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: