LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2012, 02:36 PM   #1
PaulyWally
Member
 
Registered: Jun 2006
Distribution: Ubuntu
Posts: 31

Rep: Reputation: 15
Question Can't umount Through Scheduler


Running Debian Squeeze.

I wrote a bash script to do some backups over a small network (with wired and wireless devices). It mounts network shares, performs rsync on that share, and then umounts the network share.

The user account logged in is "backupaccount". And when I run the script manually through cli, it runs fine. But I wanted to use Gnome Scheduler to schedule it to run at certain days/times. Everything in the script seems to run fine except it will not umount the network shares. The error is:

Code:
umount: /home/backupaccount/BackupData/MntNetworkShares/TestShare1 mount disagrees with the fstab
Since it umounts fine when I run the script manually, I assume it is a permissions issue. But am unsure where to look since there are no permission options in Gnome Scheduler.

Any help is appreciated! Thanks in advance!

Here is my fstab:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/sda2 during installation
UUID=2ed67db7-acd7-4d71-84d8-fa0fd7950d8c /               ext3    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=2bfb3b81-edea-4b15-bbd9-34efbb47a46b none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0

# This is where the removable backup media gets mounted
/dev/sdb1	/home/backupaccount/BackupData/MntBackupMedia	auto	noauto,users,noexec,rw,noatime,sync,umask=0	0	0

# These are the network shares that need to be mounted to get backed up
# //Server/Share	/home/backupaccount/BackupData/MntNetworkShares	cifs	noauto,guest,_netdev,users,ro	0	0
//winxp01/TestShare1$	/home/backupaccount/BackupData/MntNetworkShares/TestShare1	cifs	noauto,guest,_netdev,users,ro	0	0
//winxp01/TestShare2$	/home/backupaccount/BackupData/MntNetworkShares/TestShare2	cifs	noauto,guest,_netdev,users,ro	0	0
//winxp01/TestShare3$	/home/backupaccount/BackupData/MntNetworkShares/TestShare3	cifs	noauto,guest,_netdev,users,ro	0	0
And my mtab after scheduler has run the script and failed the umounts:

Code:
/dev/sda2 / ext3 rw,errors=remount-ro 0 0
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
udev /dev tmpfs rw,mode=0755 0 0
tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=620 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
/dev/sdb1 /home/backupaccount/BackupData/MntBackupMedia vfat rw,noexec,nosuid,nodev,sync,noatime,umask=0 0 0
//winxp01/TestShare1$/ /home/backupaccount/BackupData/MntNetworkShares/TestShare1 cifs ro,mand,nosuid,nodev,user=backupaccount 0 0
//winxp01/TestShare2$/ /home/backupaccount/BackupData/MntNetworkShares/TestShare2 cifs ro,mand,nosuid,nodev,user=backupaccount 0 0
//winxp01/TestShare3$/ /home/backupaccount/BackupData/MntNetworkShares/TestShare3 cifs ro,mand,nosuid,nodev,user=backupaccount 0 0
 
Old 08-27-2012, 03:23 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It may not be the umount that is the issue but rather the original mount. You might want to add a line to show what the mount is before you do the umount for debugging purposes e.g.

df -hP /home/backupaccount/BackupData/MntNetworkShares/TestShare1

Verify output of that line shows it is mounted from device, //winxp01/TestShare1. If not then that is your problem and you should focus on the mount you're doing to test its success before you do this.

Often things that work fine at command line don't work via automated tools such as cron, init scripts and other schedulers because the user environment you have at command line is built by running profiles but such profiles aren't run by the automated tools. It is necessary therefore to insure the script itself has the correct environmental variables.

P.S. rsync is designed to communicate over network for synchronization - have you thought about installing rsync on the host you're trying to copy from (or to) and avoid the mount altogether?
 
  


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
why cannot umount ? whepin Linux - General 3 02-07-2006 10:42 AM
how to umount / taiwf Linux - General 13 08-05-2005 12:40 AM
scheduler... os2 Programming 0 07-24-2004 12:38 PM
is it ok to use umount -l ? ewto Linux - General 5 10-21-2003 01:57 AM
cannot umount... ??? spyghost Linux - Software 9 09-06-2003 09:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:11 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
Open Source Consulting | Domain Registration