Mounting a NAS drive in fstab with full permissions

Good afternoon,
I am having an issue with getting a NAS share to mount automatically. I can mount it with the proper permissions like this -

sudo mount -t cifs -o user=XXXXX,uid=XXXXX,gid=XXXXX //192.XXX.XXX.XXX/Shanrename /mnt/Share

But whenever I try in fstab, it will mount but with only root permissions:

//192.XXX.XXX.XXX/Sharename /mnt/Share cifs user=XXXXX,uid=XXXXX,gid=XXXXX,defaults 0 0

I tried following the steps in this post:
Fstab how to automaticly mount a drive with user permissions?
but it didn’t work. (I did adjust the text to take out the Windows info since it is on a Linux PC).

This was what I had tried:
//192.XXX.XXX.XXX/Sharename /mnt/Share ext4 nofail,noatime,rw,user,uid=1000,gid=1000,dmask=022,fmask=133,auto 0 0

Could you please help me understand what I need to do in order to get this to work?

I should add that the drive I am trying to mount from the NAS is /dev/sda1 ext4.

Thank you.

System:
  Kernel: 6.10.6-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 14.2.1 clocksource: tsc
    avail: hpet,acpi_pm parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=4534d447-e253-4141-a80a-1d43fadde2bc rw rootflags=subvol=@ quiet loglevel=3 ibt=off
  Desktop: Cinnamon v: 6.2.9 tk: GTK v: 3.24.43 wm: Muffin v: 6.2.0 tools:
    avail: cinnamon-screensaver,xautolock vt: 7 dm: LightDM v: 1.32.0 Distro: Garuda base: Arch Linux
Machine:
  Type: Desktop Mobo: Micro-Star model: PRO B550M-VC WIFI (MS-7C95) v: 3.0
    serial: <superuser required> uuid: <superuser required> UEFI: American Megatrends LLC. v: H.B0
    date: 03/14/2024
