pveceph createosd /dev/sdb -fstype btrfs how to force ?

Q-wulf

Renowned Member
Mar 3, 2013
613
40
93
my test location
pveceph createosd /dev/sdb -fstype btrfs

gives me the following output:


pveceph createosd /dev/sdb -fstype btrfs
create OSD on /dev/sdb (btrfs)
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.


****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
Creating new GPT entries.
The operation has completed successfully.
Setting name!
partNum is 1
REALLY setting name!
The operation has completed successfully.
Setting name!
partNum is 0
REALLY setting name!
The operation has completed successfully.
/dev/sdb1 appears to contain an existing filesystem (xfs).
Error: Use the -f option to force overwrite.
ceph-disk: Error: Command '['/sbin/mkfs', '-t', 'btrfs', '-m', 'single', '-l', '32768', '-n', '32768', '--', '/dev/sdb1']' returned non-zero exit status 1
command 'ceph-disk prepare --zap-disk --fs-type btrfs --cluster ceph --cluster-uuid 78f04b5c-c8af-4b55-bbbc-459f4f34c7e8 /dev/sdb' failed: exit code 1


How can i force the overwrite ?

I looked into
man pveceph

Code:
       pveceph createosd <dev> [OPTIONS]


          Create OSD


          <dev>      string


                    Block device name.


          -fstype    (btrfs | ext4 | xfs)   (default=xfs)


                    File system type.


          -journal_dev string


                    Block device name for journal.

no word on forcing the overwrite tho.
 
i found a "workaround" ... i think... at least half of it ...

mkfs.btrfs -l 32768 -n 32768 -f /dev/sdb
reboot
umount /dev/sdb1
ceph-disk prepare --zap-disk --cluster ceph --cluster-uuid 78f04b5c-c8af-4b55-bbbc-459f4f34c7e8 /dev/sdb
reboot
ceph-disk activate-all
puts it into the OSD-list on proxmox.

Feels somewhat counter-intuitive and i'm having issues to remove the osd afterwards using

pveceph destroyosd 0
osd is still running (up == 1)

down or out from gui keeps timing out.
after a reboot the gui doesn't even load.


pretty sure thats NOT the way to go.

Any ideas ??
 
I guess you just need to cleanup/wipe the partition table on that disk before using cteateosd (gdisk/sgdisk --zap)
 
I guess you just need to cleanup/wipe the partition table on that disk before using cteateosd (gdisk/sgdisk --zap)


as part of my "setup-routine" i already ran
Code:
ceph-disk zap /dev/sdb
before using mkfs.btrfs /dev/sdb

or do you mean before using
Code:
pveceph createosd /dev/sdb
????


Afaik that command as part of its routine already runs --zap


could you explain in more detail ?

kind regards,
Q-Wulf
 
Last edited: