我尝试在 F23 上配置 snapper 时遇到错误。我的根分区是btrfs,并且我已经安装了snapper包。当我最初尝试创建默认根配置时发生该错误。
当我运行cmd时:
snapper -c root create-config /
终端输出为:
Creating config failed (creating btrfs snapshot failed)
快照程序日志:
2015-11-26 01:55:45 MIL libsnapper(3335) Snapper.cc(createConfig):288 - Snapper create-config
2015-11-26 01:55:45 MIL libsnapper(3335) Snapper.cc(createConfig):289 - libsnapper version 0.2.8
2015-11-26 01:55:45 MIL libsnapper(3335) Snapper.cc(createConfig):291 - config_name:root subvolume:/ fstype:btrfs template_name:default
2015-11-26 01:55:45 MIL libsnapper(3335) Snapper.cc(getConfigs):247 - Snapper get-configs
2015-11-26 01:55:45 MIL libsnapper(3335) Snapper.cc(getConfigs):248 - libsnapper version 0.2.8
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(reload):114 - loading file /etc/sysconfig/snapper
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(getValue):235 - key:SNAPPER_CONFIGS value:
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(reload):114 - loading file /etc/sysconfig/snapper
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(getValue):235 - key:SNAPPER_CONFIGS value:
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(save):139 - saving file /etc/sysconfig/snapper
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(reload):114 - loading file /etc/snapper/config-templates/default
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(save):139 - saving file /etc/snapper/configs/root
2015-11-26 01:55:45 ERR libsnapper(3335) Btrfs.cc(createConfig):112 - create subvolume failed, ioctl(BTRFS_IOC_SUBVOL_CREATE) failed, errno:17 (File exists)
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(reload):114 - loading file /etc/sysconfig/snapper
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(getValue):235 - key:SNAPPER_CONFIGS value:root
2015-11-26 01:55:45 MIL libsnapper(3335) SystemCmd.cc(SystemCmd):46 - constructor SystemCmd:"/usr/bin/rm '/etc/snapper/configs/root'"
2015-11-26 01:55:45 MIL libsnapper(3335) SystemCmd.cc(execute):82 - SystemCmd Executing:"/usr/bin/rm '/etc/snapper/configs/root'"
2015-11-26 01:55:45 MIL libsnapper(3335) SystemCmd.cc(doExecute):267 - stopwatch 0.002974s for "/usr/bin/rm '/etc/snapper/configs/root'"
2015-11-26 01:55:45 MIL libsnapper(3335) SystemCmd.cc(doExecute):287 - system() Returns:0
2015-11-26 01:55:45 MIL libsnapper(3335) AsciiFile.cc(save):139 - saving file /etc/sysconfig/snapper
错误似乎是,
create subvolume failed, ioctl(BTRFS_IOC_SUBVOL_CREATE) failed, errno:17 (File exists)
但谷歌并没有对这个错误提供太多帮助。
我需要先在 btrfs 根分区中执行某些操作或启用某些操作吗?
答案1
我花了一段时间才找到这个问题,但似乎 SELinux 中有一个错误导致了这个问题。实际上并不是一个错误本身,但它与 snapperd 没有dac_覆盖默认情况下的功能。我对开放的错误报告做出了贡献。