can i umount var filesystem??
hello,
i wanna umount the /var directory.ideally when i do that i will show " device busy " now if i kill all the processes that are working on the directory, i should not get device busy error. but how do i find ,which all processes are working on var directory??? so that i can kill them. or is ther any other approach to it?? regards rakesh |
lsof can retrieve info on open files for a device - have you looked at man lsof yet to see if it does it in a way that you can use?
|
lsof gives me list of open files n sockets.
wot i want is list of processes that are working on /var directory, i.e processes that are responsible for writing in /var/log/messages file and all such other files. so that if possible,i can kill them one by one to get out of device busy problem. thanx for reply regards |
i dont know whehter it is a good idea to umount /var completely but maybe you can simply
umount -l /var |
Tha magic command is fuser:
Code:
catunda@fabio ~ $ fuser -vm / |
This would work on my MEPIS 3.3.2 system, if I let it.
The 1 tweak you might have to make is to adjust the field ("$9") that awk prints to your ver. of lsof. Code:
dir='/var' |
many many thnx to all who replied.
but will the shell script that u've sent do that safely. bcoz when i tried to kill processes that work on /var, certain critical processes were killed and this led to an immediate logout. though i m trying with ur alternative,if results come out ,will let u know. |
Why do you want to umount /var while running the system?
It's an essential directory.. You could go to runlevel 1 and unmount it, do your stuff, remount it and go back to your current runlevel. |
i hv an embedded box that internally uses linux,
i m working on memory related issues,wherein i need to think of alternatives to get up some more memory if system goes out of memory, so i m thinking of options that i can try,one of which is getting space from /var. i dont know whether this approach is correct or not, nd ur feedback would be appreciated. |
Quote:
|
just type command
#umount /proc or #umount /var n u will get a message device is busy this is wot device busy problem is all about. |
Unmounting /var will not change anything to disk space (you are mixing memory:RAM and disk space)
Unmounting will remove the hard disk partition /var from the filesystem hierarchy. The space will not be freed. It all depends on what embend device you are working on. You could completely remove /var. Because -> The system is stable and you don't need any log anymore to analyze problems. /var keeps the logfile so it's interesting in case of crash -> The system is not security-sensitive. /var also contains all connection access made to the board. -> Most important: it is on flash. flash has limited Read/Write number. Every time somebody would connect to the webserver on the board for example, linux will happily write one line in /var/something. This is unacceptable for flash memory. As said, remove /var completly. rm it and remove it from fstab. Then you have a new partition. Or you have a running process that deletes some big uneeded files every xx hours/days. |
Thats true, if you unmount /var the space will still be used!
And if you have flash memory you should mount your /var on RAM memory space, this way you can access log files while the machine is up, or you can manage syslog to log on a remote machine, anyway, do not freak your flash memory with logs! lol []īs, FMC! |
yes wot u said is rite,if i directly umount /var it wont help me at all as far as memory is concerned,
but wot if i systematically kill all the processes that r working on /var, and that do not have dependencies on other processes and then umount it???? wont that case help me to some extent??? |
"Mounting" is a logical operation, not physical.
In general, you first physically create the partition by allocating space and then you need to mount it to "insert" it to your / 1) You can only clear (or format if you prefer) an unmounted partition. 2) You can only unmount a partition if no files are opened on it. So unmount will help you for 1) but nothing else. Putting it in RAM is another solution. |
All times are GMT -5. The time now is 03:00 PM. |