Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Shared files all seen as folders on client machine

  1. #1
    Join Date
    Oct 2011
    Location
    Ohio, USA
    Beans
    443
    Distro
    Ubuntu

    Shared files all seen as folders on client machine

    I hope the title makes sense.

    I have two XUBUNTU machines. The host machine can access all the folders I've shared and opens the files using the extensions for each file. On the client machine (with a newly-installed 20.04LTS system) I can access the shared folders BUT it sees every file as a folder, not as a valid JPG, TXT or whatnot. For example, I have a folder on the host with a number of pictures (all JPG) I use as desktop pictures. On the host, they are fine. One the client, all the JPGs show up as folders and cannot be accessed, with the error being "not a folder". Well, duh, a JPG isn't a folder. So why are all the files (TXT, JPG, MP3, MP4, etc) all showing up as folders?

    I've set up Samba on the client machine exactly the same as the host, and can access SOME of the shared files on the host correctly, just not those in newly created folders (say, in the last three months). There does not appear to be any difference in the permissions on the host. I've allowed everyone read/write permission.

    There is a bug report on Bugzilla flagging this strange thing. The link is here: https://bugzilla.redhat.com/show_bug.cgi?id=1797875
    In the report, the first two attached screenshots look EXACTLY like mine. The bug has been written off, but I think it's still around.

    Bill
    Been in computers since 1962; Windows computers almost gone now. Only 1 gaming machine left.

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Shared files all seen as folders on client machine

    If both machines are running Linux, use NFS, not Samba.

    https://help.ubuntu.com/community/SettingUpNFSHowTo
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Oct 2011
    Location
    Ohio, USA
    Beans
    443
    Distro
    Ubuntu

    Re: Shared files all seen as folders on client machine

    Wow. That seems incredibly complicated to implement as well as maintain, but thanks for the info.

    What I should have emphasized is that MOST of the directories I've shared on the host machine can be read properly by the client. Only four newly-created (on the host machine) directories exhibit this behaviour. I see now that Samba doesn't really play a part in this, being normally used with Windows, as Thunar and the 'normal' file-handling app should see the directories properly. Something has recently changed that caused this problem.

    I can create a new directory on the host from the client, move files into it, and they're all see as what their extension say they are. I can create a new directory on the client from the host, move files into it, and they are seen correctly as per extension. What I cannot do is see the host files in four shared directories on the host as they are listed as directories but they are not. Could there be some permission or mode I've missed? Because I can't see any discernible differences between functional directories and non-functional directories on the host.

    This is quite hard to explain.

    BIll
    Been in computers since 1962; Windows computers almost gone now. Only 1 gaming machine left.

  4. #4
    Join Date
    Dec 2009
    Beans
    6,772

    Re: Shared files all seen as folders on client machine

    I have seen reports on this before but I have yet to experience it myself:

    https://bugs.launchpad.net/ubuntu/+s...a/+bug/1872476
    https://bugs.launchpad.net/ubuntu/+s...a/+bug/1902398
    https://askubuntu.com/questions/1288...yed-as-folders

    They say they fixed it and everyone agrees then someone post "no it ain't fixed" and the bug report is opened again. It all seems to happen when one connects to the server through the file manger.

    Have you ever tried to connect with a cifs mount?

    Create a mount point, then connect - temporarily - with a manual cifs mount just to see if the same problem occurs:

    Code:
    sudo mount -t cifs //server-host-name.local/share-name /mount-point -o guest,uid=1000

  5. #5
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Shared files all seen as folders on client machine

    Quote Originally Posted by WB0HYQ View Post
    Wow. That seems incredibly complicated to implement as well as maintain, but thanks for the info.
    I think it's easier than implementing Samba. Plus NFS is native to *nix systems and preserves things like user and group permissions and modification dates.

    Install nfs-kernel-server on the server and nfs-common on the client.

    On the server, create or edit (as root with sudo) the file /etc/exports to define the exported shares. I use entries like this:
    Code:
    /home     192.168.100.0/24(rw,async,no_root_squash,insecure,no_subtree_check,fsid=0)
    With NFSv4, now the default, each exported filesystem needs a different fsid, e.g., fsid=1, fsid=2, etc.

    Start the NFS server with "sudo systemctl start nfs-kernel-server".

    Now, on the client, create mount points like "/media/remote_home" below, then add entries to /etc/fstab like this:

    Code:
     
    server_name:/home   /media/remote_home   nfs   noauto,x-systemd.automount,x-systemd.mount-timeout=30,_netdev 0 0
    I use automounting via systemd.

    That's it.
    Last edited by SeijiSensei; November 18th, 2020 at 07:26 PM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  6. #6
    Join Date
    Oct 2011
    Location
    Ohio, USA
    Beans
    443
    Distro
    Ubuntu

    Re: Shared files all seen as folders on client machine

    @SejiSensei: I really appreciated what effort you've put into this, but I only half-understand what you're saying. I am not a Linux tech. Just a user with a little more system knowledge than the average guy. I have never created a mount point, nor used NFS. What you've said is over my head.

    @Morbius: I see that the three links all detail exactly what I'm seeing. What bothers me is that SOME of the shared files on my host system are fine, and work properly from my client, but others are messed up and show as folders. When I run 'ls -al' on the host, I see: "-rwxrwxrwx" for all my JPG files. In the same directory on my client, I see: "drwx------" for the SAME file! This is definitely strange. Why would one system see a file's attributes differently than another?

    I'll give the cifs mount thing a try and see what happens

    EDIT:::::: The cifs mount command keeps giving me errors, mostly about my mount point not being in fstab (?).

    Bill
    Last edited by WB0HYQ; November 18th, 2020 at 08:00 PM.
    Been in computers since 1962; Windows computers almost gone now. Only 1 gaming machine left.

  7. #7
    Join Date
    Dec 2009
    Beans
    6,772

    Re: Shared files all seen as folders on client machine

    If you go to the machine with the shares and post the output of the following commands I can tailor make a set of instructions:
    Code:
    testparm -s
    Code:
    net usershare info --long
    Code:
    hostname

  8. #8
    Join Date
    Oct 2011
    Location
    Ohio, USA
    Beans
    443
    Distro
    Ubuntu

    Re: Shared files all seen as folders on client machine

    Here's testparm results:

    Code:
    bill@bill-UBU:~$ testparm -s
    Load smb config files from /etc/samba/smb.conf
    WARNING: The "syslog" option is deprecated
    NOTE: Service Novels is flagged unavailable.
    NOTE: Service Wallpapers is flagged unavailable.
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    
    # Global parameters
    [global]
        dns proxy = No
        log file = /var/log/samba/log.%m
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        pam password change = Yes
        panic action = /usr/share/samba/panic-action %d
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        security = USER
        server role = standalone server
        server string = %h server (Samba, Ubuntu)
        syslog = 0
        unix password sync = Yes
        username map = /etc/samba/smbusers
        usershare allow guests = Yes
        workgroup = COMNET
        idmap config * : backend = tdb
    
    
    [printers]
        browseable = No
        comment = All Printers
        create mask = 0700
        path = /var/spool/samba
        printable = Yes
    
    
    [print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
    
    
    [Novels]
        available = No
        comment = My Novels
        guest ok = Yes
        path = /home/bill/Novels
        read only = No
    
    
    [Wallpapers]
        available = No
        guest ok = Yes
        path = /home/bill/Pictures/Japan/Wallpapers
        read only = No
    
    
    [bill]
        guest ok = Yes
        path = /home/bill
        read only = No
    
    
    [Big_U]
        guest ok = Yes
        path = /media/bill/Big_U
        read only = No
    Here's net usershare info --long

    Code:
    bill@bill-UBU:~$ net usershare info --long
    info_fn: file /var/lib/samba/usershares/music is not a well formed usershare file.
    info_fn: Error was Path is not a directory.
    [Big_U]
    path=/media/bill/Big_U
    comment=
    usershare_acl=Everyone:F,
    guest_ok=n
    
    [Public]
    path=/home/bill/Public
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y
    
    [Desktop Pics 2]
    path=/media/bill/Big_U/Desktop Pics 2
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y
    
    [Desktop Pics]
    path=/media/bill/Big_U/Desktop Pics
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y
    And the hostname:

    Code:
    bill@bill-UBU:~$ hostname
    bill-UBU
    This is on the computer I am calling HOST, not the CLIENT. My primary focus is on "Big-U" and two subdirectories of Big_U: "Desktop Pics" and "Desktop Pics 2"

    Bill
    Been in computers since 1962; Windows computers almost gone now. Only 1 gaming machine left.

  9. #9
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Shared files all seen as folders on client machine

    Quote Originally Posted by WB0HYQ View Post
    @SejiSensei: I really appreciated what effort you've put into this, but I only half-understand what you're saying. I am not a Linux tech. Just a user with a little more system knowledge than the average guy. I have never created a mount point, nor used NFS. What you've said is over my head.
    "Creating a mount point" means just creating an empty directory to which the remote share will be attached. So in the example I gave, you would run
    Code:
    sudo mkdir /media/remote_home
    Otherwise after installing nfs-kernel-server and nfs-common, you can just edit the files I mentioned with sudo ("sudo nano /etc/exports" for instance) with modifications to match your own installation.

    You can export the same directories with both Samba and NFS. My server is configured this way so I can see directories there for the rare times I run Windows.
    Last edited by SeijiSensei; November 18th, 2020 at 09:03 PM.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  10. #10
    Join Date
    Dec 2009
    Beans
    6,772

    Re: Shared files all seen as folders on client machine

    My primary focus is on "Big-U"
    You have a lot of issues with the way you are set up. There are a lot of things to get fixed but for the sake of this exercise:

    On the CLIENT
    =========

    [1] Create a mount point under /media:
    Code:
    sudo mkdir /media/Big-U
    [2] Then create a temporary mount:
    Code:
    sudo mount -t cifs //bill-UBU.local/Big-U /media/Big-U -o username=bill,password=xxxxx,uid=1000
    ** Replace xxxxx with the samba password for the user bill on the server.

    ** In case you have not done so create the samba password for bill - on the SERVER:
    Code:
    sudo smbpasswd -a bill
    Note: You have multiple shares that allow guest access that will only work if "bill" accesses them and you have duplicate shares on the same target with the same label that are configured differently.

Page 1 of 2 12 LastLast

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
  •