LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices



Reply
 
Search this Thread
Old 01-23-2012, 01:58 PM   #1
bocochoco
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Rep: Reputation: 2
NFS Mounts before network up


I've got my home directories on a nfs mount that should mount at boot. It tries to mount them before the network comes up, for some reason. I've read around, and it seems this happens often to a number of people. I can't seem to find a fix that works. Sometimes it mounts fine, other times not.

I've enabled the NetworkManager-wait-online.service service, but it doesn't seem to affect anything.

I've tried creating a script in init.d that runs mount -a and adding it to chkconfig at runlevel 3,4,5; that didn't help either.

Users are able to login without their home directories mounted, but there are scripting problems.

Any ideas how to resolve this?
 
Old 01-23-2012, 02:15 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Hi bocochoco,

Ideally any of the network services should not start before the network comes up. You need to check the start and kill scripts of the default run level of the server.

Which distribution you are running on?
 
Old 01-23-2012, 02:24 PM   #3
bocochoco
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by T3RM1NVT0R View Post
Hi bocochoco,

Ideally any of the network services should not start before the network comes up. You need to check the start and kill scripts of the default run level of the server.

Which distribution you are running on?

Whoops, forgot to post that. I'm running Fedora 16 LXDE spin.

Systemd seems to take care of the boot process. I've tried adding NetworkManager-wait-online.service to the NetworkManager.service unit's Wants, but that didn't seem to do anything. Not really terribly familiar with how systemd operates, so I'm at a loss as to how to fix this.
 
Old 01-23-2012, 02:31 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Which is the default run level your system boots in. If it boots in runlevel 5 then post the output of the following:

Code:
ls -l /etc/rc.d/rc5.d/
If it boots in runlevel 3 then post the output of the following:

Code:
ls -l /etc/rc.d/rc3.d/
Not sure then post the output of both along with the output of the following:

Code:
cat /etc/inittab
 
Old 01-23-2012, 02:36 PM   #5
bocochoco
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 2
It's booting into runlevel 5

Code:
[root@belgarath rc5.d]# pwd; ls -l
/etc/rc.d/rc5.d
total 0
lrwxrwxrwx. 1 root root 15 Jan 20 11:40 K15httpd -> ../init.d/httpd
lrwxrwxrwx. 1 root root 20 Nov  2 22:29 K50netconsole -> ../init.d/netconsole
lrwxrwxrwx. 1 root root 15 Jan 20 11:41 K87named -> ../init.d/named
lrwxrwxrwx. 1 root root 15 Jan 23 12:33 K88iscsi -> ../init.d/iscsi
lrwxrwxrwx. 1 root root 16 Jan 20 14:34 K89iscsid -> ../init.d/iscsid
lrwxrwxrwx. 1 root root 17 Nov  2 22:31 S00livesys -> ../init.d/livesys
lrwxrwxrwx. 1 root root 17 Nov  2 22:30 S01sandbox -> ../init.d/sandbox
lrwxrwxrwx. 1 root root 17 Jan 23 12:33 S10network -> ../init.d/network
lrwxrwxrwx. 1 root root 15 Jan 19 15:35 S25netfs -> ../init.d/netfs
lrwxrwxrwx. 1 root root 16 Jan 20 14:02 S28autofs -> ../init.d/autofs
lrwxrwxrwx. 1 root root 22 Nov  2 22:31 S99livesys-late -> ../init.d/livesys-late
 
Old 01-23-2012, 02:47 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Are you sure this is the full output because I do not see nfs services listed in their. Type the following command and let me know the output:

Code:
chkconfig --list nfs
 
Old 01-23-2012, 02:57 PM   #7
bocochoco
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 2
Not sure how useful the chkconfig output is going to be, so I've also posted the output of systemctl --full


chkconfig --list
Code:
[administrator@belgarath ~]$ chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

