当我尝试通过 systemd 单元(从我的cloud_config
)挂载格式化的驱动器时:
- name: var-lib-ceph-osd-ceph\x2d1.mount
command: start
content: |
[Unit]
Description=Mount Ceph disk (/dev/sdb) to /var/lib/ceph/osd/ceph-${host.id}
Before=docker.service
[Mount]
What=/dev/sdb
Where=/var/lib/ceph/osd/ceph-1
Type=btrfs
User=64045
Group=64045
但不幸的是,如果出现status=217/USER
错误则失败。
$ systemctl status "var-lib-ceph-osd-ceph\\x2d1.mount"
â var-lib-ceph-osd-ceph\x2d1.mount - Mount Ceph disk (/dev/sdb) to /var/lib/ceph/osd/ceph-1
Loaded: loaded (/etc/systemd/system/var-lib-ceph-osd-ceph\x2d1.mount; static; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2016-01-22 12:32:04 UTC; 33s ago
Where: /var/lib/ceph/osd/ceph-1
What: /dev/sdb
Process: 833 ExecMount=/bin/mount /dev/sdb /var/lib/ceph/osd/ceph-1 (code=exited, status=217/USER)
$ sudo /bin/mount /dev/sdb /var/lib/ceph/osd/ceph-1
$ ls -la /var/lib/ceph/osd/ceph-1
total 5242936
drwxr-xr-x 1 64045 64045 238 Jan 6 10:53 .
drwxr-xr-x 3 64045 64045 4096 Jan 6 10:41 ..
drwxr-xr-x 1 root root 0 Jan 6 10:49 async_snap_test
-rw-r--r-- 1 64045 64045 37 Jan 6 09:43 ceph_fsid
drwxr-xr-x 1 64045 64045 49782 Jan 7 12:14 current
-rw-r--r-- 1 64045 64045 37 Jan 6 09:43 fsid
-rw-r--r-- 1 64045 64045 5368709120 Jan 21 07:56 journal
-rw------- 1 64045 64045 56 Jan 6 09:43 keyring
-rw-r--r-- 1 64045 64045 21 Jan 6 09:43 magic
-rw-r--r-- 1 64045 64045 6 Jan 6 09:43 ready
drwxr-xr-x 1 64045 64045 26 Jan 6 09:43 snap_1
-rw-r--r-- 1 64045 64045 4 Jan 6 09:43 store_version
-rw-r--r-- 1 64045 64045 53 Jan 6 09:43 superblock
drwxr-xr-x 1 root root 0 Jan 6 10:49 sync_snap_test
drwxr-xr-x 1 root root 0 Jan 6 10:49 test_subvol
-rw-r--r-- 1 64045 64045 2 Jan 6 09:43 whoami
如果我手动执行 mount 命令,它就可以正常工作。有人知道哪里出了问题吗?不幸的是,Google 提供的帮助不多……
答案1
事实证明,人们可能不被允许使用
User=64045
Group=64045
一旦我将其移除,我就能成功启动该设备。