“/var/cache/fscache”目录过大

配置文件是/etc/cachefilesd.conf

stop cachefilesd服务

1
2
3
4
5
6
7
8
[root@wds020 I03nfs]# service cachefilesd status
cachefilesd (pid 3986) is running...
[root@wds020 I03nfs]#
[root@wds020 I03nfs]# service cachefilesd stop
Shutting down cachefilesd: [ OK ]
[root@wds020 I03nfs]# service cachefilesd status
cachefilesd is stopped
[root@wds020 I03nfs]#

目前仅停止了cachefilesd服务,下面暂时未做

1
2
3
4
5
6
7
8
9
10
11
12
13
# 找一个空间足够的分区,创建一个cache目录
[root@wds020 ~]# cd /local_data
[root@wds020 local_data]# mkdir cache

# 将原来cache目录下的内容拷贝到新建的cache目录中
$ cp -ar /var/cache/fscache/cache/* /local_data/cache/

# 将原来的cache目录删除
$ cd /var/cache/fscache/
$ rm -rf cache

# 在/var/cache/fscache/目录下创建软连接,指向新建的cache目录
$ ln -s /local_data/cache /var/cache/fscache/cache

先使用cache下的一个子目录@c4实操测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
[root@wds020 I03nfs]# pwd
/var/cache/fscache/cache/@4a/I03nfs
[root@wds020 I03nfs]# du -sh ./*
8.3M ./@48
75G ./@49
3.3G ./@bb
44G ./@c4
14M ./@c6
[root@wds020 I03nfs]#
[root@wds020 I03nfs]# mkdir /local_data/\@c4
[root@wds020 I03nfs]# ll -d /local_data/\@c4/
drwxr-xr-x 2 root root 4096 Jan 17 13:21 /local_data/@c4/
[root@wds020 I03nfs]#
[root@wds020 I03nfs]# cp -ar \@c4/* /local_data/\@c4/
[root@wds020 I03nfs]# rm -rf \@c4
[root@wds020 I03nfs]# ln -s /local_data/@c4 \@c4
[root@wds020 I03nfs]# ll
[root@wds020 I03nfs]# ll
total 16
d--------- 3 root root 4096 Jul 18 2023 @48
d--------- 3 root root 4096 Jul 28 15:59 @49
d--------- 3 root root 4096 Jun 12 2023 @bb
lrwxrwxrwx 1 root root 15 Jan 17 13:34 @c4 -> /local_data/@c4
d--------- 3 root root 4096 Jan 26 2023 @c6
[root@wds020 I03nfs]#
[root@wds020 I03nfs]# df -h | grep -v tmpfs
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 197G 127G 61G 68% /
/dev/sda3 290G 116G 160G 42% /local_data
172.16.66.201:/proj/wxtools
8.4T 13M 8.4T 1% /proj/wxtools
172.16.66.202:/misc/upload
1.5T 561G 899G 39% /var/run/upload
[root@wds020 I03nfs]#

课程中心

在线课程