Actually, there is a better workaround, that I found it schroot FAQ, in section Why is schroot overwriting configuration files in the chroot?
By default, schroot copies over the system NSS databases ('passwd',
'shadow', 'group', 'gshadow', 'services', 'protocols', 'networks', and
'hosts', etc.) into the chroot. The reason for this is that the chroot
environment is not a completely separate system, and it copying them
over keeps them synchronised. However, this is not always desirable,
particularly if installing a package in the chroot creates system
users and groups which are not present on the host, since these will
disappear next time the databases are copied over.
In short: each time you start a new schroot session, or after host system reboot, schroot grabs
/etc/passwd and some other files from you real system and copies them into chroot, thus losing all new users from it. The suggested workaround is described in this FAQ: you can disable copying this files:
/etc/schroot/default/nssdatabases (on your real system, of course)
- You will see the lis of so called NSS databases, that are copied from real system.
- Comment lines
shadow, so that the file looks like this:
# System databases to copy into the chroot from the host system.
# <database name>
Now if you go back inside your chroot and create some users, or install some postgresql etc, new users won't be lost. Even after reboot!