Delete syslog but size disk can't increase


 
Thread Tools Search this Thread
Operating Systems Solaris Delete syslog but size disk can't increase
# 1  
Old 09-27-2012
Delete syslog but size disk can't increase

Hi Experts,

I have a problem wih /var. Disk /var is full. After i investigate, i found file /var/log/syslog.0 is growing rapidly. The size is 4.3G. I tried to move syslog.0 to another disk and file was moved successfully.

My question is why size /var can't increase? used space still 100%.

When i check the size of syslog.0 in place that i moved, the size is 4.3G. But free space of /var still 0%

I'm using Solaris 10.

Please share your thought/experience.


Thanks
Edy
# 2  
Old 09-27-2012
If that file is still open and used by e.g. syslogd, it cannot be unlinked and still exists on the disk, probably with another name. If existent on your system, try lsof to check open files. Some syslogds react on kill -HUP by closing their files (and doing other things, read man page!) and releasing allocated disk space.
# 3  
Old 09-27-2012
Hi Rudic,

Thanks for your valuable suggestions.

I found process syslogd. I must stop the syslogd process before delete file or what?

if i delete this file, there is no impact to the system?

it's save if i used command > /var/log/syslog.0 ?

Sorry for my basic question, because i'm newbie in solaris.

Thanks
Edy

Last edited by edydsuranta; 09-27-2012 at 05:51 AM..
# 4  
Old 09-27-2012
Are you able to identify the files opened by process syslogd (e.g. lsof -c syslogd)? Check the man page for ways to talk to syslogd, e.g. kill -HUP, so you can tell it to close its files without stopping the process.
# 5  
Old 09-27-2012
If you've deleted the file, then you have to kill whatever process has it open to close and remove it from disk.

If you hadn't deleted the file, you could've simply truncated it -- overwritten it with an empty file -- to reduce its size to zero.
# 6  
Old 09-30-2012
Quote:
Originally Posted by Corona688
If you've deleted the file, then you have to kill whatever process has it open to close and remove it from disk.

If you hadn't deleted the file, you could've simply truncated it -- overwritten it with an empty file -- to reduce its size to zero.
Not necessarily.

It would depend on how the file is being written to by the process(es) that are writing to the file, and the file system in use.

If the file is being written to in append mode, truncating the file out from under the process(es) will probably work to reduce its size permanently.

If it's not being written to in append mode, after you truncate it down from, say, 10 GB to zero, the next time the process(es) write to the file, they'll still do so at the old 10 GB file offset. What happens then depends on whether or not the underlying file system supports sparse files.

And that's just if you're doing it all on a single machine. If it's a shared file (NFS, some other shared file system), things can get really fun.
# 7  
Old 10-01-2012
Try this first:
syslogd responds to the SIGHUP signal.
So, edit the entries in the /etc/syslog.conf to direct to another file eg /someplace/log/syslog instead of the current setting. After that,
Code:
kill -HUP <pid of syslog daemon>

to "reinitialize" the config


If that does not meet your needs then:
This stops the sylogd process, which is not a good idea longterm
Code:
svcadm disable svc:/system/system-log:default

Delete files, edit the syslog.conf file to suit your needs. Since the log is filling up fast you might want to turn of some of the less useful messaging.
Turn syslog back on
Code:
svcadm enable svc:/system/system-log:default

This User Gave Thanks to jim mcnamara For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Increase disk size of guest domain

Host System: SPARC S7-2 Server; 2x8-core CPUs; 128Gb RAM; 2x600Gb HDD. running Solaris 11.3. Last login: Tue Sep 19 14:42:42 2017 from xxx.xxx.xxx Oracle Corporation SunOS 5.11 11.3 June 2017 $ uname -a SunOS sog01 5.11 11.3 sun4v sparc sun4v $ Original physical systems: Sun... (0 Replies)
Discussion started by: apmcd47
0 Replies

2. SCO

Increase disk size on OS side on the fly

Hi, I'm Linux administrator who happens to 'administer' SCO Unix 5.0.7, which is virtual server on VMware - deployed from official ovf image. My problem is that root filesystem is almost out of disk space, and we've decided to do it as we do on every other virtual servers and extend disk on... (13 Replies)
Discussion started by: goldenboy
13 Replies

3. What is on Your Mind?

How Can We Increase the Size of Our Community?

Any suggestions on how to increase the number of posters and contributors? Please vote and write in your suggestions. Thank you! (72 Replies)
Discussion started by: Neo
72 Replies

4. UNIX for Dummies Questions & Answers

Increase size to sd[b-c]

hi guys I am working on my vmware workstation. I have a /dev/sdb which is 5GB. I am using LVM. Now I increase /dev/sdb 2 more GB. fdisk -l shows 7 GB but pvscan still shows 5GB. how do I make my system recognize the new 7GB added and be able to add those to my physical volumen and... (1 Reply)
Discussion started by: kopper
1 Replies

5. AIX

How to increase Virtual Disk size

Hello, I am working AIX VIO server and extended Virtual Disk of one of the Partition with 10GB. After starting partition, i am not able to see increased size of disk. Can you please help me what I need to do to increase the size of virtual disk from partition? Thanks Kishor ... (7 Replies)
Discussion started by: kishorbhede
7 Replies

6. UNIX for Dummies Questions & Answers

Increase salt size

Unix protect its password by using salt It that mean larger the salt size the more secure? if the salt size increase greatly, will the password still able to be cracked? thank you for helping (1 Reply)
Discussion started by: cryogen
1 Replies

7. Solaris

increase Root size

Dear all, I am very new to solaris, I have installed solaris 10, i tried installing few softwares into file system, unfortunately system failed to install stating "No space left on device " i searched few threads and it says, we have to increase root size. where my root size is... (2 Replies)
Discussion started by: radhnki
2 Replies

8. UNIX for Dummies Questions & Answers

How to increase process size ???

Hi All, Could anybody tell me how to increase/decrease a process size in UNIX HP machine ? Whether the process size limitation will cause core dump ? Thanks, Rohit.. (1 Reply)
Discussion started by: ronix007
1 Replies

9. UNIX for Dummies Questions & Answers

How to increase the filesystem size?

Hi.. I want to increase the file system size of any filesystem online, without using the Volume manager like LVMs, is it possible? & if yes then how? (3 Replies)
Discussion started by: Amol21
3 Replies

10. HP-UX

increase size

Hi All, one of the mount point in Hp ux server has reached 95% its a data base file and can not be deleted. so i want to know how to increase the size of mount point i am new to unix ,please help me (1 Reply)
Discussion started by: jyoti
1 Replies
Login or Register to Ask a Question