Announcement

Collapse
No announcement yet.

Automount SMB partition at boot

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [CONFIGURATION] Automount SMB partition at boot

    Hi all, i'm new here and pretty new to linux. I don't know where to post this question...
    I use linux mint on my laptops but now i made a "frankenstein pc" (a"real" Virtual machine to test distros) with spares laying around my house. I installed Kubuntu 20.10 (after encountered "ubi-partman code 10" in installation).
    I installed /on SSD (60GB), swap in a partition of the third HDD (250GB), and kept the second HDD (500GB) for Data, documents, installed games and other stuff. All is working flawlessy
    I have a little NAS (2TB) running OPENMEDIAVAULT and as i did in Mint,i added an entry in /etc/fstab.

    It works perfectly, but after a reboot i need to manually type in terminal sudo mount -a to mount the remote partition.
    I think the culprit is the wi-fi connection (a wifi-AC Realtek 8811CU usb adapter), it takes some time to effectively connect... and i think fstab "miss" the partition (sorry for my english...)

    It's possibile to create a script to launch the command "sudo mount-a" after a certain amount of time?
    Maybe there are other simpler solutions i can't figure at the moment.

    I hope i explained well the issue.
    Thanks in advance!

    #2
    What is the specific line you added to the fstab?
    If it is there, it is supposed to mount during boot, so yes, it is very likely not doing so because the network isn't up.
    Now, one thing to try is to go into your network connection settings, and go to the 'General Configuration' tab for your WiFi ssid, and select the ' all users may connect' option. This will connect much earlier, during boot instead of at login. This may be all you need to do.

    Comment


      #3
      As well as what Claydoh suggests, Try adding this to your fstab options

      x-systemd.after=network-online.target

      Please Read Me

      Comment


        #4
        Hi guys, thanks for the answers!

        I tried to enable the ' all users may connect' option but it doesn't works.

        This is my /fstab, the same configuration for the network share actually works on my laptop.

        could you tell me where to place the line you suggested?

        "x-systemd.after=network-online.target"

        Code:
        # /etc/fstab: static file system information.
        #
        # Use 'blkid' to print the universally unique identifier for a
        # device; this may be used with UUID= as a more robust way to name devices
        # that works even if disks are added and removed. See fstab(5).
        #
        # <file system> <mount point>   <type>  <options>       <dump>  <pass>
        # / was on /dev/sdb2 during installation
        UUID=9e1abf34-0d16-4209-be35-237ac1ff6466 /               ext4    errors=remount-ro 0       1
        # /boot/efi was on /dev/sdb1 during installation
        UUID=D3CA-899D  /boot/efi       vfat    umask=0077      0       1
        # swap was on /dev/sda2 during installation
        UUID=fe97baa5-3c58-42c6-b1ca-2d3dce08663f none            swap    sw              0       0
        
        #WD-Blue 500GB
        UUID=42fef347-a2d9-40d1-89b9-294e908f4ba5 /mnt/500GB ext4 defaults 0 2
        
        #WD-Blue 250GB
        UUID=6fd53a17-5888-48eb-9c8c-4bbc9376f5a1 /mnt/250GB ext4 defaults 0 2
        
        #OMV
        //192.168.1.101/nas /mnt/WWW cifs credentials=/home/mosco/.smbcredentials,uid=1000,gid=1000 0 0

        Comment


          #5
          //192.168.1.101/nas /mnt/WWW cifs credentials=/home/mosco/.smbcredentials,uid=1000,gid=1000,x-systemd.after=network-online.target 0 0

          Please Read Me

          Comment


            #6
            Originally posted by oshunluvr View Post
            //192.168.1.101/nas /mnt/WWW cifs credentials=/home/mosco/.smbcredentials,uid=1000,gid=1000,x-systemd.after=network-online.target 0 0
            YEAH! Now it works perfectly. Many thanks!

            Comment

            Working...
            X