I tryed to mount my nas automatically in fstab like this:

// /mnt/Musik cifs username=sandro,password=mypassword, iocharset=utf8, uid=1000, gid=1000, file_mode=0777,dir_mode=0777  0  0

However i still don't get the rights to add remove new files. I thought adding uid gid solved it because it mounts the drive like its your own. I got the uid/ gid from id:

uid=1000(sandro) gid=1000(sandro) groups=1000(sandro),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lpadmin),125(sambashare)
  • 1
    You have many many spaces between comma-separated-values. The space separates parameter types, so the meaning completely changes with spaces. What release of Ubuntu/OS?
    – guiverc
    Jul 20 '19 at 9:31
  • you safed my day you have no idea how long i searched and couln't come up with the spaces as the issue. I Thought they don't matter. Its Ubuntu 18.04 LTS ‘Bionic Beaver’
    – Sandro4912
    Jul 20 '19 at 9:36

The file-system-table (/etc/fstab) file contains six fields separated by white-space (spaces or tabs) and your entry in the question contains many many spaces in wrong places.

The additional spaces between comma-separated-values act to change the parameters you want all in parameter-4 (mount-options) so most go to wrong or non-existent fields. The extra spaces as placed is your problem.

You need :-

// /mnt/Musik cifs username=sandro,password=mypassword,iocharset=utf8,uid=1000,gid=1000,file_mode=0777,dir_mode=0777  0  0

Like hinted int the comments. The Solution was to remove the spaces between commas:

// /mnt/Musik cifs username=sandro,password=mypassword,iocharset=utf8,uid=1000,gid=1000,file_mode=0777,dir_mode=0777  0  0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.