我在 Fedora 23 上尝试配置 snapper 时遇到错误。我的根分区是 btrfs,并且我已安装 snapper 包。当我最初尝试创建默认根配置时发生错误。
当我运行命令时:
sudo snapper -c root create-config /
终端输出为:
Creating config failed (creating btrfs snapshot failed)
snapper.log:
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 根分区中执行或启用某些操作?我之前从未配置过 Snapper 或快照,因此我真的不知道该如何继续。如能得到任何帮助或见解,我将不胜感激。
答案1
我花了一段时间才找到这个问题,但看来 SELinux 中有一个错误导致了这个问题。我为已打开的错误报告做出了贡献。