CPU:
  Info: model: AMD Ryzen 7 5700G with Radeon Graphics bits: 64 type: MT MCP arch: Zen 3 gen: 4
    level: v3 note: check built: 2021-22 process: TSMC n7 (7nm) family: 0x19 (25) model-id: 0x50 (80)
    stepping: 0 microcode: 0xA50000F
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache: L1: 512 KiB
    desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB L3: 16 MiB desc: 1x16 MiB
  Speed (MHz): avg: 2407 high: 4641 min/max: 400/4673 scaling: driver: amd-pstate-epp
    governor: powersave cores: 1: 4641 2: 400 3: 400 4: 400 5: 3966 6: 400 7: 3713 8: 3712 9: 4630
    10: 3931 11: 3709 12: 3713 13: 3711 14: 400 15: 400 16: 400 bogomips: 121372
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: AMD Navi 23 [Radeon RX 6600/6600 XT/6600M] vendor: Gigabyte driver: amdgpu v: kernel
    arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 4 speed: 16 GT/s
    lanes: 16 ports: active: HDMI-A-1,HDMI-A-2 empty: DP-1,DP-2,Writeback-1 bus-ID: 12:00.0
    chip-ID: 1002:73ff class-ID: 0300
  Device-2: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series] driver: amdgpu v: kernel
    arch: GCN-5 code: Vega process: GF 14nm built: 2017-20 pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s ports: active: none empty: DP-3,DP-4,HDMI-A-3 bus-ID: 30:00.0
    chip-ID: 1002:1638 class-ID: 0300 temp: 28.0 C
  Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 24.1.2 driver: X: loaded: amdgpu
    unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 2720x768 s-dpi: 96 s-size: 719x203mm (28.31x7.99") s-diag: 747mm (29.41")
  Monitor-1: HDMI-A-1 mapped: HDMI-A-0 pos: primary,left model: LG (GoldStar) W1953
    serial: <filter> built: 2009 res: 1360x768 hz: 60 dpi: 85 gamma: 1.2
    size: 406x229mm (15.98x9.02") diag: 466mm (18.4") ratio: 16:9 modes: max: 1360x768 min: 720x400
  Monitor-2: HDMI-A-2 mapped: HDMI-A-1 pos: right model: LG (GoldStar) W1953 serial: <filter>
    built: 2009 res: 1360x768 hz: 60 dpi: 85 gamma: 1.2 size: 406x229mm (15.98x9.02")
    diag: 466mm (18.4") ratio: 16:9 modes: max: 1360x768 min: 720x400
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi device: 1
    drv: radeonsi device: 2 drv: swrast gbm: drv: kms_swrast surfaceless: drv: radeonsi x11:
    drv: radeonsi inactive: wayland
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.1.6-arch1.1 glx-v: 1.4
    direct-render: yes renderer: AMD Radeon RX 6600 (radeonsi navi23 LLVM 18.1.8 DRM 3.57
    6.10.6-zen1-1-zen) device-ID: 1002:73ff memory: 7.81 GiB unified: no
  API: Vulkan v: 1.3.279 layers: 9 device: 0 type: discrete-gpu name: AMD Radeon RX 6600
    driver: amd v: 2024.Q3.1 (LLPC) device-ID: 1002:73ff surfaces: xcb,xlib
Audio:
  Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel pcie: gen: 4
    speed: 16 GT/s lanes: 16 bus-ID: 12:00.1 chip-ID: 1002:ab28 class-ID: 0403
  Device-2: AMD Renoir Radeon High Definition Audio vendor: Micro-Star MSI driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 30:00.1
    chip-ID: 1002:1637 class-ID: 0403
  Device-3: AMD Family 17h/19h HD Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel
    pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/
s bus-ID: 30:00.6
    chip-ID: 1022:15e3 class-ID: 0403
  API: ALSA v: k6.10.6-zen1-1-zen status: kernel-api with: aoss type: oss-emulator tools: N/A
  Server-1: PipeWire v: 1.2.3 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter driver: mt7921e v: kernel
    pcie: gen: 2 speed: 5 GT/s lanes: 1 bus-ID: 29:00.0 chip-ID: 14c3:0616 class-ID: 0280
  IF: wlp41s0 state: down mac: <filter>
  Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI
    driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: e000 bus-ID: 2a:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: enp42s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Info: services: NetworkManager, smbd, systemd-timesyncd, wpa_supplicant
Bluetooth:
  Device-1: MediaTek Wireless_Device driver: btusb v: 0.8 type: USB rev: 2.1 speed: 480 Mb/s
    lanes: 1 mode: 2.0 bus-ID: 1-9:4 chip-ID: 0e8d:0616 class-ID: e001 serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 5.2 lmp-v: 11 status:
    discoverable: no pairing: no class-ID: 6c0104
Drives:
  Local Storage: total: 3.4 TiB used: 116.42 GiB (3.3%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 vendor: PNY model: CS900 500GB SSD size: 465.76 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s tech: SSD serial: <filter> fw-rev: 06J5
    scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 vendor: PNY model: CS900 2TB SSD size: 1.82 TiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s tech: SSD serial: <filter> fw-rev: 0600
    scheme: MBR
  ID-3: /dev/sdc maj-min: 8:32 vendor: Western Digital model: WD10EZEX-75M2NA0 size: 931.51 GiB
    block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s tech: HDD rpm: 7200 serial: <filter>
    fw-rev: 1A01 scheme: MBR
  ID-4: /dev/sdd maj-min: 8:48 vendor: PNY model: CS1311 240GB SSD size: 223.57 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s tech: SSD serial: <filter> fw-rev: 1122
    scheme: GPT
Partition:
  ID-1: / raw-size: 465.46 GiB size: 465.46 GiB (100.00%) used: 116.42 GiB (25.0%) fs: btrfs
    dev: /dev/sda2 maj-min: 8:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 584 KiB (0.2%) fs: vfat
    dev: /dev/sda1 maj-min: 8:1
  ID-3: /home raw-size: 465.46 GiB size: 465.46 GiB (100.00%) used: 116.42 GiB (25.0%) fs: btrfs
    dev: /dev/sda2 maj-min: 8:2
  ID-4: /var/log raw-size: 465.46 GiB size: 465.46 GiB (100.00%) used: 116.42 GiB (25.0%)
    fs: btrfs dev: /dev/sda2 maj-min: 8:2
  ID-5: /var/tmp raw-size: 465.46 GiB size: 465.46 GiB (100.00%) used: 116.42 GiB (25.0%)
    fs: btrfs dev: /dev/sda2 maj-min: 8:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 27.3 GiB used: 0 KiB (0.0%) priority: 100 comp: zstd
    avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 16 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 40.9 C mobo: 32.0 C
  Fan Speeds (rpm): N/A
  GPU: device: amdgpu temp: 30.0 C device: amdgpu temp: 34.0 C mem: 30.0 C fan: 0 watts: 5.00
Info:
  Memory: total: 28 GiB available: 27.3 GiB used: 2.52 GiB (9.2%)
  Processes: 422 Power: uptime: 1m states: freeze,mem,disk suspend: deep avail: s2idle wakeups: 0
    hibernate: platform avail: shutdown, reboot, suspend, test_resume image: 10.91 GiB
    services: csd-power,upowerd Init: systemd v: 256 default: graphical tool: systemctl
  Packages: pm: pacman pkgs: 1623 libs: 510 tools: gnome-software, octopi, pamac, paru Compilers:
    gcc: 14.2.1 Client: shell wrapper v: 5.2.32-release inxi: 3.3.35
Garuda (2.6.26-1):
  System install date:     2024-08-20
  Last full system update: 2024-08-25
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut
  Windows dual boot:       No/Undetected
  Failed units:            mn
t-NASShare.mount 

Remove defaults and user=XXX

1 Like

Thank you for responding.

I tried your suggestion and it still does not give me any permissions on the drive. I did try changing the permissions of the mount point (/mnt/sharename), but that doesn’t seem to have worked either.

Whoogle said

“Mounting a NAS drive in fstab with full permissions”

Maybe the samples help.

1 Like

Thank you. I will give them a try.

I have tried these suggestions, and even some I found on a few other posts in those sites. These would allow for the mounting of the drive, but I could not get the permissions to work.

You could try using a systemd mount unit rather than fstab.

https://man.archlinux.org/man/systemd.mount.5

In the past if I’ve encountered problems mounting remote shares with fstab a mount unit sometimes does the trick, and vice versa.

CIFS often causes problems, NFS is the superior option if it is available IMO.

1 Like

Thank you. I will give that a try.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.