Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: Mounting NAS, fstab, mount failed

  1. #1
    Join Date
    Jun 2008
    Location
    Madrid
    Posts
    81

    Default Mounting NAS, fstab, mount failed

    I followed Swerdna's guide to mount an NAS (on SuSE 11.4)

    I added the following line to the beginning of /etc/fstab:

    //192.168.1.130/nas /media/nas cifs credentials=/root/smb/credentials,_netdev,uid=userid,gid=users 0 0
    (where userid is my username, the static IP and shared folder are correct, and /media/nas has been created)

    I checked in system settings that smb was running under runlevels. I doubled checked the credentials file I created and the name of the shared file on the NAS.
    I first got the error that only root could mount this, and then I got the error:

    "An error occurred while accessing 'nas on //192.168.1.130', the system responded: mount: according to mtab, //192.168.1.130/nas/ is already mounted on /media/nas
    mount failed"
    I didn't get any errors when running
    Code:
    # mount -a
    It seems that that the network folder is accessible via terminal (I could copy something into it), but not in the file manager Dolphin. Any tips or suggestions to resolve this?
    Thanks in advance for any help.
    SuSE-12.3, Lenovo G780, 3.7.10-1.16-desktop

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    16,107

    Default Re: Mounting NAS, fstab, mount failed

    Do not use directories inside /media for static mounted (via fstab) defined mounts. /media is for the dynamic mounts the system does for end-users when they insert media. From openSUSE 12.1 (well, not exactly that, but from a certain kernel) on, /media is a RAM mounted filesystem and thus vulnarable. In other words, your mount-point id gone after shutdown (and will not reuirn at boot).

    Use some other mount point. Prefreable at the pint where you need that part of your directory tree, but when you have lack of imagination, you could go inside /mnt.

    And of course mounts must ne done by root.

    PS you apprently know how COPDE tags work. Why isn't your fstab entry posted between them? And why not the error message?
    Henk van Velden

  3. #3
    Join Date
    Jun 2008
    Location
    Madrid
    Posts
    81

    Default Re: Mounting NAS, fstab, mount failed

    Thanks for the reply. I'll try for better formatting here. I think I've made a mess of things.
    I first changed the mount directory unimaginatively to /mnt/nas, and got the following error:

    Code:
    An error occurred while accessing 'nas on //192.168.1.130', the system responded: mount: only root can mount //192.168.1.130/nas on /mnt/nas
    I figured that fstab would mount it and setting the uid to user would allow me read/write access. Apparently more needs to be done. I searched around and found a similar thread on archlinux site, and followed their suggestion:
    Code:
    sudo chmod +s /sbin/mount.cifs
    sudo chown user:users /mnt/nas
    sudo chmod u=rwx,g=,o= /mnt/nas
    This didn't work, but had the unfortunate side effect:
    Code:
    sudo mount -a
    root's password:
    mount error(13): Permission denied
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    
    mount -a
    mount: only root can do that
    I would like to use the NAS directory as a user and not just when signed in as root. I see some other suggestions online for this, but I think I need to resolve this issue first? Is this a result of the
    Code:
    sudo chmod +s /sbin/mount.cifs
    ?
    SuSE-12.3, Lenovo G780, 3.7.10-1.16-desktop

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    16,107

    Default Re: Mounting NAS, fstab, mount failed

    Code:
    sudo chmod +s /sbin/mount.cifs
    You should never do things like this. You will bork your system meddling around with the security of your system tools.

    I will be back, the lady of the hous calls me
    Henk van Velden

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    16,107

    Default Re: Mounting NAS, fstab, mount failed

    This might be a bit diificult because IMHO you leave out a lot of information about what you do.
    ===================================
    Quote Originally Posted by roidemai View Post
    Thanks for the reply. I'll try for better formatting here. I think I've made a mess of things.
    I first changed the mount directory unimaginatively to /mnt/nas, and got the following error:

    Code:
    An error occurred while accessing 'nas on //192.168.1.130', the system responded: mount: only root can mount //192.168.1.130/nas on /mnt/nas
    Where did you change that? In /etc.fstab, then please show this with
    Code:
    cat /etc/fstab
    You got that error. What did you do when you got that error? Please complete descriptions and post complete from the terminal: prompt, command and output. Not jus part of it.
    ====================================
    Quote Originally Posted by roidemai View Post
    I figured that fstab would mount it and setting the uid to user would allow me read/write access. Apparently more needs to be done. I searched around and found a similar thread on archlinux site, and followed their suggestion:
    Code:
    sudo chmod +s /sbin/mount.cifs
    sudo chown user:users /mnt/nas
    sudo chmod u=rwx,g=,o= /mnt/nas
    You seem to have a misconception here. fstab does not mount anything. It does not do anything. It is a configaration file, not a tool/program.
    I told you allready that changing persmissions on system files is a certain way to brae your system. Thus my strong advise to undo asap the first statement with
    Code:
    chmod -s /sbin/mount.cifs
    ==============================
    (BTW all these stments must be done as root. to become root do
    Code:
    su -
    mind the - sign there, and to leave your root session type
    Code:
    exit
    . Much easier then misusing sudo for a sequence ofstatements).
    ================================
    EDIT: Sorry I hit the send key to early. On to next post
    Quote Originally Posted by roidemai View Post
    This didn't work, but had the unfortunate side effect:
    Code:
    sudo mount -a
    root's password:
    mount error(13): Permission denied
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    
    mount -a
    mount: only root can do that
    I would like to use the NAS directory as a user and not just when signed in as root. I see some other suggestions online for this, but I think I need to resolve this issue first? Is this a result of the
    Code:
    sudo chmod +s /sbin/mount.cifs
    ?
    Last edited by hcvv; 13-Jun-2012 at 10:22.
    Henk van Velden

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    16,107

    Default Re: Mounting NAS, fstab, mount failed

    About the chown and chmod of /mnt/nas.
    The ownership and permissioons of /mnt/nas should of course be set correct. But what is correct depends on what you are trying to achieve. That may be the most important thing that is missing here. What is your goal?
    The fact that you can not mount has btw nothing to do with thses ownership/permissions. They only influence access after a successfull mount.

    You seem to have a NAS that exports/shares file systems. Now, you did not tell, but from what you show I come to the conclusion that it shares with SAMBA and does not export with NFS (the latter is the standard Unix/Linux way of doing this).

    I assume that you are aware that SAMBA exported shares are non-LINUX file systems (when mounted ) and thus have their limitations.

    It is not complete clear to me if you want this share, when mounted, to be usable system wide (by all your users), or by one user only.

    You also seem to be amazed by the fact that only root can mount. Of course, think about some silly user that mounts/unmounts all sorts of file systems at her/his own will.

    Now my advice is that you post your /etc/fstab in the way I asked in the other thread and that you post then
    Code:
    mount /mnt/nas
    (of course as root using su - as described above).

    And then please do not go and consult all sorts of pages on the web and change things. You either try here in a way that you can follow our steps and we can follow your steps, or you go elsewhere. Jumping around and doing all things in a mix is a recipe for disaster.
    Henk van Velden

  7. #7
    Join Date
    Jun 2008
    Location
    Madrid
    Posts
    81

    Default Re: Mounting NAS, fstab, mount failed

    The overall goal is to use a WD MyBookLive NAS to backup files periodically and store media. As far as SAMBA/NFS, there doesn't seem to be any official linux support for this device, and other linux users online appear to set up some sort of SAMBA share with the device. Swerdna's guide gave step by step instructions for such a setup, so I chose to follow it, but didn't find a resolution to the mounting problem. If there's another method without the limitations of samba, I'm all ears. For the time being, I only need this to be shared with one user when mounted, but that will soon change (any hopefully only require changing group/user priviliges I imagine?).

    As for the code you asked for:

    Code:
    cat /etc/fstab
    //192.168.1.130/nas /mnt/nas cifs credentials=/root/smb/credentials,_netdev,uid=aaa,gid=users 0 0
    ...
    credentials are correct (triple and quadruple checked), folders exist, smb running.

    Code:
    # chmod -s /sbin/mount.cifs
    # mount /mnt/nas
    mount error(13): Permission denied
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    (****. this "permission denied" is all after having executed chmod +s /sbin/mount.cifs.)

    As for the provenance of the following error message, it appeared in dolphin when I attempting to open the samba share configured in fstab.
    Code:
    An error occurred while accessing 'nas on //192.168.1.130', the system responded: mount: only root can mount //192.168.1.130/nas on /mnt/nas
    SuSE-12.3, Lenovo G780, 3.7.10-1.16-desktop

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    23,026

    Default Re: Mounting NAS, fstab, mount failed

    On 2012-06-13 23:16, roidemai wrote:

    > Code:
    > --------------------
    > cat /etc/fstab
    > //192.168.1.130/nas /mnt/nas cifs credentials=/root/smb/credentials,_netdev,uid=aaa,gid=users 0 0
    > ...
    >
    > --------------------


    For mounting as user you need to add the option "user" or "users".


    > Code:
    > --------------------
    > # chmod -s /sbin/mount.cifs
    > # mount /mnt/nas
    > mount error(13): Permission denied
    > Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    >
    > --------------------


    I'm sure that there are some letters to the left of the '#' - and they are
    important. I can't say what I think it might be because I'm not sure of
    those letters.

    Please, complete paste!

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  9. #9
    Join Date
    Jun 2008
    Location
    Madrid
    Posts
    81

    Default Re: Mounting NAS, fstab, mount failed

    Quote Originally Posted by robin_listas View Post
    On 2012-06-13 23:16, roidemai wrote:

    > Code:
    > --------------------
    > cat /etc/fstab
    > //192.168.1.130/nas /mnt/nas cifs credentials=/root/smb/credentials,_netdev,uid=aaa,gid=users 0 0
    > ...
    >
    > --------------------


    For mounting as user you need to add the option "user" or "users".
    Might you provide an example of how to alter the fstab entry for this option?


    > Code:
    > --------------------
    > # chmod -s /sbin/mount.cifs
    > # mount /mnt/nas
    > mount error(13): Permission denied
    > Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    >
    > --------------------

    I'm sure that there are some letters to the left of the '#' - and they are
    important. I can't say what I think it might be because I'm not sure of
    those letters.

    Please, complete paste!

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)
    I'm very curious now why this is important...

    Code:
    linux-8nxi:/home/aaa #
    SuSE-12.3, Lenovo G780, 3.7.10-1.16-desktop

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    23,026

    Default Re: Mounting NAS, fstab, mount failed

    On 2012-06-14 05:36, roidemai wrote:
    >
    > robin_listas;2469230 Wrote:


    >> For mounting as user you need to add the option "user" or "users".

    >
    > Might you provide an example of how to alter the fstab entry for this
    > option?


    Code:
    //192.168.1.130/nas /mnt/nas cifs
    credentials=/root/smb/credentials,_netdev,uid=aaa,gid=users,user 0 0


    > Code:
    > --------------------
    >
    > linux-8nxi:/home/aaa #
    > --------------------


    Just what I thought! You are using "su". You must use "su -" and try again.
    Now guess how I know ;-)


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

Page 1 of 4 123 ... LastLast

Posting Permissions

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