I notice that the code does an lvremove --force $device instead of lvchange -a n $device followed by lvremove $device. I think the latter is usually preferred. This might be deliberate on your part, though, if you want to do the remove as a single atomic action. Heads up, just in case.
I notice that the code does an
lvremove --force $device
instead oflvchange -a n $device
followed bylvremove $device
. I think the latter is usually preferred. This might be deliberate on your part, though, if you want to do the remove as a single atomic action. Heads up, just in case.