autofs          0:off   1:off   2:on    3:on    4:on    5:on    6:off
iscsi           0:off   1:off   2:off   3:off   4:off   5:off   6:off
iscsid          0:off   1:off   2:off   3:off   4:off   5:off   6:off
livesys         0:off   1:off   2:off   3:on    4:on    5:on    6:off
livesys-late    0:off   1:off   2:off   3:on    4:on    5:on    6:off
named           0:off   1:off   2:off   3:off   4:off   5:off   6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
sandbox         0:off   1:off   2:off   3:off   4:off   5:on    6:off

systemctl --full
Code:
UNIT                                                                                LOAD   ACTIVE SUB       JOB DESCRIPTION
home-aos.automount                                                                  loaded active waiting       home-aos.automount
proc-sys-fs-binfmt_misc.automount                                                   loaded active waiting       Arbitrary Executable File Formats File System Automount Point
sayre.automount                                                                     loaded active waiting       sayre.automount
sys-devices-pci0000:00-0000:00:1b.0-sound-card0.device                              loaded active plugged       82801H (ICH8 Family) HD Audio Controller
sys-devices-pci0000:00-0000:00:1c.4-0000:03:00.0-net-em1.device                     loaded active plugged       NetXtreme BCM5754 Gigabit Ethernet PCI Express
sys-devices-pci0000:00-0000:00:1f.2-host0-target0:0:0-0:0:0:0-block-sda-sda1.device loaded active plugged       Maxtor_6H500F0
sys-devices-pci0000:00-0000:00:1f.2-host0-target0:0:0-0:0:0:0-block-sda-sda2.device loaded active plugged       Maxtor_6H500F0
sys-devices-pci0000:00-0000:00:1f.2-host0-target0:0:0-0:0:0:0-block-sda-sda3.device loaded active plugged       Maxtor_6H500F0
sys-devices-pci0000:00-0000:00:1f.2-host0-target0:0:0-0:0:0:0-block-sda.device      loaded active plugged       Maxtor_6H500F0
sys-devices-pci0000:00-0000:00:1f.2-host1-target1:0:0-1:0:0:0-block-sr0.device      loaded active plugged       TSSTcorpCD-RW_DVD-ROM_TSL462D
sys-devices-platform-serial8250-tty-ttyS1.device                                    loaded active plugged       /sys/devices/platform/serial8250/tty/ttyS1
sys-devices-platform-serial8250-tty-ttyS2.device                                    loaded active plugged       /sys/devices/platform/serial8250/tty/ttyS2
sys-devices-platform-serial8250-tty-ttyS3.device                                    loaded active plugged       /sys/devices/platform/serial8250/tty/ttyS3
sys-devices-pnp0-00:07-tty-ttyS0.device                                             loaded active plugged       /sys/devices/pnp0/00:07/tty/ttyS0
sys-devices-virtual-block-dm\x2d0.device                                            loaded active plugged       /sys/devices/virtual/block/dm-0
sys-devices-virtual-block-dm\x2d1.device                                            loaded active plugged       /sys/devices/virtual/block/dm-1
sys-devices-virtual-tty-tty0.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty0
sys-devices-virtual-tty-tty1.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty1
sys-devices-virtual-tty-tty10.device                                                loaded active plugged       /sys/devices/virtual/tty/tty10
sys-devices-virtual-tty-tty11.device                                                loaded active plugged       /sys/devices/virtual/tty/tty11
sys-devices-virtual-tty-tty12.device                                                loaded active plugged       /sys/devices/virtual/tty/tty12
sys-devices-virtual-tty-tty2.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty2
sys-devices-virtual-tty-tty3.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty3
sys-devices-virtual-tty-tty4.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty4
sys-devices-virtual-tty-tty5.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty5
sys-devices-virtual-tty-tty6.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty6
sys-devices-virtual-tty-tty7.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty7
sys-devices-virtual-tty-tty8.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty8
sys-devices-virtual-tty-tty9.device                                                 loaded active plugged       /sys/devices/virtual/tty/tty9
sys-module-configfs.device                                                          loaded active plugged       /sys/module/configfs
-.mount                                                                             loaded active mounted       /
boot.mount                                                                          loaded active mounted       /boot
dev-hugepages.mount                                                                 loaded active mounted       Huge Pages File System
dev-mqueue.mount                                                                    loaded active mounted       POSIX Message Queue File System
home-aos.mount                                                                      loaded active mounted       /home/aos
media.mount                                                                         loaded active mounted       Media Directory
sayre.mount                                                                         loaded active mounted       /sayre
sys-kernel-config.mount                                                             loaded active mounted       Configuration File System
sys-kernel-debug.mount                                                              loaded active mounted       Debug File System
sys-kernel-security.mount                                                           loaded active mounted       Security File System
var-lib-nfs-rpc_pipefs.mount                                                        loaded active mounted       RPC Pipe File System
cups.path                                                                           loaded active waiting       CUPS Printer Service Spool
systemd-ask-password-plymouth.path                                                  loaded active waiting       Forward Password Requests to Plymouth Directory Watch
systemd-ask-password-wall.path                                                      loaded active waiting       Forward Password Requests to Wall Directory Watch
abrt-ccpp.service                                                                   loaded active exited        Install ABRT coredump hook
abrt-oops.service                                                                   loaded active running       ABRT kernel log watcher
abrt-vmcore.service                                                                 loaded active exited        Harvest vmcores for ABRT
abrtd.service                                                                       loaded active running       ABRT Automated Bug Reporting Tool
atd.service                                                                         loaded active running       Job spooling tools
auditd.service                                                                      loaded active running       Security Auditing Service
autofs.service                                                                      loaded active running       LSB: Automounts filesystems on demand
avahi-daemon.service                                                                loaded active running       Avahi mDNS/DNS-SD Stack
chronyd.service                                                                     loaded active running       NTP client/server
console-kit-daemon.service                                                          loaded active running       Console Manager
console-kit-log-system-start.service                                                loaded active exited        Console System Startup Logging
crond.service                                                                       loaded active running       Command Scheduler
dbus.service                                                                        loaded active running       D-Bus System Message Bus
fcoe.service                                                                        loaded active running       Open-FCoE Inititator.
fedora-readonly.service                                                             loaded active exited        Configure read-only root support
fedora-storage-init-late.service                                                    loaded active exited        Initialize storage subsystems (RAID, LVM, etc.)
fedora-storage-init.service                                                         loaded active exited        Initialize storage subsystems (RAID, LVM, etc.)
fedora-wait-storage.service                                                         loaded active exited        Wait for storage scan
getty@tty2.service                                                                  loaded active running       Getty on tty2
ip6tables.service                                                                   loaded active exited        IPv6 firewall with ip6tables
iptables.service                                                                    loaded active exited        IPv4 firewall with iptables
livesys-late.service                                                                loaded active exited        SYSV: Late init script for live image.
livesys.service                                                                     loaded active exited        SYSV: Init script for live image.
lldpad.service                                                                      loaded active running       Link Layer Discovery Protocol Agent Daemon.
lvm2-monitor.service                                                                loaded active exited        Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling
mcelog.service                                                                      loaded active running       Machine Check Exception Logging Daemon
mdmonitor-takeover.service                                                          loaded active exited        Software RAID Monitor Takeover
netfs.service                                                                       loaded active exited        LSB: Mount and unmount network filesystems.
network.service                                                                     loaded active exited        LSB: Bring up/down networking
NetworkManager.service                                                              loaded active running       Network Manager
nfs-idmap.service                                                                   loaded active running       NFSv4 ID-name mapping daemon
nfs-lock.service                                                                    loaded active running       NFS file locking service.
prefdm.service                                                                      loaded active running       Display Manager
remount-rootfs.service                                                              loaded active exited        Remount Root FS
rpcbind.service                                                                     loaded active running       RPC bind service
rsyslog.service                                                                     loaded active running       System Logging Service
rtkit-daemon.service                                                                loaded active running       RealtimeKit Scheduling Policy Service
sandbox.service                                                                     loaded active exited        SYSV: sandbox, xguest and other apps that want to use pam_namespace require this script be run at boot.  This service script does not actually run any service but sets up: / to be shared by any app that starts a separate namespace
sshd-keygen.service                                                                 loaded active exited        SSH server keys generation.
sshd.service                                                                        loaded active running       OpenSSH server daemon
sssd.service                                                                        loaded active running       System Security Services Daemon
system-setup-keyboard.service                                                       loaded active running       System Setup Keyboard
systemd-logind.service                                                              loaded active running       Login Service
systemd-readahead-collect.service                                                   loaded active exited        Collect Read-Ahead Data
systemd-readahead-replay.service                                                    loaded active exited        Replay Read-Ahead Data
systemd-remount-api-vfs.service                                                     loaded active exited        Remount API VFS
systemd-stdout-syslog-bridge.service                                                loaded active running       STDOUT Syslog Bridge
systemd-sysctl.service                                                              loaded active exited        Apply Kernel Variables
systemd-tmpfiles-setup.service                                                      loaded active exited        Recreate Volatile Files and Directories
systemd-user-sessions.service                                                       loaded active exited        Permit User Sessions
systemd-vconsole-setup.service                                                      loaded active exited        Setup Virtual Console
udev-settle.service                                                                 loaded active exited        udev Wait for Complete Device Initialization
udev-trigger.service                                                                loaded active exited        udev Coldplug all Devices
udev.service                                                                        loaded active running       udev Kernel Device Manager
xinetd.service                                                                      loaded active running       Xinetd A Powerful Replacement For Inetd
avahi-daemon.socket                                                                 loaded active listening     Avahi mDNS/DNS-SD Stack Activation Socket
cups.socket                                                                         loaded active listening     CUPS Printing Service Sockets
dbus.socket                                                                         loaded active running       D-Bus System Message Bus Socket
dm-event.socket                                                                     loaded active listening     Device-mapper event daemon FIFOs
rpcbind.socket                                                                      loaded active running       RPCbind Server Activation Socket
syslog.socket                                                                       loaded active running       Syslog Socket
systemd-initctl.socket                                                              loaded active listening     /dev/initctl Compatibility Named Pipe
systemd-shutdownd.socket                                                            loaded active listening     Delayed Shutdown Socket
systemd-stdout-syslog-bridge.socket                                                 loaded active running       Stdio Syslog Bridge Socket
udev-control.socket                                                                 loaded active running       udev Control Socket
udev-kernel.socket                                                                  loaded active running       udev Kernel Socket
basic.target                                                                        loaded active active        Basic System
cryptsetup.target                                                                   loaded active active        Encrypted Volumes
getty.target                                                                        loaded active active        Login Prompts
graphical.target                                                                    loaded active active        Graphical Interface
local-fs-pre.target                                                                 loaded active active        Local File Systems (Pre)
local-fs.target                                                                     loaded active active        Local File Systems
multi-user.target                                                                   loaded active active        Multi-User
network.target                                                                      loaded active active        Network
remote-fs.target                                                                    loaded active active        Remote File Systems
sockets.target                                                                      loaded active active        Sockets
sound.target                                                                        loaded active active        Sound Card
swap.target                                                                         loaded active active        Swap
sysinit.target                                                                      loaded active active        System Initialization
syslog.target                                                                       loaded active active        Syslog
systemd-readahead-done.timer                                                        loaded active elapsed       Stop Read-Ahead Data Collection 10s After Completed Startup
systemd-tmpfiles-clean.timer                                                        loaded active waiting       Daily Cleanup of Temporary Directories

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
JOB    = Pending job for the unit.

