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:
- Is there a better place to mount the HDD filesystem besides
/mnt/name
?
- 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?
- Is there anything else I should consider in the setup and configuration of this device?