rootfs: fix copying db bugs.