Page 12 of 21 FirstFirst ... 21011121314 ... LastLast
Results 111 to 120 of 207

Thread: how to: automatically umount cifs partitions

  1. #111
    Join Date
    Dec 2008
    Beans
    1

    Question Re: how to: automatically umount cifs partitions

    Quote Originally Posted by usererror View Post
    I did a script like this:

    Code:
    umount /path/to/cifs/share
    umount /path/to/cifs/share2
    and named it "S38umount-cifs" and placed it in /etc/init.d/ with a symlink in /etc/rc6.d/ and that works just great.

    Is that not best practice? I'm not a programmer...but it seems to work...now my box literally reboots instantly.
    I like this way. If I manually unmount the network drive then shutdown there are no issues

    I spent 2 months getting ubuntu to connect to may landrv. opensuse and fedora did but not through fstab yet, so if you can help here that give ubuntu a fighting chance to be the os of choice

  2. #112
    Join Date
    Apr 2009
    Location
    Silchester, England
    Beans
    1
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: how to: automatically umount cifs partitions

    On my system (Intrepid), rc scripts are run with /bin/sh rather than /bin/bash so the array syntax in umountcifs was failing and I was still getting the error messages on shutdown/restart.

    I've changed the "stop" routine in the script to
    Code:
    stop() {
        echo "Unmounting samba-cifs filesystems..."
        mount -t cifs | cut -d\  -f3 | xargs -L 1 umount -l
    }
    (which should work in both bash and sh) and it now works perfectly.

    I'm fairly new to Ubuntu so I'll apologise in advance if there was a more obvious solution.

  3. #113
    Join Date
    Nov 2007
    Location
    The World
    Beans
    28

    Re: how to: automatically umount cifs partitions

    on my laptop using 9.04 developmnet version i had to change the order of rc scripts

    umountnfs.sh is om k01 then gdm on k02 than usplash to k03

    K01umountnfs.sh -> ../init.d/umountnfs.sh
    K02gdm -> ../init.d/gdm
    K03usplash -> ../init.d/usplash

    every other order of script will fail on this laptop using wlan.

    this was my only solution.
    Cheers,
    Zer0

  4. #114
    Join Date
    Apr 2009
    Beans
    1

    Re: how to: automatically umount cifs partitions

    very awesome it works good great job

  5. #115
    Join Date
    Aug 2008
    Location
    England
    Beans
    14
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: how to: automatically umount cifs partitions

    Quote Originally Posted by wyley.r View Post
    The following two commands should take care of unmounting Samba shares and other virtual filesystems before a shutdown or reboot. They must be run as root; prefix them with "sudo" if you haven't set up your root account:

    Code:
    ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
    ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh
    More explanation can be found here:

    Unmount Samba filesystems before shutdown or reboot
    .

    Hopefully, this will avoid the need to download and install a separate script, as some other people have suggested. All the tools you need are already built into the Debian/Ubuntu init system.
    This worked for me in hardy and intrepid, doesn't seem to be working in 9.04 though. Any ideas???

  6. #116
    Join Date
    Feb 2007
    Beans
    33

    Re: how to: automatically umount cifs partitions

    Quote Originally Posted by anibalojeda View Post
    on my laptop using 9.04 developmnet version i had to change the order of rc scripts

    umountnfs.sh is om k01 then gdm on k02 than usplash to k03

    K01umountnfs.sh -> ../init.d/umountnfs.sh
    K02gdm -> ../init.d/gdm
    K03usplash -> ../init.d/usplash

    every other order of script will fail on this laptop using wlan.

    this was my only solution.
    I have used sander marechal's umountcifs script for ages now, and it runs perfectly on my 8.04 and 8.10 machines. But I upgraded a laptop to 9.04 this morning (with sander marechal's script still set up as before), and got the CIF VFS error. And I've spent all day trying to find a fix, changing the priority of the umountcifs script as high as K01, and trying out various other methods, all to no avail.

    The only thing that has worked is anibalojeda's solution of changing the order of the rc0.d and rc6.d links from the default order, which is
    K01gdm
    K02usplash
    (no Kxxumountnfs.sh)

    TO this new order:
    K01umountnfs.sh
    K02gdm
    K03usplash

    Clearly the Ubuntu devs have changed something about the way the init.d / rc scripts work. (I haven't had time today to investigate what's gone on with Jaunty.) But I'm very grateful to Anibal for the fix! (though I've no idea why it works, and haven't checked if it has any unwanted effects elsewhere. Does anyone who understands this stuff better than me have any comments on issues with changing the order as above?)

    This CIFS unmounting bug should have been fixed years ago, but it's still plaguing us all.

    Thanks very much, Anibal! Now I can get back to doing some work, instead of messing around with the OS!

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

    Re: how to: automatically umount cifs partitions

    Quote Originally Posted by diana.artemis View Post
    I have used sander marechal's umountcifs script for ages now, and it runs perfectly on my 8.04 and 8.10 machines. But I upgraded a laptop to 9.04 this morning (with sander marechal's script still set up as before), and got the CIF VFS error. And I've spent all day trying to find a fix, changing the priority of the umountcifs script as high as K01, and trying out various other methods, all to no avail.

    The only thing that has worked is anibalojeda's solution of changing the order of the rc0.d and rc6.d links from the default order, which is
    K01gdm
    K02usplash
    (no Kxxumountnfs.sh)

    TO this new order:
    K01umountnfs.sh
    K02gdm
    K03usplash

    Clearly the Ubuntu devs have changed something about the way the init.d / rc scripts work. (I haven't had time today to investigate what's gone on with Jaunty.) But I'm very grateful to Anibal for the fix! (though I've no idea why it works, and haven't checked if it has any unwanted effects elsewhere. Does anyone who understands this stuff better than me have any comments on issues with changing the order as above?)

    This CIFS unmounting bug should have been fixed years ago, but it's still plaguing us all.

    Thanks very much, Anibal! Now I can get back to doing some work, instead of messing around with the OS!
    If you have some spare time, perhaps you could test this: http://ubuntuforums.org/showthread.php?t=1128729

  8. #118
    Join Date
    Feb 2007
    Beans
    33

    Re: how to: automatically umount cifs partitions

    Quote Originally Posted by dmizer View Post
    If you have some spare time, perhaps you could test this: http://ubuntuforums.org/showthread.php?t=1128729
    That was one of the fixes I tried while attempting to get Jaunty to shut down gracefully. I'm afraid it didn't work for me.

    The only fix that worked was to put umountnfs.sh before everything else in the shutdown sequences in rc0.d and rc6.d

    As I say, I don't really understand why this is necessary. Apparently, CIFS is not in the kernel, but runs as a daemon. So Network Manager (or perhaps WPAsupplicant) gets shut down earlier, and disconnects the CIFS shares before they are unmounted. Then CIFS starts to close down, and attempts to unmount the shares that are no longer connected - hence the CIFS VFS error.

    So you'd think that all you'd need to do was raise the kill priority of umountcifs or umountnfs.sh, or lower the priority of the network shutdown, so that the CIFS unmount occurs first (and that's the effect of the fix you refer to above.)

    But I couldn't find anyway of getting this to work, other than putting umountnfs.sh first, which is very puzzling. That's what makes me think the devs have changed something else that makes the init.d / rc arrangements not work as expected.
    Last edited by diana.artemis; April 25th, 2009 at 05:54 AM.

  9. #119
    Join Date
    Apr 2009
    Location
    Lemgo, Gerrnany
    Beans
    5

    Re: how to: automatically umount cifs partitions

    Hi all, i've updated my netbook yesterday to jaunty and have the same problem. But for me also the 'put umountnfs.sh at first" approach does not work. I can only shutdown normally if i call umountnfs.sh by hand and shutdown afterwards. File permissions seems to be ok, i have absolutely no idea why /etc/rc0.d/K01umountnfs.sh should not be called or should not work. Any idea?

    Cheers Kai

  10. #120
    Join Date
    Feb 2007
    Beans
    33

    Re: how to: automatically umount cifs partitions

    Quote Originally Posted by kaiben View Post
    Hi all, i've updated my netbook yesterday to jaunty and have the same problem. But for me also the 'put umountnfs.sh at first" approach does not work...
    Just to be clear, did you include the changes to gdm and usplash, too?

    K01umountnfs.sh
    K02gdm
    K03usplash

    Or did you leave them as they were (K01gdm; K02usplash)? If so, you might try adjust them, too.

    Other than that 'trial-and-error' tweak, I've no idea what to suggest I'm afraid. (Like you, I did resort to unmounting 'manually', with a little script that I ran before shutting down; but it's a pain to have to do that sort of thing.)

Page 12 of 21 FirstFirst ... 21011121314 ... 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
  •