Trouble adding a drive (prior partition got me into a weird state)

Hello! I’ve been trying to figure this out, but I’m out of things to try. I have a few questions orbiting around this situation. I thank you in advance for your time and wisdom.

The Big Picture is I have a small home IncusOS server, which works, and I’m adding a SATA drive to it.

I had this disk on Incus previously, then I removed it physically while the machine was off, tested it on another machine, and left the partition on it with the assumption that IncusOS would purge and re-partition.

IncusOS does not re-partition automatically. Ok, learned that. I tried to use incus admin os system storage wipe-drive and it hangs seemingly forever, eventually giving an API timed out error. The disk state is seemingly unchanged. The drive is good, having survived the testing.

I then tried again to create the pool, as described in the Preparing Volumes for Incus tutorial. It also hangs forever when I exit, eventually saying API timed out.

The new pool never appears in incus admin os system storage show. The drive is always visible in that status. At current, incus admin os system resources show shows that the drive is there with an empty list of partitions. Sounds perfect for onboarding.

There is evidence of inconsistent state within IncusOS that I can’t directly access. If I try to create the same pool with the same name, when I exit the editor it says:

Config parsing error: encryption key for 'name-of-pool' already exists

Summary is: I tried creating the pool with that name, it somehow failed, but the encryption keys were created for it so I can’t try to create it with that name again (and I like the name). From what I can see, those encryption keys are not something I can access.

Small Question: is it possible to remove encryption keys, allowing me to get out of this inconsistent state?

Bigger Question: is there a way to get more detail on the disk adoption process that happens in the background so that I can see what the heck is happening?

Biggest Question: how would you recommend I get this drive to work again?

Thank you again.

Did you try using delete-pool for name-of-pool?
I guess that may fail if it never was fully created, though I think it’d make sense for us to support that as a way to clear an encryption key for an otherwise missing pool.

@gibmat

I cannot find a command delete-pool. It’s not coming up in search on the documentation site, and isn’t available under

incus admin os system storage

nor

incus storage

The closest I can find is here, incus admin os system storage delete which did something!

incus admin os system storage delete -d '{"name":"big-pool"}

did get rid of the pool keys from security show! Worked for all three pools I had apparently partially-created.

This answers my Small Question successfully; thank you!

From there I was able to complete the steps cleanly, and the disk is up and running! Biggest Question resolved.

Thank you so much

Oh yes, sorry, I meant incus admin os system storage delete

It could be that IncusOS did the full zero-out of the disk because fast erase options were not supported by your SATA drive. So, it could be that the internal structure of the disk was corrupted after terminating of this operation, but you have not noticed that. Did you wipe the disk after removing the storage pool?