126 units listed. Pass --all to see inactive units, too.
fstab
Code:
[administrator@belgarath ~]$ cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Thu Jan 19 15:12:34 2012
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_aos-lv_root                      /               ext4    defaults                1 1
UUID=9e2ceb9f-a9f9-4287-b6ff-99cd3f45e9ab       /boot           ext4    defaults                1 2
/dev/mapper/vg_aos-lv_swap                      swap            swap    defaults                0 0


# NFS Mounts
ceto:/home/aos                    /home/aos       nfs     auto,user,rw,comment=systemd.automount          0 0
splash:/sayre                     /sayre          nfs     auto,user,ro,comment=systemd.automount          0 0
I think that the two nfs mounts in fstab are being added to systemd as sayre.mount and home-aos.mount. There are no files for them in /lib/systemd/system, I'm not sure where they come from; /etc/fstab is just my guess. Googling suggested that adding comment=systemd.automount to the entries in fstab would solve the problem, but that didn't help.
 
Old 01-23-2012, 03:11 PM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

We can give following a try. Add the following line to your /etc/rc.local file:

Code:
echo "mount -a -o remount" >> /etc/rc.local
Reboot the machine and see if you get your nfs share mounted successfully.
 
Old 01-23-2012, 03:32 PM   #9
bocochoco
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 2
Well, there wasn't a /etc/rc.local file to begin with. I created one with that line in it, but it didn't affect anything.

