I had deployed airflow on my cluster which was not well written, hence, filled up space. Now, I have improved my code but need to empty the old data. How can I achieve that since my workers are associated with a persistent volume?
When I enter the pod, I run the command:
rm -rf /usr/local/airflow/*
I get the following error:
rm: cannot remove '/usr/local/airflow/logs': Device or resource busy
rm: cannot remove '/usr/local/airflow/rootfs': Device or resource busy
In order to delete all the contents, I ran the command: rm -rf /usr/local/airflow/rootfs/*
The asterisk, in the end, made all the change as it told the system to remove all the contents and not the directory itself. This made no interaction with any mounted storage whatsoever.
You need to umount
those devices and then try to remove it:
umount /usr/local/airflow/logs /usr/local/airflow/rootfs
rm -rf /usr/local/airflow/logs /usr/local/airflow/rootfs
Hope this helps