2

I want to keep the /home directory in a folder on a disk partition other than the boot partition. Please note I said folder, not partition, meaning that I do not want to mount an entire partition as /home.

Bad fstab entry: LABEL=G_Giant_257/common/home /home would be exactly what I want, if only such syntax would work.

Actual (good) fstab:

LABEL=G_Giant_257 /mnt/g auto nosuid,nodev,nofail,nobootwait,x-gvfs-show 0 0

Now I need to get the command

mount /mnt/g/common/home /home

to execute before anything tries to access /home. Of course, I want all references to any user's "/home/~" directory to access a sub-folder of /common/home on my G_Giant_257 partition.

The kicker: my root partition is ext4, the G_Giant_257 partition is NTFS, so I don't see how a link could be made to work. I am running ubuntu 16.04.

What do you recommend, please?

  • I'm not sure how to prominently say this, as it's not directly related to the question. But the more I work with NTFS shared between Windows and Unix, the more problems I find on the Unix side. Most revolve around "unsettable" permissions (e.g. program requires this file not be world readable) or ownership demands of the Unix software. Wine is particularly bad; one would think that a windows scaffolding emulator would be prepared to deal with windows file systems. My initial optimism after sharing Mozilla and Thunderbird profiles (with links) has shattered. – HiTechHiTouch Feb 24 '17 at 06:59

2 Answers2

5

mount --bind your /home in /etc/fstab with

/mnt/g/common/home /home none bind 0 0

(See this question on ServerFault.)

I have no idea how practical is to have /home on an NTFS filesystem.

AlexP
  • 10,455
  • I think What is a bind mount? would be more helpful background that this SF question. – Gilles 'SO- stop being evil' Feb 10 '17 at 23:27
  • I'm in a mixed Windows Linux Mingw Cygwin environment, and it's easier to access NTFS from Linux than ext4 from Windows. I check my mail, and run the browser from both Windows and Ubuntu, plus lots of development files live in /home/~. I'm also more familiar with adjusting things likethe mail store location on windows than on Linux. So far, I've had good success sharing these things on NTFS. – HiTechHiTouch Feb 11 '17 at 02:46
  • @AlexP sorry, forgot to tag you on the previous comment. – HiTechHiTouch Feb 11 '17 at 02:52
  • @AlexP My conclusion is that /home on an NTFS is most impracticable (nay, impossible) with xfCE, Mate, Zorion, and I suspect, Gnome and Cinnamon. Too much use of permissions trying to protect the user from "inadvertently" changing things the desktop keeps in /home/.local or /home/.config, etc., coupled with hard failures when permissions aren't right. – HiTechHiTouch Feb 24 '17 at 07:07
2

Unfortunately, you can't mount a directory; that is with block-device-based (normal) filesystems such as ext4.

What you can do instead is keep your good fstab:

LABEL=G_Giant_257 /mnt/g auto nosuid,nodev,nofail,nobootwait,x-gvfs-show 0 0

And then remove /home and replace it with a symbolic link which points to the home folder on your NTFS partition:

ln -s /mnt/g/common/home /home

You may need to mess with the fstab entry a bit to get the permissions working, but unlike hardlinks, symbolic links can cross filesystems. During the time /mnt/g is unavailable, the link is considered broken, but the moment it gets mounted the link will resolve.

As for mounting home, fstab is the way to go. Nothing should be trying to access /home too early.

  • This looks like it should work, but not knowing the details of Ubuntu start-up and upstart/systemd etc., I feel more comfortable with the bind mount. Besides, I've used that strategy with MinGW before. Wish I could up-vote both answers. – HiTechHiTouch Feb 11 '17 at 02:50
  • @Rosa Hey, I can up-vote more than one answer! – HiTechHiTouch Feb 11 '17 at 02:51