My machine has a secondary (NTFS-formatted) internal hard disk drive containing most of my personal files and data. I wish to auto-mount this drive under my user HOME. However, during installation of Ubuntu (17.10), I chose to create a separate /home partition and apply the default (ecryptfs
) encryption. This appears to be preventing the HDD from auto-mounting as desired from the entry I've created in fstab
. However, the drive happily auto-mounts to un-encrpyted directories.
How can I achieve auto-mounting of the secondary hard drive under /home/<username>/
?
I believe auto-mounting with fstab
occurs during boot, while /home
isn't decrypyted until user login. Perhaps the relevant fstab
entry could be automatically checked after login? Perhaps I could create a small post-login script to automatically run the mount
command - but I believe this would require a sudo
password prompt (or maybe I should try the AutoFS tool). Or, since ecryptfs
is a stacked filesystem, perhaps I could change the mount point be in the lower, encrypted layer which, if I understand correctly, is under /user/<username>/.Private
? Since this layer is persistent, it exists through boot - but I can't imagine what would happen from attempting to mount an un-encrypted NTFS filesystem there.
sudo
(or any other thing giving you rootpermissions if you adduser
to the list of options in/etc/fstab
.