Results 1 to 7 of 7

Thread: Copying directories to cifs mount fails

  1. #1
    Join Date
    Mar 2005
    Beans
    8

    Cool Copying directories to cifs mount fails

    I am getting some odd behavior from my ubuntu when trying to copy a file from the ubuntu computer to a mounted cifs drive.

    While copying a number of folders to the cifs drive, the first folders are copied successfully, but at some point it fails and the rest of the folders ends up as zero size files with the same names as the folders.

    These files:
    • Can be seen from the Ubuntu computer
    • Cannot be deleted from the ubuntu computer
    • Cannot be seen from a windows computer
    • Can only be deleted if i unmount the drive (usb drive connected to NAS), mount the drive on a windows computer and run the disk error checking feature in windows.

    This is the line in fstab that mounts the disk:
    //192.168.15.1/netdisk /home/user/Netdisk cifs username=user,password=pass,iocharset=utf8,nounix, file_mode=0777,dir_mode=0777 0 0

  2. #2
    Join Date
    Jun 2006
    Location
    Adelaide, South Australia
    Beans
    213
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Copying directories to cifs mount fails

    Quote Originally Posted by Lemon View Post
    While copying a number of folders to the cifs drive, the first folders are copied successfully, but at some point it fails and the rest of the folders ends up as zero size

    This is the line in fstab that mounts the disk:
    //192.168.15.1/netdisk /home/user/Netdisk cifs username=user,password=pass,iocharset=utf8,nounix, file_mode=0777,dir_mode=0777 0 0


    Hi Lemon,

    I had a similar problem a while back, in could quite possibly be the same issue.

    Here's my fstab line ...

    Code:
    //192.168.7.2/media /media/media cifs auto,user=me,password=mine,uid=myuser,gid=mygroup,dir_mode=0770,file_mode=0770,nounix 0 0
    You'll notice the UID and GID options in there. You'ce already got file_mode and dir_mode=0777 which is cool, but using the uid and gid actually can make the mount point owned by you, instead of root. And then file/dir mode 0770 prevents anyone else accessing it.

    But the big one for me was the NOUNIX option. Without this, ubuntu would try to negotiate permissions with my NAS. Of course the NAS does not support full samba, only partial samba, hence it would all fail. With NOUNIX it works fine.

    Also just a tip - I noticed you put your fstab line in blue. It's probably best to put that between CODE and /CODE tags instead, like I have. Reember to put [ and ] around the CODE and /CODE.

    Let us know how the NOUNIX thing goes!

    Cheers
    Callan

  3. #3
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Copying directories to cifs mount fails

    If that doesn't work, please see the troubleshooting section in my CIFS tutorial. It's the second link in my sig.

  4. #4
    Join Date
    Mar 2005
    Beans
    8

    Re: Copying directories to cifs mount fails

    Quote Originally Posted by callan79 View Post
    You'll notice the UID and GID options in there. You'ce already got file_mode and dir_mode=0777 which is cool, but using the uid and gid actually can make the mount point owned by you, instead of root. And then file/dir mode 0770 prevents anyone else accessing it.
    I already found the NOUNIX option, which made the whole browsing experience much quicker.

    The UID and GID options are nice too... unfortunately i still have the same problem.

    dmizer: your guide was the one i followed in the first place, getting the hint of NOUNIX.

    What i see happening is:

    • Ubuntu creates directory.
    • Directory ends up not existing, neither as a directory nor as a file.
    • copying the files halfway succeeds: The data is copied, but can't be found anywhere on the disk - except when doing the disk scan in windows afterwards.


    EDIT: I just tried copying some files using Midnight Commander - that seemed to work. Maybe it's just Nautilus that gives me trouble?

    2. EDIT: No, as soon as i left the directory and entered it again, the folders had reverted to non-files.

    3. EDIT: I must conclude that whatever error i'm getting, it's not caused directly by the Ubuntu box. When copying the directories they look okay at first, both from Ubuntu and looking from a windows computer - but after a moment they are dead files and not directories. So the ubuntu computer is doint it's part but the NAS is messing it up afterwards.
    Last edited by Lemon; September 22nd, 2009 at 10:16 PM. Reason: Adding

  5. #5
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Copying directories to cifs mount fails

    Ah hah. You're using a NAS device? What NAS device are you using (make and model)?

  6. #6
    Join Date
    Mar 2005
    Beans
    8

    Re: Copying directories to cifs mount fails

    I WAS using a Linksys WRT610N with firmware 1.00.03.15. The linksys has a TrekStor eksternal USB harddrive attached.

    Now i've downgraded to firmware 1.00.00.18 instead, and it seems to work fine (although slightly slower).

    Edit: No luck - apparently the problem persist in a slightly other form: the directories that i copy are empty from the ubuntu box, and not accessible from the windows box.
    Last edited by Lemon; September 29th, 2009 at 06:37 PM.

  7. #7
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Copying directories to cifs mount fails

    So the WRT610N has a USB port for attaching a hard drive?

    If so, does the WRT610N support FTP access to the USB drive?

    Edit:
    Answered my own questions.

    Yes, your router does have a USB port for external storage. And, yes your router does support FTP access to your disk.

    So, I suggest that you try FTP instead of Samba for this. You won't have to open any ports on the router, FTP access will only be available on your LAN. The manual for your router should give you more information about this. If you don't know where it is, you can get a copy here: http://www.linksysbycisco.com/US/en/...T610N/download (chapter 3)
    Last edited by dmizer; October 1st, 2009 at 01:39 PM.

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
  •