0

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.

0

Assuming that this is a personal system. Mount the drive external to your home folder and use a symbolic link to join the drive to your home folder.

ln -s <target> <localname>

so if the drive is mounted at

/mnt/ntfsdrive

and you want it in your home folder as ndfsdrive,

ln -s /mnt/ntfsdrive /home/<username>/ntfsdrive

If this is not a personal or physically secured system, then other security considerations come into play.

  • Thanks. I should have mentioned I am already aware of the symlink solution and am not against it - but I am interested to learn of any mount-based solutions. – user267628 Dec 27 '17 at 6:23

Your Answer

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