Results 1 to 5 of 5

Thread: Unable to mount NAS via command line on Ubuntu 24.04

  1. #1
    Join Date
    Jun 2024
    Beans
    3

    Question Unable to mount NAS via command line on Ubuntu 24.04

    Hi All,

    Looking for a little bit of help!
    I'm attempting to mount an old WD My Live Book Duo network storage drive (FILESRV01) to my Ubuntu server with a mount point of /mnt/nas but can't seem to get it to work.

    Attempted:
    Code:
    sudo mount -t cifs //FILESRV01.local/data /mnt/nas
    sudo mount -t cifs //FILESRV01.local/data /mnt/nas -o username=XXXX
    sudo mount -t cifs //FILESRV01.local/data /mnt/nas -o username=XXXX,domain=WORKGROUP
    sudo mount -t cifs //192.168.X.X/data /mnt/nas
    sudo mount -t cifs //192.168.X.X/data /mnt/nas -o username=XXXX
    sudo mount -t cifs //192.168.X.X/data /mnt/nas -o username=XXXX,domain=WORKGROUP
    sudo mount -t cifs //192.168.X.X/data /mnt/nas -o username=WORKGROUP/XXXX
    Alongside every other variant including gid, uid, etc...
    Also attempted mounting via
    Code:
    smbclient -L
    All of which return mount error(22): Invalid argument

    Checking dmesg displays:
    Code:
    CIFS: VFS: cifs_mount failed w/return code = -22
    -
    In troubleshooting, I went ahead and installed Ubuntu Desktop to use the GUI - which sees and mounts the drive just fine without any additional work.


    https://imgur.com/a/XMe3rQ9

    But even after confirming that it could mount via the GUI - attempting to mount via command line on the Desktop version still gives return code -22

    Via
    Code:
    smbclient -L
    the server confirms that it can see the shares and does list them
    https://imgur.com/QR0u9Qz


    I've tried every other mount option I could find out there and still nothing.
    Any guidance is really appreciated, thanks!

  2. #2
    Join Date
    Dec 2009
    Beans
    6,787

    Re: Unable to mount NAS via command line on Ubuntu 24.04

    Most of the time an "invalid option" error usually indicates the client is trying to access the server with a smb dialect the server doesn't understand.

    By default mount.cifs will try to access the server with smb dialects between 2.1 and 3.11. If the server is that old it may not unserstand anything in that range.

    You can override the cifs defaults by using the vers= option.


    sudo mount -t cifs //FILESRV01.local/data /mnt/nas -o username=XXXX,vers=2.0

    Or

    sudo mount -t cifs //FILESRV01.local/data /mnt/nas -o username=XXXX,vers=1.0

  3. #3
    Join Date
    Jun 2024
    Beans
    3

    Re: Unable to mount NAS via command line on Ubuntu 24.04

    Morbius - thank you SO much. That did it!
    This one resolved my issue -
    Code:
    sudo mount -t cifs //FILESRV01.local/data /mnt/nas -o username=XXXX,vers=1.0
    I really appreciate your help.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Unable to mount NAS via command line on Ubuntu 24.04

    ver 1 is terribly non-secure. If you want to KNOW which protocols your NAS will support, use the nmap tool:
    Code:
    $ sudo nmap --script smb-protocols    win7ult
    Starting Nmap 7.80 ( https://nmap.org ) at 2024-06-13 09:46 EDT
    Nmap scan report for win7ult (172.22.22.8)
    Host is up (0.00078s latency).
    Not shown: 995 filtered ports
    PORT      STATE SERVICE
    135/tcp   open  msrpc
    139/tcp   open  netbios-ssn
    445/tcp   open  microsoft-ds
    5357/tcp  open  wsdapi
    49156/tcp open  unknown
    MAC Address: 52:54:00:7B:8A:14 (QEMU virtual NIC)
    
    Host script results:
    | smb-protocols: 
    |   dialects: 
    |     NT LM 0.12 (SMBv1) [dangerous, but default]
    |     2.02
    |_    2.10
    
    Nmap done: 1 IP address (1 host up) scanned in 11.84 seconds
    Just replace the underlined part with the IP address of your NAS. I have DNS running here, so the IP lookup happens that way, but a normal IP address can be used too.

    When I connect to that CIFS share, I use vers=2.1. It is the highest, supported, value. Win10+ should be using version 3+ which are drastically more secure than prior versions. There's only so much we can do. Any NAS that only supports v1 really is ready to be retired. Something to work into your plans.

  5. #5
    Join Date
    Jun 2024
    Beans
    3

    Re: Unable to mount NAS via command line on Ubuntu 24.04

    Thanks for this! My NAS didn't support 2.1, but it did have Version 2 and so I switched commands to

    Code:
    sudo mount -t cifs //FILESRV01.local/data /mnt/nas -o username=XXXX,vers=2.0

    instead.

    Thanks!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •