1

We have encrypted volume using LUKS.

cryptsetup luksOpen /root/test1 volume1

and mounted on

mount /dev/mapper/volume1 /mnt/files

We created postgres data directory inside /mnt/files and able to start the postgres database.

/usr/local/pgsql/bin/pg_ctl -D /mnt/files/postgres/ -l /var/logs/postgres/postgrs.log  start

Even though we unmounted /mnt/files

sudo umount -l /mnt/files

When we try to close volume using LUKS.

sudo cryptsetup luksClose volume1

Getting following errors:

device-mapper: remove ioctl on volume1 failed: Device or resource busy

1
  • 1
    So you had a running PostgreSQL on a volume you unmounted? While PostgreSQL can do a recovery on next restart, it's still a bit audacious – and certainly not a good practice on a business environment. – Esa Jokinen May 16 '17 at 7:49
1

It looks to me like you didn't shut down PostgreSQL before unmounting.

As long as a PostgreSQL process is running, it will have filehandles open. You need to kill them all.

Oh, and BTW, you may have just corrupted your database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.