how to unmount (CIFS) NAS on shutdown?

Discussion in 'Linux' started by mailman1175, Jun 16, 2009.

  1. mailman1175

    mailman1175

    Joined:
    Sep 1, 2008
    Messages:
    41
    Likes Received:
    0
    I added an entry to /etc/fstab to automagically mount my NAS on start-up:

    Code:
    # Entry for automounting network attached storage locally
    //192.168.2.5/MyBook /home/jeff/MyBook cifs
    fmask=0777,dmask=0777,auto,sync 0 0
    On shut-down, though, I often get an error message. Something along the lines of

    Code:
    CIFS server not responding
    And it will fail to unmount the share. Is there someplace I can add an entry (like I did for fstab) to forcibly unmount during the shutdown process?
     
    mailman1175, Jun 16, 2009
    #1
  2. mailman1175

    truxntrax

    Joined:
    Dec 12, 2008
    Messages:
    12
    Likes Received:
    0
    Bump - same problem here takes ages to shutdown due to cifs unmount I think.
     
    truxntrax, Jun 19, 2009
    #2
  3. mailman1175

    Andysan

    Joined:
    Jul 9, 2008
    Messages:
    272
    Likes Received:
    0
    I think this happens with all shares mounted via CIFS. I have some server shares mounted that aren't NAS and get the same message - it takes ages to shut down.

    I would guess that it shuts down the networking daemon before the filesystem and hence cannot unmount the shares correctly, but i could be talking out of my backside - wouldn't be the first time!
     
    Andysan, Jun 21, 2009
    #3
  4. mailman1175

    mailman1175

    Joined:
    Sep 1, 2008
    Messages:
    41
    Likes Received:
    0
    The other opinions I've gotten seem to concur with yours, Andysan: Network manager gets shut down before it unmounts shares. They also seem to think it's not that big of a deal.
     
    mailman1175, Jun 21, 2009
    #4
  5. mailman1175

    mailman1175

    Joined:
    Sep 1, 2008
    Messages:
    41
    Likes Received:
    0
    I do have a follow-up question, though: I don't have ownership/permissions set right on the share. I can't modify any files. I've tried to chown to me, but it says permission denied. I've tried to set permissions on the Windows side such that it's shared read-/write-able, but it always seems to revert. I assume my problems are with XP... but I can't figger it out. Any idea what I can do to get read/write permissions set correctly?
     
    mailman1175, Jun 21, 2009
    #5
  6. mailman1175

    Andysan

    Joined:
    Jul 9, 2008
    Messages:
    272
    Likes Received:
    0
    Try adding the noperm parameter to your fstab entry. This tells the client to let the server side handle the permissions. If your permissions on the server side are OK then this should work.

    Code:
    //192.168.2.5/MyBook /home/jeff/MyBook cifs
    fmask=0777,dmask=0777,noperm,auto,sync 0 0
     
    Andysan, Jun 21, 2009
    #6
  7. mailman1175

    truxntrax

    Joined:
    Dec 12, 2008
    Messages:
    12
    Likes Received:
    0
    So is there anyway to help speed up the shutdown process?

    Ta
     
    truxntrax, Jun 23, 2009
    #7
  8. mailman1175

    Andysan

    Joined:
    Jul 9, 2008
    Messages:
    272
    Likes Received:
    0
    I have found one solution, but have not tested it and therefore do not know of the ramifications:

    Do this in a terminal:

    Code:
    cd /etc/rc6.d
    ls -la
    You will see two files S31umountnfs.sh and S15wpa-ifupdown.sh. The number represents the order at which the script runs. All you need to do is change when the umountnfs.sh script runs. Do that by typing in:

    Code:
    sudo mv S31umountnfs.sh S14umountnfs.sh
    You will need to run the command one more time in the /etc/rc0.d folder too.

    Source
     
    Andysan, Jun 23, 2009
    #8
  9. mailman1175

    truxntrax

    Joined:
    Dec 12, 2008
    Messages:
    12
    Likes Received:
    0
    Thanks will give this a try and report back.
     
    truxntrax, Jun 24, 2009
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.