Safest way to move a mount point that is a parent of other mount points on Linux to a new physical device

I goofed up and /var/lib/kubelet was not mounted on a server. So it was on the root. I noticed this and I want to fix it. I did the stupid thing and just tried to stop the associated services (kubelet), rename the existing directory to /var/lib/old_kubelet, mounted /var/lib/kubelet, and then tried to mv /var/lib/old_kubelet/* /var/lib/kubelet.

It turns out there are many (20ish) mount points underneath /var/lib/kubelet. IE /var/lib/kubelet/pods/30014089-3398-4e78-b176-ea651739a5f6/volumes/kubernetes.io~secret/default-token-g7vwq

So when I tried to move or copy, it actually tried to copy the contents of those mount points!

What's the easy and safest way to move the contents without copying the child mount points?

Other probably irrelevant information: the block device that the mount point should be pointing to is a LUKS volume


If you bind mount a directory, then the submounts will not be bound. So create a dummy directory somewhere, and do

mount --bind /var/lib/kubelet/ /mnt/tmptmp_dummy/

Then the contents of the /var/lib/kubelet/ directory will be available in /mnt/tmptmp_dummy/, without the mounted directories (they will be empty).