Project

General

Profile

Actions

Bug #6966

closed

ceph-disk: prepare --dmcrypt failing

Added by Tyler Brekke over 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
ceph-disk
Target version:
-
% Done:

0%

Source:
Support
Tags:
Backport:
dumpling
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

# ceph-disk prepare --dmcrypt /dev/sdh
INFO:ceph-disk:Will colocate journal with data on /dev/sdh
Information: Moved requested sector from 34 to 2048 in
order to align on 2048-sector boundaries.
The operation has completed successfully.
Information: Moved requested sector from 10485761 to 10487808 in
order to align on 2048-sector boundaries.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
ceph-disk: Error: partition 1 for /dev/sdh does not appear to exist

Looks like this is due to partprobe not being ran after creating the data partition.

This patch seems to do the trick.

diff --git a/src/ceph-disk b/src/ceph-disk
index 0691d25..df615dc 100755
--- a/src/ceph-disk
+++ b/src/ceph-disk
@@ -1044,6 +1044,12 @@ def prepare_dev(
                 )
             subprocess.call(
                 args=[
+                    'partprobe',
+                    data,
+                    ],
+            )
+            subprocess.call(
+                args=[
                     # wait for udev event queue to clear
                     'udevadm',
                     'settle',
Actions #1

Updated by Eric Eastman almost 10 years ago

This is still failing in Firefly 0.80-rc1

# ceph -v
ceph version 0.80-rc1-33-g0f3235d (0f3235d46c8fd6c537bd4aa8a3faec6c00f311a8)

# ceph-disk prepare --dmcrypt /dev/sdc
INFO:ceph-disk:Will colocate journal with data on /dev/sdc
The operation has completed successfully.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
ceph-disk: Error: partition 1 for /dev/sdc does not appear to exist

I applied the above patch, with the following modifications for Firefly:

diff -c5 /usr/sbin/ceph-disk.org /usr/sbin/ceph-disk
*** /usr/sbin/ceph-disk.org    2014-05-01 10:39:29.782630806 -0600
--- /usr/sbin/ceph-disk    2014-05-01 10:40:40.944066600 -0600
***************
*** 1197,1206 ****
--- 1197,1212 ----
                      data,
                  ],
              )
              command(
                  [
+                     'partprobe',
+                     data,
+                     ],
+                 )
+             command(
+                 [
                      # wait for udev event queue to clear
                      'udevadm',
                      'settle',
                      ],
                  )


Using the patched version, it now works:
# ceph-disk prepare --dmcrypt /dev/sdc
INFO:ceph-disk:Will colocate journal with data on /dev/sdc
The operation has completed successfully.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
meta-data=/dev/mapper/c4c38377-e2df-46f4-98ca-928115adf650 isize=2048   agcount=4, agsize=2293695 blks
         =                       sectsz=512   attr=2, projid32bit=0
data     =                       bsize=4096   blocks=9174779, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=4479, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.

Actions #2

Updated by Sage Weil almost 10 years ago

  • Status changed from New to Fix Under Review
Actions #3

Updated by Eric Eastman almost 10 years ago

I installed wip-6966 on a test cluster and was able to build and use dmcrypted OSDs.
Thanks!

Actions #4

Updated by Alfredo Deza almost 10 years ago

  • Status changed from Fix Under Review to Resolved

Merged to master with hash 0f196265f049d432e399197a3af3f90d2e916275

Actions #5

Updated by Sage Weil almost 10 years ago

  • Status changed from Resolved to Pending Backport
Actions #6

Updated by Ian Colle almost 10 years ago

  • Assignee set to Sage Weil
Actions #7

Updated by Sage Weil almost 10 years ago

  • Status changed from Pending Backport to Resolved
  • Backport set to dumpling
Actions

Also available in: Atom PDF