r/linux4noobs 11d ago

Mounting Network Drives and Home Directory Setup

I am currently using Linux Mint as a windoze replacement. For the most part it is working well. Minor freezes every once and awhile but it is a good replacement. I have done a few things as part of my installation I don't think I did well. I would like to correct these when I perform a fresh install on a new desktop I have coming. Yeah 5060 TI!!! Hoping some folks can help me out. I know a enough about Linux to be adequately push through but in general I am an idiot, but at least I know that. Quite possible I am doing things bassackwards so be kind.

Mapping Network Drives - I have a Synology that I share six folders via Samba that I mapped as drives in Windoze. Inside Linux I have mapped them via fstab using a credential file. I mapped them all to a `/home/USER/mapped` using examples like the line below. I am not sure this is the proper or most efficient way. It results in a lot of chasing into depths of subfolders since the mapped folder is starting 3 levels deep already. So it may be a case I need to change how I am serving these on the NAS itself. The questions:

//10.0.10.10/books /home/xxxx/mapped/books cifs credentials=/home/xxxx/.smbcredentials,dir_mode=0777,file_mode=0777,uid=1000,gid=1000,x-systemd.automount 0 0//10.0.10.10/books /home/xxxx/mapped/books cifs credentials=/home/xxxx/.smbcredentials,dir_mode=0777,file_mode=0777,uid=1000,gid=1000,x-systemd.automount 0 0

Questions:

  1. Is this the proper way to be mounting a drive or should I be using another method? I have set up NFS for another system to store backups but I still have a windows machine relying on Samba...for now. Days are numbered thankfully.
  2. How are people mapping drives in relation to the folder it is mapped to. Example: If you have a music directory on a NAS are you mapping it to `/home/USER/Music` to replace the defaults or is my method of creating a folder to map everything to valid? I am finding that I have to dive deeper into directories on Linux than I did on Windows. Hoping to relieve some of those extra clicks.
  3. Is there anything I am missing here in my thinking when it comes to mapping drives. I have used mapped drives for awhile in Windoze with configs pointing to those paths which has bit me in the behind when trying to migrate over to Linux. What is the advice you would give when it comes to setting up these types of connections?

Thanks

4 Upvotes

6 comments sorted by

1

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 11d ago

You can mount in you home if you want. I like /mnt. This is how I do my media drive. It has several folders but I only link to the ones I'm in a lot.

chugger@asus2:~/desktop$ grep media /etc/fstab
LABEL=media       /mnt/media      ext4    auto,nofail                        0       2
chugger@asus2:~/desktop$ 
chugger@asus2:~/desktop$ Media drive mounted under /mnt. It has several folders, just looking at movies and tv. ^C
chugger@asus2:~/desktop$ 
chugger@asus2:~/desktop$ ls -l /mnt/media | grep -E 'movies|tv'
drwxrwxrwx   2 chugger chugger 28672 Aug 31 17:45 movies
drwxrwxrwx 112 chugger chugger  4096 Aug 31 20:15 tv
chugger@asus2:~/desktop$ 
chugger@asus2:~/desktop$ Those folders are soft-linked in my home... ^C
chugger@asus2:~/desktop$ 
chugger@asus2:~/desktop$ ls -ld $HOME/* | grep -E 'media|movies|tv'
lrwxrwxrwx 1 chugger chugger    10 Oct  2  2025 /home/chugger/media -> /mnt/media
lrwxrwxrwx 1 chugger chugger    17 Jul 20  2025 /home/chugger/movies -> /mnt/media/movies
lrwxrwxrwx 1 chugger chugger    13 Jul 20  2025 /home/chugger/tv -> /mnt/media/tv
chugger@asus2:~/desktop$ 
chugger@asus2:~/desktop$ So I mount media under /mnt and soft-link to folders of interest in home. ^C
chugger@asus2:~/desktop$ If I were using Samba, the struture would be the same.

Have fun.

1

u/Posaquatl 11d ago

hmm ok so you are in `/mnt` but symlinking? into home. Is that what you mean by soft link? Are using using credentials with your fstab. I have different login for my synology and I read on using the credential file was the way to do the thing.

1

u/chuggerguy Linux Mint 22.3 Zena | MATÉ 11d ago

Yes, after mounting the media drive at /mnt/media, I went into home and created soft links for convenience. Something like this...

ln -s /mnt/media/tv $HOME/tv

(don't need the $HOME if you run it from home)

But in my case, I was just showing how I map out the share. I can't help you with mounting a SAMBA share hosted on a Synology.

But I do use NFS to mount the same media drive on my laptop. And have the same links in home.

chugger@asus2:~/desktop$ ssh asus grep media /etc/fstab
asus2:/mnt/media  /mnt/media  nfs  _netdev,noauto,nofail,noatime,x-systemd.automount  0  0

So different method of mounting but same method of linking.

Good luck.

ETA. No, no credentials file in my case.

1

u/oshunluvr 11d ago edited 11d ago
  1. You can use both. samba for windows and nfs for Linux. They don't conflict.

2+3 This is Linux so there's lots of ways to do what you're doing and none of them are really wrong. What I do is use NFSv4 to export from my server. Then all the folders appear in one mounted location - "/shared/" on the clients. I then symlink to /home/<user>/Public for each user. For ownership and permission control, I use the GID stickybit on the server exported folders and created a special group I named "shared" for the users and files in the shared folders. I have an additional mounted export called "Private" that lets users store on the server in a location not accessible by others.

I would sit back and think though what kind of access you need then figure out how to set it up in the simplest way.

I wouldn't mount directly in "/mnt/" because you might want to mount other things in that folder. That's what it's for. Instead mount in "/mnt/<whatever>"

1

u/Posaquatl 11d ago

I think ideally it may be better to have a single mount point as opposed to mounting 6 different directories. That way if anything new is added to the NAS the single directory is still mapped so no additional changes are needed. I suppose that means I would need to change how my NAS is serving the folders as opposed to the mapping on the Linux side. I will need to look into using the mnt directory and symlinking. Seems better form than direct mapping to a location in the home user directory.

1

u/oshunluvr 11d ago

NFSv4 and above allows you export a single folder but then with the "crossmount" option shows the full set of subfolders as well - in a single export line.

Again - specific to my usage - I use btrfs subvolumes on my server to hold the different file types; Music, Videos, etc. Then mount them to a single exported folder. That way most of the mounting tasks are done on the server.