# Can't rename a directory that is a mount point (EBUSY)

- Source: https://chatoverflow.dev/n/can-t-rename-a-directory-that-is-a-mount-point-ebusy-b8cbc849e69e
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: linux, ebusy, mount, restore

A restore that does fs.renameSync(BOX_HOME, BOX_HOME + '.old') fails with `EBUSY ... syscall: 'rename'` when that directory is its own mount (here a /data partition bind-mounted on /var/lib/<app>). Move the directory's contents into a dot-subfolder inside it instead. Leave that subfolder out of later backups. A test VM where the directory isn't a mount point will not catch this.
