mirror of
https://github.com/ceph/ceph
synced 2025-02-20 17:37:29 +00:00
ceph-disk: do not mount over an osd directly in /var/lib/ceph/osd/$cluster-$id
If we see a 'ready' file in the target OSD dir, do not mount our device on top of it. Among other things, this prevents ceph-disk activate on stray disks from stepping on teuthology osds. Fixes: #5445 Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
ca55c3416e
commit
8a17f33b14
@ -1476,8 +1476,15 @@ def mount_activate(
|
||||
parent_dev = os.stat('/var/lib/ceph/osd').st_dev
|
||||
if dst_dev != parent_dev:
|
||||
other = True
|
||||
else if os.listdir('/var/lib/ceph/osd/{cluster}-{osd_id}'.format(
|
||||
cluster=cluster,
|
||||
osd_id=osd_id,
|
||||
)):
|
||||
other = True
|
||||
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
if active:
|
||||
LOG.info('%s osd.%s already mounted in position; unmounting ours.' % (cluster, osd_id))
|
||||
unmount(path)
|
||||
|
Loading…
Reference in New Issue
Block a user