[SOLVED] 'ceph-volume lvm zap' zfs drive issue

RobFantini

Famous Member
May 24, 2012
2,023
107
133
Boston,Mass
for drives that were part use with zfs, ceph-volume lvm zap /dev/sdX did not prepare drive for pve: ceph > osd create osd. no unused drives were found

this old script fixed the issue:
Code:
DISK=$1

if [ "$1" = "" ]; then
 echo "Need to supply a  dev name like  sdg . exitting"
 exit 0
fi


echo " make sure this is the correct disk "
echo $DISK

echo " you will end up with NO partition table when this procedes .  example:

Disk /dev/$1  doesn't contain a valid partition table

Press enter to procede , or ctl-c to exit "

read x

dd if=/dev/zero of=/dev/$DISK bs=512 count=50000

# 2014-08-08 need for 3ware end of disk has stuff
#-----------
LBAS=$(cat /sys/block/$DISK/size)
dd if=/dev/zero of=/dev/$DISK bs=512 count=1024
dd if=/dev/zero of=/dev/$DISK bs=512 seek=$(($LBAS-1024)) count=1024
 
Our tooling 'pveceph osd create/destroy' will take care of this annoyance.
 
Hi,

I had a strange issue on a "future ceph volume" that already have lvm volume :

pveceph osd create /dev/sdf
/dev/sdg: open failed: No medium found
/dev/sdg: open failed: No medium found
device '/dev/sdf' is already in use

any idea

best regards,

Virttom007
 
no medium found and open and already in use - check this
Makefile:
mount|  grep sdf

I asssume it is mounted. umount and try again

if that fails umount and zap /dev/sdf


if you are sure you want to kill any data on /dev/sdf then zap the disk. AFAIR there used was a ceph zap disk command around but with a quick check i do not see it. look for it or ask others. otherwise this script would work, save it at zap-disk , and chmod +x nd rn with ./zap-disk sdf
Code:
DISK=$1

if [ "$1" = "" ]; then
 echo "Need to supply a  dev name like  sdg . exiting"
 exit 0
fi


echo " make sure this is the correct disk "
echo $DISK

echo " you will end up with NO partition table when this procedes .  example:

Disk /dev/$1  doesn't contain a valid partition table

Press enter to procede , or ctl-c to exit "

read x

dd if=/dev/zero of=/dev/$DISK bs=512 count=50000

# 2014-08-08 need for 3ware end of disk has stuff
#-----------
LBAS=$(cat /sys/block/$DISK/size)
dd if=/dev/zero of=/dev/$DISK bs=512 count=1024
dd if=/dev/zero of=/dev/$DISK bs=512 seek=$(($LBAS-1024)) count=1024
 
Hi rob,

I did with success zap the drive (with a combinatio of vgremove / pvremove and sfdisk before zapping). But I did have a sdg message (and no sdg harddrives) that is annoying.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!