Announcement

Collapse
No announcement yet.

auto-mount through fstab no longer working and weird sudo stuff with 11.10????

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    auto-mount through fstab no longer working and weird sudo stuff with 11.10????

    Ok so here's my issue. I've had my NAS automounted through fstab since 10.04. And it's worked fine. It even worked fine in 11.10, until about 4 days ago, then it stopped working on ALL my computers the same day (updates?). I can mount it with

    Code:
    sudo mount -a
    And it works fine. So I know fstab is correct, or it wouldn't mount. In affect a "sudo mount -a" is SUPPOSED to be done on fstab on boot anyway. But for some reason that's no longer happening.

    But wait, the plot thickens. I wrote a script to the effect of running "mount -a" at startup.

    I thought that was working, but after hours of playing with it I discovered it wasn't mounting till I ran ANYTHING sudo or gksudo, the the second I hit enter after entering the password it mounted. ANYTHING that asked for the user password would mount it, even if the command was "gksudo kate". How weird huh?

    I've even turned off the use of passwords in sudoers, and it still does it. Except now what happens is the first time I sudo something it ask for a password, after that first time it just does it without asking. On a weird side note, gksudo doesn't ask for a password anymore, only sudo. But gksudo doesn't cause the drive to mount now that it's not asking for the password. But I have to enter a password, or enter through it asking that first time, or the drive won't mount. It's something about the startup script I think, it waits for the password to be entered, it doesn't matter how long it takes, it waits for it the be entered for anything then finally runs the "mount" in the startup script.

    Course that issue still doesn't explain why fstab no longer autoloads it on startup itself, unless it's the same issue, just waiting on a password to be entered the first time after starteup. I'll disable my startup script and see.

    Ideas?
    My Homesite<br />My Blog

    #2
    Re: auto-mount through fstab no longer working and weird sudo stuff with 11.10?

    Well, why don't you post the contents of fstab, /etc/sudoers and the script you wrote to do the mount -a.
    &quot;The only way Kubuntu could be more user friendly would be if it came with a virtual copy of Snowhog and dibl&quot;

    Comment


      #3
      Re: auto-mount through fstab no longer working and weird sudo stuff with 11.10?

      I just had an idea, maybe my startup script if failing because it's running BEFORE the wireless is connected? My network isn't up for a bit after load, I can watch Knetworkmanager connecting.

      I've played with it and I can verify mount, mount.cifs, and others give a "cannot connect to network" error when trying to mount this when the wireless is off.

      So how has fstab been able to do it? And what would have changed this week that would cause it to stop?
      My Homesite<br />My Blog

      Comment


        #4
        Re: auto-mount through fstab no longer working and weird sudo stuff with 11.10?

        Originally posted by doonze
        I just had an idea, maybe my startup script if failing because it's running BEFORE the wireless is connected? My network isn't up for a bit after load, I can watch Knetworkmanager connecting.
        that would do it

        Originally posted by doonze
        I've played with it and I can verify mount, mount.cifs, and others give a "cannot connect to network" error when trying to mount this when the wireless is off.
        corect


        Originally posted by doonze
        So how has fstab been able to do it? And what would have changed this week that would cause it to stop?
        that is a question only you can answer.....the KDE network manager dosent bring up the wireless network till ya log in ......but maby the wired dose ?

        wicd I think dose bring up the network at boot and so dose the Ubuntu one .

        VINNY
        i7 4core HT 8MB L3 2.9GHz
        16GB RAM
        Nvidia GTX 860M 4GB RAM 1152 cuda cores

        Comment


          #5
          Re: auto-mount through fstab no longer working and weird sudo stuff with 11.10?

          Vinny, I had THOUGHT I posted all the files you asked for, but it seems I hit preview instead of post because the post isn't here, and it was long, so I'm not reposing unless needed. But I THINK I've got this fixed...... It's worked now on two reboots in a row.....

          Now, I can't be 100% sure exactly what the fix was, because two things happened between the reboots it wasn't working and the ones that do work now.

          The first thing I did was download a program called mountmanager through Muon. Now, I didn't end up USING it, I just wanted to see if it had any input on my mount issues. But I guess just running it rewrites your Fstab file. The problem is I can't tell 100% what the changes were, becuase I thought I had posted my fstab here, but it didn't post so I don't have a copy of my before fstab.

          My current fstab has only 4 lines now, the original one before had about 10 lines with comments. And the hard drives looked totally different then they do now. It's using the UUID now and it didn't before,HOWEVER it DIDN'T change my fstab entry about the drive in question, so unless it's the changes it made to the file in general it's the second thing I did that made the difference.

          Here's my new fstab

          Code:
          proc      /proc      proc  nodev,noexec,nosuid 0    0
          UUID=e4c751f8-a4cb-46e1-8a3c-439c90e3d0d9 /        ext4  errors=remount-ro 0    1
          UUID=44c3f2cc-dedf-4b10-b776-e47b51584b23 none      swap  sw       0    0
          //192.168.0.100/Volume_1 /home/justin/smb4k/DLINKSTORAGE/ cifs guest,_netdev 0 0

          what I changed is i added the
          Code:
          guest,_netdev
          to the line about my share, what "_netdev" does is tells the system not to mount the device until there is a network connection. And it SEEMS it fixed my issue, I'll give it a day or two to make sure then call this solved if it is.

          Thanks for the help!!!

          I still haven't figured out my sudo issue, but if this is fixed then the other doesn't bother me.

          My Homesite<br />My Blog

          Comment


            #6
            Re: auto-mount through fstab no longer working and weird sudo stuff with 11.10?

            Wow, sounds like you have the same sort of weird problems I have. We could start a club...

            I would bet that rewriting fstab is what fixed the problem. Too bad you can't compare the before and after versions.

            Comment


              #7
              Re: auto-mount through fstab no longer working and weird sudo stuff with 11.10?

              Originally posted by doonze
              Here's my new fstab

              Code:
              proc      /proc      proc  nodev,noexec,nosuid 0    0
              UUID=e4c751f8-a4cb-46e1-8a3c-439c90e3d0d9 /        ext4  errors=remount-ro 0    1
              UUID=44c3f2cc-dedf-4b10-b776-e47b51584b23 none      swap  sw       0    0
              //192.168.0.100/Volume_1 /home/justin/smb4k/DLINKSTORAGE/ cifs guest,_netdev 0 0
              It looks like you're using Smb4K. If that's indeed true, you shouldn't have to modify /etc/fstab.

              Comment


                #8
                Re: auto-mount through fstab no longer working and weird sudo stuff with 11.10?

                the adding of "_netdev" is what fixed the mounting hangup .............but as @SteveRiley has sead you may not kneed a fstab for Smb4K .....IDK as I dont use it.

                what exactly were the sudo problems ?............O and dont use gksudo (thats Ubuntu) in Kubuntu it's "kdesudo" for a GUI app like kate

                VINNY

                i7 4core HT 8MB L3 2.9GHz
                16GB RAM
                Nvidia GTX 860M 4GB RAM 1152 cuda cores

                Comment


                  #9
                  Re: auto-mount through fstab no longer working and weird sudo stuff with 11.10?

                  Originally posted by doonze
                  I still haven't figured out my sudo issue, but if this is fixed then the other doesn't bother me.
                  Post your /etc/sudoers, let's see what it's about.
                  &quot;The only way Kubuntu could be more user friendly would be if it came with a virtual copy of Snowhog and dibl&quot;

                  Comment


                    #10
                    Re: auto-mount through fstab no longer working and weird sudo stuff with 11.10?

                    Ok, so I can say for sure my mount issue has been fixed with
                    Code:
                    _netdev
                    and that it has worked on BOTH my laptops, and neither worked before adding that. It's something it seems about 11.10, something that changed after an update of something....who knows. For some reason dolphin on my other laptop still doesn't see it "mounted" but the mount is there, and the directory where it is mounted works proper and I can go to the mount through it's mount point with dolphin with no problem. Just the little "mounted" devices icon for this one shows not connected and clicking on it throws an error. Since it IS mounted, it's weird, but oh well. It works perfect on my main machine.

                    As for my sudo issue, the exact problem was that it STILL ASKED for a password the FIRST time I do a sudo, then after that it wouldn't again till I restarted. AND for "sudo mount" it ALWAYS asked for the password. (nothing else did this) But once I had added the NOPASSWD parts I didn't have to ENTER the password, just hitting enter without typing anything would get the sudo to work. But it still asked. Then I added the last line to me below sudoers file and finally mount stopped asking.



                    Code:
                    #
                    # This file MUST be edited with the 'visudo' command as root.
                    #
                    # Please consider adding local content in /etc/sudoers.d/ instead of
                    # directly modifying this file.
                    #
                    # See the man page for details on how to write a sudoers file.
                    #
                    Defaults    env_reset
                    
                    # Host alias specification
                    
                    # User alias specification
                    
                    # Cmnd alias specification
                    
                    # User privilege specification
                    root  ALL=(ALL) ALL
                    
                    # Members of the admin group may gain root privileges
                    %admin ALL=(ALL) ALL
                    
                    # Allow members of group sudo to execute any command
                    %sudo  ALL=(ALL:ALL) ALL
                    
                    #includedir /etc/sudoers.d
                    
                    # Entries for Smb4K users.
                    # Generated by Smb4K. Please do not modify!
                    User_Alias   SMB4KUSERS = justin
                    Defaults:SMB4KUSERS   env_keep += "PASSWD USER"
                    SMB4KUSERS   justin-dell-laptop = NOPASSWD: /usr/bin/smb4k_kill
                    SMB4KUSERS   justin-dell-laptop = NOPASSWD: /usr/bin/smb4k_umount
                    SMB4KUSERS   justin-dell-laptop = NOPASSWD: /usr/bin/smb4k_mount
                    # End of Smb4K user entries.
                    justin ALL=(ALL) NOPASSWD: ALL
                    %admin ALL=(ALL) NOPASSWD: /bin/mount, /bin/umount
                    root ALL=(ALL) NOPASSWD: /bin/mount, /bin/umount

                    Now this part I had at first:
                    Code:
                    justin ALL=(ALL) NOPASSWD: ALL
                    %admin ALL=(ALL) NOPASSWD: /bin/mount, /bin/umount
                    I tried the first line first. And it behaved as state above. I also added the second line later, and it still did it. It would ask for password first time I'd sudo or gksudo something, and would ask every time for mount or umount.

                    Then I tried this line I found on the internet somewhere:
                    Code:
                    root ALL=(ALL) NOPASSWD: /bin/mount, /bin/umount
                    And now I don't get asked for the password ever, even when using mount.

                    I'm not really sure why adding something about root would all of a sudden fix it, because from what I understand that should have just allowed "root" access to mount/umount without a password. And I never log in as root (hence my heavy use of sudo) but if I understand right I wouldn't need a password once I was in root anyway. But..... this fixed my sudo behaving weird issue....so....... *shrug*

                    I'm finding linux often has a mind of it's own. And I've got a ghost penguin in my machine somewhere...with a wicked sense of humor!

                    Vinny, from my other post in networking I learned about the kdesudo, and have been using it ever since. I'm going to edit my post to reflect this.

                    Thanks all.

                    My Homesite<br />My Blog

                    Comment

                    Working...
                    X