diff options
author | Sage Weil <sage@inktank.com> | 2013-06-26 18:27:49 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-26 18:36:30 -0700 |
commit | 26e7a6fffde4abcb685f34247e8491c05ee2a68d (patch) | |
tree | 01fad5cbaed1d4eacce90296c8705033131a7b75 | |
parent | ccb3dd5ad5533ca4e9b656b4e3df31025a5f2017 (diff) | |
download | ceph-26e7a6fffde4abcb685f34247e8491c05ee2a68d.tar.gz |
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>
(cherry picked from commit 8a17f33b14d858235dfeaa42be1f4842dcfd66d2)
-rwxr-xr-x | src/ceph-disk | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ceph-disk b/src/ceph-disk index 93864c1c008..f13ab88d8df 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1454,8 +1454,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) |