links->home

Action Commands
abbreviations
<id>: id of the osd
<dev>: physical device id/name/path/...
<weight>: <dev>.size_tb - ~0.15
check status
ceph -w
ceph health
ceph osd df
ceph osd df | awk '($7 >= 80) {print $0}'
ceph osd tree
ceph status
reboot host
ceph osd set noout
ceph osd set norebalance
# reboot host
ceph osd unset noout
ceph osd unset norebalance
rebalance osds
ceph osd rebalance-by-utilization [nr | nr >= 100]
(re)start/stop osds
systemctl <action> ceph-osd@<id>
add osd
id=$(ceph osd create)
path=/var/lib/ceph/osd/ceph-$id

dd if=/dev/zero of=<dev> bs=512 count=1000000
mkfs -t xfs <dev>
mkdir -p $path
mount <dev> $path
chown -R ceph:ceph $path
sudo -u ceph ceph-osd -i osd.$id --mkfs --mkkey
ceph auth add osd.$id osd 'allow *' mon 'allow profile osd' -i $path/keyring
ceph osd crush add osd.$id <weight> host=$(hostname -s)
systemctl enable --now ceph-osd@$id
remove osd
ceph crush reweight osd.<id> 0.0
# wait until rebalance finished

ceph osd out <id>
systemctl stop ceph-osd@<id>
ceph osd crush remove osd.<id>
ceph osd auth del osd.<id>
ceph osd rm <id>