Created
November 10, 2014 14:19
-
-
Save mvisonneau/a2e738ea6523303c5322 to your computer and use it in GitHub Desktop.
Free space from locked files without restarting process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@hostname:/var/log# df -h | grep lv_var | |
/dev/rootvg/lv_var 992M 943M 0 100% /var | |
root@hostname:~# pidof mysqld | |
17431 | |
root@hostname:~# lsof -p 17431 | grep deleted | |
mysqld 17431 mysql 1w REG 252,5 1 32994 /var/log/mysql/error.log.1 (deleted) | |
mysqld 17431 mysql 2w REG 252,5 1 32994 /var/log/mysql/error.log.1 (deleted) | |
mysqld 17431 mysql 4w REG 252,5 1 32987 /var/log/mysql/mysql-slow.log.1 (deleted) | |
root@hostname:~# cd /proc/17431/fd | |
root@hostname:/proc/17431/fd# echo '' > 1 | |
root@hostname:/proc/17431/fd# echo '' > 2 | |
root@hostname:/proc/17431/fd# echo '' > 4 | |
root@hostname:/proc/17431/fd# df -h | grep lv_var | |
/dev/rootvg/lv_var 992M 200M 742M 22% /var |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment