Score:0

Best configuration for multi-user and network storage that is git friendly

ng flag

I'm setting up a new system that is running Ubuntu 22.04 LTS. The system has two storage devices: an SSD, and a larger HDD device. The SSD is for the boot partition and configuration, system and program data for the OS and users. The HDD will be used for general file storage.

I'm currently trying to decide the best place to mount the HDD filesystem and if there are any special configuration steps.

Requirements for the HDD:

  • Accessable to all users on the system; this should be handled by chmod o+rwx
  • Usable as a local network storage device (likely using Samba)
  • Automatic backup location for various devices (mostly to backup photos and videos from family phones, but also for other important files and folders on other devices)
  • Preferable usable with git without adding all the folders as a safe.directory or other regular changes.

It looks like the standard place to mount a device filesystem is at /mnt/name. This is what I did with my personal device, but I ran into the fatal: unsafe repository error while using git. It looks like /media/username/name is the automount location, and I've also considered mounting the device at ~/name for each user. However, because both of those will change based on the currently logged in user, they will likely make the local network storage and automatic backup configuration difficult or impossible. Also with the limited testing I've done, I'm not confident mounting the filesystem at either of those locations would resolve the git problem.

According to this question, it looks like I may be able to resolve the fatal: unsafe repository error by running chown -R username:username directory_name before working on a git project and running chown -R root:root directory_name after. However, I'm not sure if that will actually work, if it will have any downsides, or if adding safe.directory entries would be preferable.

The main questions I'm trying to answer are:

  1. Is there a better place to mount the HDD filesystem besides /mnt/name?
  2. Is there a configuration that will avoid the git fatal: unsafe repository error without needing to manually add safe.directory entries or constantly change the owner of files?
  3. Is there anything else I should consider in the setup and configuration of this device?
waltinator avatar
it flag
It's unwise to place your mount in the managed directory tree `/media/$USER`. See the Filesystem Hierarcy Standard at `https://refspecs.linuxfoundation.org/fhs.shtml`, or read `man hier`. It explains where things go.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.