Re: F16 Mount Issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 17 May 2012 10:52:15 -0500 (CDT)
Matthew J. Roth wrote:

> Do you mind sharing that script?  It's a great idea for solving a common problem.

This will probably get mangled due to a few long lines, but I'll give it
a shot.

In the /etc/rc.d/rc.local script I have this line:

/usr/local/bin/bg-mount-nfs

That /usr/local/bin/bg-mount-nfs script looks like:

#!/bin/bash
#
# Background mounts for each of the nfs filesystems appearing in
# /etc/fstab not marked as noauto
#
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH
sed -e '/^#/d' -e 's/[ \t][ \t]*/\t/g' /etc/fstab | grep -w nfs | grep -w -v noauto | cut -f2 | while read mountpoint
do
   nohup /usr/local/bin/mount-filesystem "$mountpoint" > /dev/null 2>&1 < /dev/null &
done

And the /usr/local/bin/mount-filesystem script it backgrounds for each
filesystem looks like:

#!/bin/bash
#
# Argument is a mountpoint, keep trying to mount the thing till
# it appears in /proc/mounts.
#
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH
if [ -z "$1" ]
then
   echo Hey\! Missing mountpoint argument\! 1>&2
   exit 2
fi
check=`sed -e '/^#/d' -e 's/[ \t][ \t]*/\t/g' /etc/fstab | cut -f2 | fgrep -x "$1"`
if [ "$check" = "$1" ]
then
   :
else
   echo "$1" does not appear as a mountpoint in /etc/fstab\! 1>&2
   exit 2
fi
while true
do
   check=`sed 's/[ \t][ \t]*/\t/g' /proc/mounts | cut -f2 | fgrep -x "$1"`
   if [ "$check" = "$1" ]
   then
      exit 0
   fi
   if mount "$1" -o fg
   then
      :
   else
      sleep 10
   fi
done
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux