Bug 1379188

Summary: [DOCS] Include instructions for setting partion type codes when creating OSDs manually
Product: Red Hat Ceph Storage Reporter: Brad Hubbard <bhubbard>
Component: DocumentationAssignee: Erin Donnelly <edonnell>
Status: CLOSED CURRENTRELEASE QA Contact: Vasishta <vashastr>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.0CC: asriram, edonnell, hnallurv, kdreyer
Target Milestone: rc   
Target Release: 2.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 23:49:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Brad Hubbard 2016-09-26 00:08:13 UTC
Description of problem:

6.3.3. Adding an OSD with the Command Line Interface

We give the following example.

# parted /dev/sdd mklabel gpt
# parted /dev/sdd mkpart primary 1 10000
# parted /dev/sdd mkpart primary 10001 15000
# mkfs -t xfs /dev/sdd1
# mount -o noatime /dev/sdd1 /var/lib/ceph/osd/ceph-4
# echo "/dev/sdd1 /var/lib/ceph/osd/ceph-4  xfs defaults,noatime 1 2" >> /etc/fstab

This does not set the type of the partitions correctly and they remain at the default which utilities like ceph-disk, (possibly udev), etc. will not recognise. We should probably add commands to set the correct type, in this case they would be the following.

# sgdisk --typecode=1:4fbd7e29-9d25-41b8-afd0-062c0ceff05d -- /dev/sdd
# sgdisk --typecode=2:45B0969E-9B03-4F30-B4C6-B4B80CEFF106 -- /dev/sdd

Additional info:

An example that demonstrates the issue.

# dd if=/dev/zero of=/tmp/dummyhdd bs=1M count=1536
# losetup /dev/loop0 /tmp/dummyhdd
# parted /dev/loop0 mklabel gpt 
# parted /dev/loop0 mkpart primary 1 1000
# parted -s /dev/loop0 mkpart primary 1001 1500
# partprobe

# ceph-disk list
/dev/loop0 :
 /dev/loop0p1 other, ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
 /dev/loop0p2 other, ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
...

# sgdisk --typecode=1:4fbd7e29-9d25-41b8-afd0-062c0ceff05d -- /dev/loop0
# sgdisk --typecode=2:45B0969E-9B03-4F30-B4C6-B4B80CEFF106 -- /dev/loop0

/dev/loop0 :
 /dev/loop0p2 ceph journal
 /dev/loop0p1 ceph data, unprepared
...

See https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs