CIFS/SMB GUI or auto-add /etc/fstab?

Is there any way for me to automatically add a CIFS or SMB share to /etc/fstab once I’ve mounted it, or, barring that, a graphical editor for /etc/fstab where I don’t have to drop back to vim to edit the file?

╰─λ garuda-inxi
System:
Kernel: 6.18.6-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 15.2.1
clocksource: tsc avail: hpet,acpi_pm
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=79bebd74-6c02-4148-b1e5-1bed3e4c4274 rw rootflags=subvol=@
quiet resume=UUID=03ba1005-a576-46de-bba3-38f9d149082e loglevel=3
Desktop: KDE Plasma v: 6.5.5 tk: Qt v: N/A info: frameworks v: 6.22.0
wm: kwin_wayland vt: 1 dm: SDDM Distro: Garuda base: Arch Linux
Machine:
Type: Desktop Mobo: ASRock model: B550 Taichi Razer Edition
serial: <superuser required> Firmware: UEFI vendor: American Megatrends LLC.
v: L3.46 date: 08/20/2024
CPU:
Info: model: AMD Ryzen 7 5800X3D bits: 64 type: MT MCP arch: Zen 3+ gen: 3
level: v3 note: check built: 2022 process: TSMC n6 (7nm) family: 0x19 (25)
model-id: 0x21 (33) stepping: 2 microcode: 0xA201211
Topology: cpus: 1x dies: 1 clusters: 1 cores: 8 threads: 16 tpc: 2
smt: enabled cache: L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB
desc: 8x512 KiB L3: 96 MiB desc: 1x96 MiB
Speed (MHz): avg: 3592 min/max: 576/4553 boost: enabled scaling:
driver: amd-pstate-epp governor: performance cores: 1: 3592 2: 3592 3: 3592
4: 3592 5: 3592 6: 3592 7: 3592 8: 3592 9: 3592 10: 3592 11: 3592 12: 3592
13: 3592 14: 3592 15: 3592 16: 3592 bogomips: 108796
Flags-basic: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a
ssse3 svm
Vulnerabilities: <filter>
Graphics:
Device-1: Intel DG2 [Arc A770] vendor: ASRock driver: i915 v: kernel
alternate: xe arch: Xe-HPG code: Alchemist process: TSMC n6 (7nm)
built: 2022+ pcie: gen: 1 speed: 2.5 GT/s lanes: 1 ports: active: DP-1
off: HDMI-A-2 empty: DP-2, DP-3, DP-4, HDMI-A-1, HDMI-A-3, HDMI-A-4
bus-ID: 0e:00.0 chip-ID: 8086:56a0 class-ID: 0300
Device-2: Advanced Micro Devices [AMD/ATI] Navi 31 [Radeon RX 7900
XT/7900 XTX/7900 GRE/7900M] vendor: Yeston driver: amdgpu v: kernel
arch: RDNA-3 code: Navi-3x process: TSMC n5 (5nm) built: 2022+ pcie:
gen: 4 speed: 16 GT/s lanes: 16 ports: active: none off: DP-5,HDMI-A-5
empty: DP-6,DP-7,Writeback-1 bus-ID: 12:00.0 chip-ID: 1002:744c
class-ID: 0300
Display: wayland server: X.org v: 1.21.1.21 with: Xwayland v: 24.1.9
compositor: kwin_wayland driver: X: loaded: amdgpu,modesetting
unloaded: radeon alternate: fbdev,intel,vesa dri: iris,radeonsi
gpu: amdgpu,i915 display-ID: 0
Monitor-1: DP-1 model: MULTIVIEWER built: 2019 res: mode: 1920x1080 hz: 60
scale: 100% (1) dpi: 79 gamma: 1.2 size: 1600x900mm (62.99x35.43")
diag: 707mm (27.8") ratio: 16:9 modes: max: 1920x1080 min: 640x480
Monitor-2: DP-5 model: MULTIVIEWER built: 2019 res: 1920x1080 dpi: 79
gamma: 1.2 size: 1600x900mm (62.99x35.43") diag: 707mm (27.8") ratio: 16:9
modes: max: 1920x1080 min: 640x480
Monitor-3: HDMI-A-2 model: MULTIVIEWER built: 2019 res: 1920x1080 dpi: 79
gamma: 1.2 size: 1600x900mm (62.99x35.43") diag: 707mm (27.8") ratio: 16:9
modes: max: 1920x1080 min: 640x480
Monitor-4: HDMI-A-5 model: MULTIVIEWER built: 2019 res: 1920x1080 dpi: 79
gamma: 1.2 size: 1600x900mm (62.99x35.43") diag: 707mm (27.8") ratio: 16:9
modes: max: 1920x1080 min: 640x480
API: EGL v: 1.5 hw: drv: intel iris drv: amd radeonsi platforms: device: 0
drv: radeonsi device: 1 drv: iris device: 2 drv: swrast gbm: drv: kms_swrast
surfaceless: drv: radeonsi wayland: drv: iris x11: drv: iris
API: OpenGL v: 4.6 compat-v: 4.5 vendor: intel mesa v: 25.3.4-arch1.1
glx-v: 1.4 direct-render: yes renderer: Mesa Intel Arc A770 Graphics (DG2)
device-ID: 8086:56a0 memory: 15.53 GiB unified: no display-ID: :1.0
API: Vulkan v: 1.4.335 layers: 14 device: 0 type: discrete-gpu name: Intel
Arc A770 Graphics (DG2) driver: mesa intel v: 25.3.4-arch1.1
device-ID: 8086:56a0 surfaces: N/A device: 1 type: discrete-gpu name: AMD
Radeon RX 7900 XTX (RADV NAVI31) driver: mesa radv v: 25.3.4-arch1.1
device-ID: 1002:744c surfaces: N/A device: 2 type: cpu name: llvmpipe
(LLVM 21.1.6 256 bits) driver: mesa llvmpipe v: 25.3.4-arch1.1 (LLVM
21.1.6) device-ID: 10005:0000 surfaces: N/A
Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
de: kscreen-console,kscreen-doctor gpu: corectrl wl: wayland-info
x11: xdpyinfo, xprop, xrandr
Audio:
Device-1: Intel DG2 Audio vendor: ASRock driver: snd_hda_intel v: kernel
pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 0f:00.0 chip-ID: 8086:4f90
class-ID: 0403
Device-2: Advanced Micro Devices [AMD/ATI] Navi 31 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:ab30 class-ID: 0403
Device-3: Advanced Micro Devices [AMD] Starship/Matisse HD Audio
vendor: ASRock driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s
lanes: 16 bus-ID: 14:00.4 chip-ID: 1022:1487 class-ID: 0403
API: ALSA v: k6.18.6-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: N/A
Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
Server-2: PipeWire v: 1.4.10 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: Intel Ethernet I226-K driver: igc v: kernel pcie: gen: 2
speed: 5 GT/s lanes: 1 port: N/A bus-ID: 05:00.0 chip-ID: 8086:3102
class-ID: 0200
IF: enp5s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Device-2: Intel Wi-Fi 6 AX200 vendor: Rivet Networks Killer
driver: iwlwifi v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1
bus-ID: 08:00.0 chip-ID: 8086:2723 class-ID: 0280
IF: wlp8s0 state: up mac: <filter>
Info: services: NetworkManager, smbd, systemd-timesyncd, wpa_supplicant
Bluetooth:
Device-1: Intel AX200 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-9:5 chip-ID: 8087:0029
class-ID: e001
Report: btmgmt ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
rfk-block: hardware: no software: yes address: <filter> bt-v: 5.2 lmp-v: 11
status: discoverable: no pairing: no
Drives:
Local Storage: total: 3.68 TiB used: 341.32 GiB (9.1%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 model: NX-2TB 2280 size: 1.86 TiB
block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4
tech: SSD serial: <filter> fw-rev: H240129a temp: 40.9 C scheme: GPT
ID-2: /dev/nvme1n1 maj-min: 259:4 vendor: SanDisk model: Extreme 2TB X3N
size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
lanes: 4 tech: SSD serial: <filter> fw-rev: 731100WD temp: 36.9 C
scheme: GPT
Partition:
ID-1: / raw-size: 1.8 TiB size: 1.8 TiB (100.00%) used: 341.32 GiB (18.6%)
fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 664 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 1.8 TiB size: 1.8 TiB (100.00%)
used: 341.32 GiB (18.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-4: /var/log raw-size: 1.8 TiB size: 1.8 TiB (100.00%)
used: 341.32 GiB (18.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 1.8 TiB size: 1.8 TiB (100.00%)
used: 341.32 GiB (18.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: zram size: 62.71 GiB used: 0 KiB (0.0%) priority: 100
comp: zstd avail: lzo-rle,lzo,lz4,lz4hc,deflate,842 dev: /dev/zram0
ID-2: swap-2 type: partition size: 68.99 GiB used: 0 KiB (0.0%)
priority: -2 dev: /dev/nvme0n1p3 maj-min: 259:3
Sensors:
System Temperatures: cpu: 40.0 C mobo: 42.0 C gpu: amdgpu temp: 39.0 C
mem: 46.0 C
Fan Speeds (rpm): fan-1: 676 fan-2: 0 fan-3: 0 fan-4: 0 fan-5: 0 fan-6: 0
fan-7: 0 gpu: amdgpu fan: 0
Info:
Memory: total: 64 GiB note: est. available: 62.71 GiB used: 5.21 GiB (8.3%)
Processes: 420 Power: uptime: 8m states: freeze,mem,disk suspend: deep
avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
suspend, test_resume image: 25.07 GiB services: org_kde_powerdevil,
power-profiles-daemon, upowerd Init: systemd v: 259 default: graphical
tool: systemctl
Packages: pm: pacman pkgs: 1951 libs: 517 tools: octopi,paru,pikaur,yay
Compilers: clang: 21.1.6 gcc: 15.2.1 Shell: Bash v: 5.3.9 default: fish
v: 4.3.3 running-in: konsole inxi: 3.3.40
Garuda (2.12.3-2):
System install date:     2024-12-03
Garuda release:          240428
Last full system update: 2026-01-25
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut garuda-hardware-profile-standard garuda-hardware-profile-standard-x11
Windows dual boot:       No/Undetected
Failed units:            fancontrol.service

You can edit any text file with kate. It will just ask you for a password to save it.

2 Likes

To the best of my knowledge there is no GUI configurator for fstab. I amagine there is good reason for that, as, If you make a bad edit to fstab you can render your system unbootable.

Be sure to make a backup of fstab before you do any editing.

2 Likes

Ahh yes, the /etc/fstab. I think part of the learning curve of working on Linux, especially as a Windows refugee, is in understanding how the system mounts storage and network shares. If you want the network shares to be mounted automatically like they do on Windows when you map a drive to the network location, you just will have to add an entry to your /etc/fstab file. I’m happy to share what I use, as it works well for my use-cases.

//[IP_OR_MACHINE_NAME]/[NETWORK SHARE NAME]   /[path to mount]     cifs    x-systemd.automount,x-systemd.mount-timeout=5,_netdev,nofail,user,credentials=[path to credentials file],rw,dir_mode=0755,file_mode=0644,iocharset=utf8,vers=3.0,uid=1000,gid=1000   0 0

As you know, the fstab is formatted via tabs/spaces between the various parameters you need to include:

  1. Source location
  2. Mount path
  3. Mount type
  4. Mount options
  5. dump
  6. pass

In regard to numbers 5 and 6, the default of 0 for both is appropriate for network shares. Some clarity on the last 2 parameters (from man fstab):

The fifth field, (fs_freq), is used for these filesystems by the dump(8) command to determine which filesystems need to be dumped. If the fifth field is not present, a value of zero is returned and dump will assume that the filesystem does not need to be dumped.

The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2. Filesystems within a drive will be checked sequentially, but filesystems on different drives will be checked at the same time to utilize parallelism available in the hardware. If the sixth field is not present or zero, a value of zero is returned and fsck will assume that the filesystem does not need to be checked.

You’ll note that SMB/CIFS network shares require authentication, you can either pass the username and password directly in the /etc/fstab file or you can save a plain text file with the following content in it:

username=[username to log in to network share]
password=[password to log in to network share with the username above]

I would recommend doing further research into the security implications of this file, and how to properly set permissions. It’s generally recommended to save these kinds of files either in /etc/ or somewhere secure with permissions of 600.

Lastly, I would look into what the various mount options mean:

  1. x-systemd.automount: When x-systemd.automount is used, systemd will enable an “automount unit”, also known as a automount trap, or a mount point (path) where a file system may later be mounted. The file system itself is a separate unit (a “mount unit”) and will only be mounted if there is a subsequent demand to use that path.
  2. x-systemd.mount-timeout=5: configures how long systemd should wait for a mount command to finish before it gives up. The value 5 specifies a timeout of 5 seconds.
  3. _netdev: The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system).
  4. nofail: allows the boot sequence to continue even if the drive fails to mount
  5. user: Allow an ordinary user to mount the filesystem. Only allows the same user to unmount. Note: if you use the parameter users (plural) then it allows any ordinary user to unmount a drive that was mounted by another user.
  6. rw: mount the share as read/write access
  7. dir_mode=0755: treats directories in the mounted share as 755 permissions
  8. file_mode=0644: treats the files in the mounted share as 644 permissions
  9. iocharset=utf8: uses the UTF-8 character set to support international characters
  10. vers=3.0: specifies the SAMBA/Windows file share version
  11. uid=1000: treats all network share assets as owned by user 1000
  12. gid=1000: treats all network share assets as owned by group 1000

Apply for your use-case as needed. Good luck!

Edit: I would suggest reading through the Arch Wiki, this line in particular: fstab - ArchWiki

3 Likes
3 Likes

Is there something that’s included in the link you provided that adds more clarity to what I shared? I’m not sure I’m seeing anything new in the link that I didn’t already cover.

1 Like

Better safe than sorry.

mh, in german it was
Doppelt hält besser.

2 Likes

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