Page 20 of 21 FirstFirst ... 1018192021 LastLast
Results 191 to 200 of 207

Thread: how to: automatically umount cifs partitions

  1. #191
    Join Date
    Feb 2007
    Beans
    33

    Re: how to: automatically umount cifs partitions

    Quote Originally Posted by kaiben View Post
    Oh no! I upgraded yesterday to karmic and this problem again! Will the Ubuntu team never fix this?!

    Has anybody logged a bug already?
    This is a long-standing Debian issue, with internal arguments about whose 'fault' it is paralysing any action to fix it. See, for example,

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=431966

    or

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481252

    Look at the dates; and if you have the time and patience to investigate a bit more you'll find it's been going on for years longer. (Free software at its worst.)

  2. #192
    Join Date
    Oct 2009
    Beans
    16

    Re: how to: automatically umount cifs partitions

    I found a fix for the CIFS VFS error issue during shutdown & reboot. It works on Karmic while using wireless. I posted it here:
    http://ubuntuforums.org/showthread.p...27#post8449027
    Last edited by ubradford; December 6th, 2009 at 10:47 AM.

  3. #193
    Join Date
    Oct 2009
    Beans
    29

    Re: how to: automatically umount cifs partitions

    It really works great now!

    Thanks Dude!

  4. #194
    Join Date
    Oct 2009
    Location
    Mumbai, India
    Beans
    22
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: how to: automatically umount cifs partitions

    Hey All,

    I have had this problem too. I am working presently on Karmic and access network from wireless and wired connections at different times.

    I tried three different solutions for this problem:
    1. The one given here: http://ubuntuforums.org/showthread.php?t=1347340
    2. The one given by dmizer here: http://ubuntuforums.org/showthread.php?t=288534
    3. And the one given here: http://ubuntuforums.org/showthread.php?t=293513

    However none of the solutions fixed my problem. I read in one of the posts that the real problem was to run the /etc/init.d/umountnfs.sh before the system is killed.

    This gave me the simple idea, since I always have a terminal open, I wrote this bash function:

    function bringdown()
    {
    sudo /etc/init.d/umountnfs.sh && sudo shutdown -h now
    }

    This simply solves my problem.

    However I was thinking of a more generic solution. I have never tried scripting. I was wondering if there can be a more elegant and generic solution to this. I have an idea, someone please let me know if this is feasible.

    We can create a script which runs this function `bringdown' as given above (preferable without the need for a sudo password prompt [perhaps using a credentials file or using editing visudo]) and put this in the $PATH of each user, so that one can simply call the run dialog and bring the system down.

    Please let me know if writing such a script is possible and easy. I am willing to learn and do homework if any is needed.

    Thanks for reading the long post. Hoping for some replies.

  5. #195
    Join Date
    Jan 2010
    Beans
    1

    Re: how to: automatically umount cifs partitions

    Quote Originally Posted by Maddog Battie View Post
    As a temp solution I've added a link to sudo /etc/init.d/umountnfs.sh next to the shutdown button so I can click on that before hitting shutdown. Very much a cludge but it seems to work.

    If someone can come up with a better solution for 9.10 then please, please let me/us know.



    Im a new to linux, and ubutnu are new for me. Im a former windows user.
    So culd you give me a step by step howto make a link next to the shutdown button??

  6. #196
    Join Date
    Feb 2010
    Beans
    3

    Re: how to: automatically umount cifs partitions

    After spending a day working out how create fixed icons on the desktop that mount shares as and when needed i discovered this same problem when shutting down, it's just taken me another day to find a solution.

    I can't believe the complexity of the solutions given in this thread, and not one would work on 'Kinky' (9.10). This has obviously vexed a lot of people so I feel bound to share this with you all.

    http://archive.lug.boulder.co.us/Wee...30/006266.html

    add a line in /etc/gdm/PostSession/Defaults

    Code:
    umount -a -t cifs
    Simples!

    you dont even need sudo.

    I hope this helps some people.

    And in case you were wondering about my initial project here it is:

    Code:
    #!/bin/bash
    
    # author: Scott Mills - 27th Feb 2010
    
    ####################################################################################
    
    # reasons for this script:
    # 1. mounting at boot increases start-up time
    # 2. network folders not always available at boot
    # 3. unable to play video & audio from smb share
    # 4. desktop launchers for fstab mounted volumes tend to appear in random positions
    # 5. allows for custom geometry of browser window
    # 6. browsing to smb shares creates extra items in nautilus tree
    # 7. nautilus folder icon can be customised
    
    # requirements
    # 1. create mount exception in sudoers with visudo
    # 2. mount-point folders must exist (in /media)
    # 3. share name must be same as folder name
    # 4. credentials file should exist (smb)
    # 5. use config editor to turn off 'volumes visible' (optional)
    
    # automatic umount on logout (prevents hang at shutdown)
    # 1. open /etc/gdm/PostSession/Default as root
    # 2. add the line > umount -a -t cifs
    
    # usage
    # mnt <share name> [--geometry=<width>x<height>+<left>+<top>]
    
    # example
    # create custom application launcher
    # enter as command ./mnt tunes --geometry=1018x593+0+56 (assuming in ~)
    
    # result
    # mounts share 'tunes' in /media/tunes
    # opens large browser window in middle of screen (1024x768) in /media/tunes
    
    ####################################################################################
    
    # check for no args
    if [ "$1" = "" ]
    then
        echo "No value given"
        exit
    fi
    
    # is volume in the list of mounted volumes
    a=`sudo mount | grep $1`
    
    if [ "$a" == "" ]
    then    # no?, then mount
        # seperate case for windows needed
        if [ $1 == "windows" ]
        then
            sudo mount -t ntfs-3g /dev/sda1 /media/$1 \
            -o rw,user,locale=en_GB.UTF-8
        else
                sudo mount -t cifs //192.168.0.253/$1 /media/$1 \
            -o user,rw,credentials=smb 
        fi
    
        # check again (see if mounted)
        a=`sudo mount | grep $1`
        # if entry for $1
        if [ "$a" != "" ]
        then
            echo $1" successfully mounted."
            # open in file manager
            nautilus /media/$1 $2
        else
            zenity --info --title "Mount Volume" --text "Failed to mount "$1"."
        fi
    else    # inform
        echo $1" already mounted."
        # open in file manager
        nautilus /media/$1 $2
    fi

  7. #197
    Join Date
    Feb 2010
    Beans
    3

    Re: how to: automatically umount cifs partitions

    Hmm...

    it also appears to need this:

    ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
    ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh

    and a '-f' for the umount helps speed things up

  8. #198
    Join Date
    Feb 2010
    Beans
    3

    Re: how to: automatically umount cifs partitions

    I give up!

    A couple of reboots and it's as it was.

    easier to just do umount -a in terminal.


  9. #199
    Join Date
    Aug 2009
    Beans
    20

    Re: how to: automatically umount cifs partitions

    I got an amateur solution... two launchers It's not the best solution, but it works for me at 100%
    http://howto.blbosti.com/2010/05/umo...-and-shutdown/

  10. #200
    Join Date
    Jun 2010
    Beans
    1

    Re: how to: automatically umount cifs partitions

    Just perfect! Thanks!


    Quote Originally Posted by max.durden View Post
    Hi everybody,
    I'm posting a modification of a simple script originally coded by 'jferrando'
    http://www.ubuntuforums.org/showthre...highlight=cifs
    devoted to automatically umount cifs partitions in the shutdown and reboot sequence of Ubuntu (Dapper+). The main problem with the original script was that mount locations of cifs partitions had to be explicitly hardcoded in the script: I have written a simple routine which detects all mounted cifs-partition and umount them before proceeding with the other phases of the shutdown/reboot sequences.

    -----------------------------------------------------
    Instructions are very simple:
    uncompress archive and set 'chmod +x' on the mountcifs file
    sudo cp mountcifs /etc/init.d/

    cd /etc/rc0.d
    sudo ln -s /etc/init.d/mountcifs K02mountcifs

    cd /etc/rc6.d
    sudo ln -s /etc/init.d/mountcifs K02mountcifs

    ...that's all!
    ------------------------------------------------------
    I've experienced problem in the shutdown of my laptop just after sharing cifs filesystems with other PCs in a VPN network... this script fixed the problem.... hope it will be useful for someone out there!

    Happy Coding
    Max

Page 20 of 21 FirstFirst ... 1018192021 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
  •