SLES系统BtrFS快照的文件系统规划与配置调优问询
SLES系统BtrFS快照的文件系统规划与配置调优问询
我了解到SLES系统采用BtrFS作为根文件系统,还会在系统更新前后自动创建编号快照——要是系统出问题了,还能从旧快照(搭配对应的旧内核)启动,理论上这功能挺贴心的,但实际用起来我碰到了几个具体问题,想请教大家:
- 假设日常系统使用的空间不会超过20GB,那根文件系统该设置多大才合适?
- 如果同时想启用时间线快照,该怎么调整配置才能让快照的磁盘占用保持在可控范围内?
目前我用的snapper配置是这样的(过滤掉了注释行):
grep '^[^#]' /etc/snapper/configs/root
输出内容:
SUBVOLUME="/" FSTYPE="btrfs" QGROUP="1/0" SPACE_LIMIT="0.5" FREE_LIMIT="0.2" ALLOW_USERS="" ALLOW_GROUPS="" SYNC_ACL="no" BACKGROUND_COMPARISON="yes" NUMBER_CLEANUP="yes" NUMBER_MIN_AGE="1800" NUMBER_LIMIT="2-10" NUMBER_LIMIT_IMPORTANT="4-10" TIMELINE_CREATE="yes" TIMELINE_CLEANUP="yes" TIMELINE_MIN_AGE="1800" TIMELINE_LIMIT_HOURLY="10" TIMELINE_LIMIT_DAILY="5" TIMELINE_LIMIT_WEEKLY="3" TIMELINE_LIMIT_MONTHLY="3" TIMELINE_LIMIT_YEARLY="2" EMPTY_PRE_POST_CLEANUP="yes" EMPTY_PRE_POST_MIN_AGE="1800"
我的核心需求是:希望能预留计划磁盘空间的50%给快照,针对这个需求,该怎么调整上面的配置参数呢?
另外附上我当前系统里的快照列表(后续大概率还会增加):
snapper list
输出内容:
# | Type | Pre # | Date | User | Used Space | Cleanup | Description | Userdata ------+--------+-------+--------------------------+------+------------+----------+--------------------------+-------------- 0 | single | | | root | | | current | 1* | single | | Tue Jan 24 12:35:33 2023 | root | 144.00 KiB | | first root filesystem | 27 | single | | Thu Jan 26 10:14:39 2023 | root | 325.28 MiB | | Installation DP CM 11.02 | 42 | single | | Thu Feb 2 14:00:01 2023 | root | 492.13 MiB | timeline | timeline | 5181 | single | | Fri Sep 1 00:00:01 2023 | root | 172.21 MiB | timeline | timeline | 5274 | pre | | Mon Sep 4 11:26:42 2023 | root | 102.06 MiB | number | zypp(ruby.ruby2.5) | important=yes 5275 | post | 5274 | Mon Sep 4 11:29:41 2023 | root | 194.42 MiB | number | | important=yes 5917 | single | | Sun Oct 1 00:00:01 2023 | root | 13.92 MiB | timeline | timeline | 6172 | pre | | Wed Oct 11 14:51:34 2023 | root | 1.23 MiB | number | yast online_update | 6175 | pre | | Wed Oct 11 14:53:16 2023 | root | 97.12 MiB | number | zypp(ruby.ruby2.5) | important=yes 6176 | post | 6175 | Wed Oct 11 14:56:43 2023 | root | 304.00 KiB | number | | important=yes 6177 | post | 6172 | Wed Oct 11 14:56:54 2023 | root | 256.00 KiB | number | | 6178 | pre | | Wed Oct 11 14:58:37 2023 | root | 928.00 KiB | number | zypp(zypper) | important=yes 6179 | post | 6178 | Wed Oct 11 14:58:47 2023 | root | 1.30 MiB | number | | important=yes 6621 | single | | Mon Oct 30 00:00:01 2023 | root | 6.52 MiB | timeline | timeline | 6669 | single | | Wed Nov 1 00:00:01 2023 | root | 6.50 MiB | timeline | timeline | 6789 | single | | Mon Nov 6 00:00:01 2023 | root | 6.47 MiB | timeline | timeline | 6933 | single | | Sun Nov 12 00:00:01 2023 | root | 6.20 MiB | timeline | timeline | 6957 | single | | Mon Nov 13 00:00:01 2023 | root | 5.84 MiB | timeline | timeline | 6981 | single | | Tue Nov 14 00:00:01 2023 | root | 3.48 MiB | timeline | timeline | 7005 | single | | Wed Nov 15 00:00:01 2023 | root | 2.91 MiB | timeline | timeline | 7029 | single | | Thu Nov 16 00:00:01 2023 | root | 464.00 KiB | timeline | timeline | 7032 | single | | Thu Nov 16 03:00:01 2023 | root | 16.00 KiB | timeline | timeline | 7033 | single | | Thu Nov 16 04:00:01 2023 | root | 16.00 KiB | timeline | timeline | 7034 | single | | Thu Nov 16 05:00:01 2023 | root | 64.00 KiB | timeline | timeline | 7035 | single | | Thu Nov 16 06:00:01 2023 | root | 16.00 KiB | timeline | timeline | 7036 | single | | Thu Nov 16 07:00:01 2023 | root | 16.00 KiB | timeline | timeline | 7037 | single | | Thu Nov 16 08:00:01 2023 | root | 32.00 KiB | timeline | timeline | 7038 | single | | Thu Nov 16 09:00:01 2023 | root | 80.00 KiB | timeline | timeline | 7039 | single | | Thu Nov 16 10:00:01 2023 | root | 128.00 KiB | timeline | timeline | 7040 | single | | Thu Nov 16 11:00:01 2023 | root | 272.00 KiB | timeline | timeline | 7041 | pre | | Thu Nov 16 11:50:58 2023 | root | 512.00 KiB | number | yast online_update | 7042 | pre | | Thu Nov 16 11:52:45 2023 | root | 1.27 MiB | number | zypp(ruby.ruby2.5) | important=yes 7043 | post | 7042 | Thu Nov 16 11:56:35 2023 | root | 560.00 KiB | number | | important=yes 7044 | post | 7041 | Thu Nov 16 11:56:42 2023 | root | 464.00 KiB | number | | 7045 | pre | | Thu Nov 16 11:58:15 2023 | root | 768.00 KiB | number | zypp(zypper) | important=yes 7046 | post | 7045 | Thu Nov 16 11:58:27 2023 | root | 320.00 KiB | number | | important=yes 7047 | single | | Thu Nov 16 12:00:01 2023 | root | 176.00 KiB | timeline | timeline | 7048 | single | | Thu Nov 16 13:00:01 2023 | root | 32.00 KiB | timeline | timeline |
备注:内容来源于stack exchange,提问作者U. Windl
相关产品推荐
相关产品推荐

