You are not logged in.

#1 2018-03-15 08:50:03

Pryka
Member
Registered: 2018-02-07
Posts: 85

[SOLVED]Can I corrupt data by skipping ecryptfs-umount-private?

Hi!

I'm currently using ecryptfs on my /home dir.  With automount/umount option when login/logout to user account. But since unmount is susceptible to break it don't really work. And I don't mind it.

But I have question regarding it. Is it safe not to do ecryptfs-umount-private before restart or shutdown? Can I corrupt my data by not using it but just shutting down machine?

Last edited by Pryka (2018-03-15 11:31:17)

Offline

#2 2018-03-15 10:55:55

jaergenoth
Member
Registered: 2015-01-16
Posts: 85

Re: [SOLVED]Can I corrupt data by skipping ecryptfs-umount-private?

If you are automounting it with the PAM-module, it is unmounted automatically.

umount.ecryptfs_private(1) wrote:

The system administrator can add the pam_ecryptfs.so module to the PAM stack and automatically perform the unmount on logout.

ecryptfs-umount-private is just a wrapper script that calls umount and also clears the kernel keyring.

Edit:
You are right that the unmounting of ecryptfs automatically after logout seems to be bugged; it never worked when I still used it.
But when the system is being powered off, all pending writes are written to the disks and then after that all filesystems are unmounted (umount.ecryptfs_private gets called).
So it's perfectly fine to not manually unmount it.

Last edited by jaergenoth (2018-03-15 11:06:42)

Offline

#3 2018-03-15 11:15:12

frostschutz
Member
Registered: 2013-11-15
Posts: 1,658

Re: [SOLVED]Can I corrupt data by skipping ecryptfs-umount-private?

Well, the possibilities roughly are

a) it manages to umount the ecryptfs on shutdown anyway,

b) it doesn't manage to, so /home can't be umounted and will be re-mounted read-only instead,

c) the remount read-only fails too

If you get a), it would be perfect... b) would be still acceptable... c) might be bad.

Offline

#4 2018-03-15 11:30:15

Pryka
Member
Registered: 2018-02-07
Posts: 85

Re: [SOLVED]Can I corrupt data by skipping ecryptfs-umount-private?

jaergenoth wrote:

If you are automounting it with the PAM-module, it is unmounted automatically.

umount.ecryptfs_private(1) wrote:

The system administrator can add the pam_ecryptfs.so module to the PAM stack and automatically perform the unmount on logout.

ecryptfs-umount-private is just a wrapper script that calls umount and also clears the kernel keyring.

Edit:
You are right that the unmounting of ecryptfs automatically after logout seems to be bugged; it never worked when I still used it.
But when the system is being powered off, all pending writes are written to the disks and then after that all filesystems are unmounted (umount.ecryptfs_private gets called).
So it's perfectly fine to not manually unmount it.

Oh. Thank you for the info. I'm little calmer right now. smile



frostschutz wrote:

Well, the possibilities roughly are

a) it manages to umount the ecryptfs on shutdown anyway,

b) it doesn't manage to, so /home can't be umounted and will be re-mounted read-only instead,

c) the remount read-only fails too

If you get a), it would be perfect... b) would be still acceptable... c) might be bad.

I found this in my logs:

mar 15 10:49:57 Iluvatar systemd[1]: Unmounting /home...
mar 15 10:49:57 Iluvatar systemd[1]: Unmounted /home.

It looks that my /home is unmounting fine.

EDIT:
Probably solved then. Will add a mark to the topic.

Last edited by Pryka (2018-03-15 11:30:54)

Offline

Board footer

Powered by FluxBB