Code:
#!/bin/sh

mount -a -o remount
This is very strange..
 
Old 01-23-2012, 03:36 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,516

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
In fedora 16 it's
Code:
/etc/rc.d/rc.local
Kind regards
 
Old 01-23-2012, 03:36 PM   #11
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ Reply

Well /etc/rc.local file is linked to /etc/rc.d/rc.local. As I read from the following document: http://docs.fedoraproject.org/en-US/..._Sysadmin.html

/etc/rc.d/rc.local is no longed included. However, you can create one and make it executable and it should run after reboot. You can create one under /etc/rc.d/rc.local, put the line I mentioned in my previous post, make it executable and reboot. See if that works.
 
Old 01-23-2012, 04:54 PM   #12
bocochoco
LQ Newbie
 
Registered: Oct 2007
Posts: 25

Original Poster
Rep: Reputation: 2
I think that I've solved it. I changed my fstab lines to not auto mount it, and added comment=systemd.automount to the options.

Then I added into /etc/rc.d/rc4.d/S99livesys-late, right after it source /etc/init.d/functions

mount /home/aos
mount /sayre

Now, they're both mounted before the user can log in, and they don't do so until after the network is up.

Thank you for your help with this.
 
1 members found this post helpful.
Old 07-23-2012, 03:18 PM   #13
kopper27
Member
 
Registered: Nov 2009
Posts: 147

Rep: Reputation: 16
Quote:
Originally Posted by bocochoco View Post
I think that I've solved it. I changed my fstab lines to not auto mount it, and added comment=systemd.automount to the options.

Then I added into /etc/rc.d/rc4.d/S99livesys-late, right after it source /etc/init.d/functions

mount /home/aos
mount /sayre

Now, they're both mounted before the user can log in, and they don't do so until after the network is up.

Thank you for your help with this.


do you know if your solution applies to suse 11?

thanks a lot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Verifying NFS Mounts devUnix Programming 6 10-28-2011 12:10 PM
[SOLVED] is there a way to monitor NFS mounts? recomboDNA Linux - Server 2 07-30-2010 11:55 AM
Export nested mounts through NFS sleepylight Linux - Server 1 07-22-2007 01:40 PM
Backgrounding NFS mounts kaplan71 Linux - Networking 1 05-18-2005 05:50 PM
cannot get nfs mounts to work iggymac Linux - Networking 0 08-10-2001 02:58 PM


All times are GMT -5. The time now is 11:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration