• Re: Revisiting a mount statement

    From Paul@21:1/5 to pinnerite on Thu Jun 13 22:43:20 2024
    XPost: alt.os.linux.mint, alt.os.linux.mageia

    On 6/13/2024 5:05 PM, pinnerite wrote:
    This is on mint 21.3
    I have run the same mount statement in a Script for years.
    It mounts a samba share. I ran it for periodic backups.
    Recently the backup machine stopped working. It is getting on a bit.
    I substituted another equally old but working machine and edited the
    script to substitute its URL.

    mount -v -t cifs -o rw,noperm,user=<xxxx>,password=<yyyy>,domain=ASANDCO,vers=1.0,uid=alan //192.168.1.4/data/ /spare/albury/Data/

    It returns mount error(22): Invalid argument

    I have been scratching my head over this for several days.

    I haven't found anything on the WWW that has helped.

    TIA


    Is /spare/albury/Data mounted ?

    Presumably it is a separate drive, having its own file system,
    and needing to be healthy, before the NEXT mount command can work.

    If the mount point was NOT working, then /spare/albury/Data/ should be empty.

    If /spare/albury/Data/ has not been mounting for days on end, you've
    been shoving backups into the mount point and not the external drive.

    This can make it difficult to determine /spare/albury/Data/ is mounted.

    At a time like this, we

    cat /etc/mtab

    or check with "diskfree" to see any signs of encouragement.

    df

    But mainly, I want to see /etc/mtab , just the relevant bits.

    It is not a question of "a mount command", but "which mount is failing".

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to pinnerite on Sat Jun 15 19:44:38 2024
    XPost: alt.os.linux.mint, alt.os.linux.mageia

    On 6/15/2024 1:23 PM, pinnerite wrote:
    This is a summary of where I amm now.

    The share section in smb.conf on 192.168.1.100

    [data]
    comment = data
    path = /home/Data
    valid users = alan
    admin users = alan
    read only = No

    The target drive is 192.168.1.4
    I am trying to mount it on /spare/albury/Data.

    This is the mount command:

    sudo mount -t cifs //192.168.1.4/data/ /spare/albury/Data --verbose -o rw,noperm,username=alan,password=conte55a,domain=ASANDCO,vers=1.0,uid=alan

    The above should all be one line. It returns:

    mount error(6): No such device or address

    It is unclear which device or address.

    I have read through the man page for cifs. That added nothing to what I already knew.

    $ smbclient -L //192.168.1.100 alan ## Displays all the shares correctly

    I cannot think of anything else to try. :(



    Linux Mint 21.3 kernel version 5.15.0-112-generic Cinnamon 6.0.4
    AMD Ryzen 7 7700, Radeon RX 6600, 32GB DDR5, 1TB SSD, 2TB Barracuda


    I tested here on LM213TST and it worked.

    Note that in my case, it did not accept the passage of an inline password,
    and insisted I type the password into the terminal. This could have consequences
    if buried in a script, such as you might be doing. I would recommend switching the syntax, to the syntax that uses a file containing USER and PASS information.

    But just for the sake of showing, "something works", which is ultra-important with SAMBA issues, here goes...

    bullwinkle@LM213TST:~$ sudo mkdir /mnt/sharemount

    bullwinkle@LM213TST:~$ sudo mount -t cifs //192.168.2.102/ramdrive /mnt/sharemount --verbose -o rw,noperm,username=bullwinkle,domain=WORKGROUP,vers=1.0,uid=bullwinkle

    Password for bullwinkle@//192.168.2.102/ramdrive:
    mount.cifs kernel mount options: ip=192.168.2.102,unc=\\192.168.2.102\ramdrive,noperm,vers=1.0,uid=1000,user=bullwinkle,domain=WORKGROUP,pass=ZZZZZ

    Listing the contents of /mnt/sharemount now, contained the remote content.

    bullwinkle@LM213TST:~$ sudo umount /mnt/sharemount # clean up later

    I see two friction-points, considering yours used to work before.

    1) Your workgroup details changed or are different on the two machines.
    Check the declaration in /etc/samba/smb.conf

    2) The password behavior I observed, needs to be corrected.
    Try passing credentials by indirection (use the file with the USER and PASS info in it).
    It's like it was slapping my fingers.

    I passed this:

    username=bullwinkle,password=something

    and the response I get is

    Enter the password for bullwinkle, you twit

    Which means it is warning me of the security implications of putting
    the password in the script. The perms on the credential file can be
    600, to make the thing feel better about itself.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to pinnerite on Sun Jun 16 14:42:25 2024
    XPost: alt.os.linux.mint, alt.os.linux.mageia

    On 6/16/2024 8:29 AM, pinnerite wrote:
    On Sat, 15 Jun 2024 19:44:38 -0400
    Paul <nospam@needed.invalid> wrote:

    On 6/15/2024 1:23 PM, pinnerite wrote:
    This is a summary of where I amm now.

    The share section in smb.conf on 192.168.1.100

    [data]
    comment = data
    path = /home/Data
    valid users = alan
    admin users = alan
    read only = No

    The target drive is 192.168.1.4
    I am trying to mount it on /spare/albury/Data.

    This is the mount command:

    sudo mount -t cifs //192.168.1.4/data/ /spare/albury/Data --verbose -o
    rw,noperm,username=alan,password=conte55a,domain=ASANDCO,vers=1.0,uid=alan >>>
    The above should all be one line. It returns:

    mount error(6): No such device or address

    It is unclear which device or address.

    I have read through the man page for cifs. That added nothing to what I already knew.

    $ smbclient -L //192.168.1.100 alan ## Displays all the shares correctly >>>
    I cannot think of anything else to try. :(



    Linux Mint 21.3 kernel version 5.15.0-112-generic Cinnamon 6.0.4
    AMD Ryzen 7 7700, Radeon RX 6600, 32GB DDR5, 1TB SSD, 2TB Barracuda


    I tested here on LM213TST and it worked.

    Note that in my case, it did not accept the passage of an inline password, >> and insisted I type the password into the terminal. This could have consequences
    if buried in a script, such as you might be doing. I would recommend switching
    the syntax, to the syntax that uses a file containing USER and PASS information.

    But just for the sake of showing, "something works", which is ultra-important
    with SAMBA issues, here goes...

    bullwinkle@LM213TST:~$ sudo mkdir /mnt/sharemount

    bullwinkle@LM213TST:~$ sudo mount -t cifs //192.168.2.102/ramdrive /mnt/sharemount --verbose -o rw,noperm,username=bullwinkle,domain=WORKGROUP,vers=1.0,uid=bullwinkle

    Password for bullwinkle@//192.168.2.102/ramdrive:
    mount.cifs kernel mount options: ip=192.168.2.102,unc=\\192.168.2.102\ramdrive,noperm,vers=1.0,uid=1000,user=bullwinkle,domain=WORKGROUP,pass=ZZZZZ

    Listing the contents of /mnt/sharemount now, contained the remote content. >>
    bullwinkle@LM213TST:~$ sudo umount /mnt/sharemount # clean up later

    I see two friction-points, considering yours used to work before.

    1) Your workgroup details changed or are different on the two machines.
    Check the declaration in /etc/samba/smb.conf

    2) The password behavior I observed, needs to be corrected.
    Try passing credentials by indirection (use the file with the USER and PASS info in it).
    It's like it was slapping my fingers.

    I passed this:

    username=bullwinkle,password=something

    and the response I get is

    Enter the password for bullwinkle, you twit

    Which means it is warning me of the security implications of putting
    the password in the script. The perms on the credential file can be
    600, to make the thing feel better about itself.

    Paul



    I tried what you suggested but I still get mount error (6)

    I appreciate your efforts though.

    Alan


    Which of these did you intend to use ?

    //192.168.1.4/data/

    //192.168.1.100/data/

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Purgert@21:1/5 to Jonathan N. Little on Wed Jun 26 12:58:09 2024
    XPost: alt.os.linux.mint, alt.os.linux.mageia

    On 2024-06-24, Jonathan N. Little wrote:
    pinnerite wrote:
    Sorry the (except).
    The backup should have gone to /spare/albury/Data but instead went
    to /spare/albury/Data/Data. A slash to few or too many I guess.

    Common rsync error. If you want to backup contents of dir
    '/target/path/Data' to '/backup/path/Data' don't put trailing slash on destination path. So rsync command for above example

    rsync -r '/target/path/Data/ /backup/path/Data
    ^ ^
    | |
    slash here not here

    To expand upon this a little, the trailing slash only matters for the
    SOURCE directory; "DESTINATION" vs. "DESTINATION/" is equivalent to
    rsync.

    As written ("SOURCE/"), rsync will treat SOURCE as a starting point, and
    only copy the contents of SOURCE to DESTINATION -- that is, a file "SOURCE/dir/file" will end up as "DESTINATION/dir/file".

    If you do not include the slash on SOURCE, then the final directory
    named in SOURCE is included in the DESTINATION -- that is "/path/to/SOURCE/dir/file" will end up as
    "DESTINATION/SOURCE/dir/fil"

    HTH

    --
    |_|O|_|
    |_|_|O| Github: https://github.com/dpurgert
    |O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)