1. You have to first exit the chroot session, usually a simple `exit` will do:
exit
2. Then umount ALL binded directories:
umount /mnt/rescue/dev/
umount /mnt/rescue/proc/
umount /mnt/rescue/sys/
3. Then:
umount /mnt/rescue
* * *
In case you were worried that `sync` isn't used here, note that it has no influence on whether unmounting is possible. Unmounting flushes pending writes anyway (it has to, because there'd be nowhere for them to go after the unmounting). The presence of a chrooted process is irrelevant (except in that it prevents unmounting). In normal system operation, sync has no observable effect. sync only makes a difference if a device is physically disconnected without having been unmounted or if the system crashes while the device is mounted.