Skip to content

Commit 152608e

Browse files
committed
Fix Ceph OSD not starting after reboot with loop device
The ceph-osd-losetup service sets up the loop device backing the Ceph OSD, but after a reboot two things can go wrong: 1. LVM scans run before the loop device is ready, so the vg_ceph logical volumes (data, db) are never activated. The OSD fails with: 'failed to open /dev/vg_ceph/data: No such file or directory' 2. Ceph services can start before the losetup service completes, racing against the loop device setup. Fix both by adding: - ExecStartPost=vgchange -ay vg_ceph to activate the LVs after the loop device is attached - Before=ceph.target to ensure correct ordering with all Ceph daemons
1 parent fd34fab commit 152608e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

playbooks/prepare_host.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,11 @@
249249
[Unit]
250250
Description=Ceph OSD losetup
251251
After=syslog.target
252+
Before=ceph.target
252253
[Service]
253254
Type=oneshot
254255
ExecStart=/bin/bash -c '/sbin/losetup /dev/loop1 || /sbin/losetup --direct-io=on /dev/loop1 /var/lib/ceph-osd.img'
256+
ExecStartPost=/sbin/vgchange -ay vg_ceph
255257
ExecStop=/sbin/losetup -d /dev/loop1
256258
RemainAfterExit=yes
257259
[Install]

0 commit comments

Comments
 (0)