[LINUX] fstab mounting issue

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 951 Views - Last Post: 18 June 2013 - 10:35 AM

#16 no2pencil  Icon User is offline

  • Dic Head
  • member icon

Reputation: 5163
  • View blog
  • Posts: 26,837
  • Joined: 10-May 07

Re: [LINUX] fstab mounting issue

Posted 14 June 2013 - 09:42 AM

Can you provide more information on 'Didn't work'? I offered quite a few items that will throw errors. We need to know what failed, especially since you should have done it all as root (hense sudo -i).
Was This Post Helpful? 1
  • +
  • -

#17 TechnoBear  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 222
  • Joined: 02-November 11

Re: [LINUX] fstab mounting issue

Posted 14 June 2013 - 09:51 AM

It obviously did the sudo -i because it change to user to root. but then it did nothing else, it didn't throw any errors and it didn't perform any of the actions.

The drive wasn't unmounted the folder was not created and the drive was not mounted. I got no feed back from the terminal to offer you.

debug through bash +x offers nothing either.

This post has been edited by TechnoBear: 14 June 2013 - 09:53 AM

Was This Post Helpful? 0
  • +
  • -

#18 no2pencil  Icon User is offline

  • Dic Head
  • member icon

Reputation: 5163
  • View blog
  • Posts: 26,837
  • Joined: 10-May 07

Re: [LINUX] fstab mounting issue

Posted 14 June 2013 - 09:57 AM

Lets get crazy :)

sudo -i
ME=`whoami`
echo Running as ${ME}...

PWD=`pwd`
echo Currently in ${PWD}
cd /
umount /home/wazu/RadioBackup
if [ $? -ne 0]; then
  echo Home Mount point failed to unmount
  exit
fi
mkdir /media/RadioBackup
if [ $? -ne 0]; then
  echo Custom creation of Radio Backup failed to create
  exit
fi
mount -w /dev/sda3 /media/RadioBackup
if [ $? -ne 0]; then
  echo Failed to mount sda3 with read/write privileges
  exit
fi
cd /media/RadioBackup
ls -l Music 2>&1 /dev/null
if [ $? -ne 0]; then
  echo Drive is mounted under media, however the sub directory of Music doesn't exist
  exit
fi
echo 'Success!' > test.txt
if [ ! -f test.txt ]; then
  PWD=`pwd`
  echo Well, we made it all the way here, but still can't write to the directory ${PWD}
  exit # what's the point?  We're done :)/>
fi



Let me know what one line it outputs. There should't be much & it will tell us EXACTLY where it's failing.
Was This Post Helpful? 0
  • +
  • -

#19 TechnoBear  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 222
  • Joined: 02-November 11

Re: [LINUX] fstab mounting issue

Posted 14 June 2013 - 10:25 AM

this is all i get

root@wazu-rivendell:~#


If I then exit I get:

root@wazu-rivendell:~# exit
logout
Running as wazu...
Currently in /home/wazu
umount: only root can unmount UUID=830e01e9-2c17-4aed-a154-d13466c66a54 from /home/wazu/RadioBackup
./testrun.sh: line 11: [: missing `]'
mkdir: cannot create directory `/media/RadioBackup': File exists
./testrun.sh: line 16: [: missing `]'
mount: only root can do that
./testrun.sh: line 21: [: missing `]'
ls: cannot access Music: No such file or directory
crw-rw-rw- 1 root root 1, 3 2013-06-14 12:17 /dev/null
./testrun.sh: line 27: [: missing `]'


If I remove sudo -i and run as root i get

wazu@wazu-rivendell:~$ sudo ./testrun.sh 
Running as root...
Currently in /home/wazu
./testrun.sh: line 10: [: missing `]'
mkdir: cannot create directory `/media/RadioBackup': File exists
./testrun.sh: line 15: [: missing `]'
./testrun.sh: line 20: [: missing `]'
crw-rw-rw-  1 root root 1, 3 2013-06-14 12:17 /dev/null

Music:
total 32
drwxr-xr-x 2 root root 4096 2013-06-11 16:10 Cave de Rave
drwxr-xr-x 2 root root 4096 2013-06-11 16:10 Deja Vu
drwxr-xr-x 2 root root 4096 2013-06-11 16:10 eTown
drwxr-xr-x 2 root root 4096 2013-06-11 16:10 Euphoria
drwxr-xr-x 2 root root 4096 2013-06-11 16:10 Juke in the Back
drwxr-xr-x 2 root root 4096 2013-06-11 16:10 Kingdom Minded
drwxr-xr-x 2 root root 4096 2013-06-11 16:10 Peoria Underground Radio
drwxr-xr-x 2 root root 4096 2013-06-12 21:01 The Nightfly
./testrun.sh: line 26: [: missing `]'

This post has been edited by TechnoBear: 14 June 2013 - 10:28 AM

Was This Post Helpful? 0
  • +
  • -

#20 no2pencil  Icon User is offline

  • Dic Head
  • member icon

Reputation: 5163
  • View blog
  • Posts: 26,837
  • Joined: 10-May 07

Re: [LINUX] fstab mounting issue

Posted 18 June 2013 - 09:59 AM

The comment 'if I exit' makes me think this is somehow launched to the background. There has to be more going on here than just the mounting issue.... but I'm not sure how to proceed. It reads to me that the mount is there, but something procedural is preventing what you want done.
Was This Post Helpful? 0
  • +
  • -

#21 TechnoBear  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 222
  • Joined: 02-November 11

Re: [LINUX] fstab mounting issue

Posted 18 June 2013 - 10:24 AM

what can I offer to find any more information?
Was This Post Helpful? 0
  • +
  • -

#22 no2pencil  Icon User is offline

  • Dic Head
  • member icon

Reputation: 5163
  • View blog
  • Posts: 26,837
  • Joined: 10-May 07

Re: [LINUX] fstab mounting issue

Posted 18 June 2013 - 10:28 AM

As root can you cat /etc/fstab & post the output? Also can you post the music script? What else have you written &/or added that is handling this mount point?
Was This Post Helpful? 0
  • +
  • -

#23 TechnoBear  Icon User is offline

  • D.I.C Head

Reputation: 18
  • View blog
  • Posts: 222
  • Joined: 02-November 11

Re: [LINUX] fstab mounting issue

Posted 18 June 2013 - 10:35 AM

fstab:
wazu@wazu-rivendell:~$ sudo cat /etc/fstab
[sudo] password for wazu: 
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' 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    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=82e04526-d8af-4b5b-b728-799ff85196a9 /               ext3    errors=remount-ro 0       1
# /home was on /dev/sdb5 during installation
UUID=611e6d37-78f1-4b12-9cb9-707e2468280a /home           ext3    defaults        0       2
# /var/snd was on /dev/sdb2 during installation
UUID=1592b082-a030-4757-91d4-e7dacc02d20d /var/snd        ext3    defaults        0       2
# swap was on /dev/sda5 during installation
UUID=9c72d881-184d-4153-9b84-5d87ffdd8eb0 none            swap    sw              0       0
#Backup Partition
UUID=830e01e9-2c17-4aed-a154-d13466c66a54 /home/wazu/RadioBackup	ext3	defaults	0	0


The script using the partition:

wazu@wazu-rivendell:~$ sudo cat rdscripts/backupimport.sh 
#!/bin/bash
#Create Variables
NUMFILES=0
WAZU_HOME=/home/wazu
LOGS=$WAZU_HOME/logs/Files
DROPBOX=$WAZU_HOME/RadioDropBox
BACKUP=$WAZU_HOME/RadioBackup

#Script to move files from dropbox to backup

export DISPLAY=:0 && export XAUTHORITY=/home/wazu/.Xauthority && sudo -u wazu notify-send "Backing up and Importing" "Backing up and importing of files has begun"

#Enviromental
DROPBOX=$WAZU_HOME/RadioDropBox/Enviromental
BACKUP=$WAZU_HOME/RadioBackup/Enviromental
#Sea Change Radio
NUMFILES=`ls $DROPBOX/Sea\ Change\ Radio/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Sea\ Change\ Radio/* $BACKUP/Sea\ Change\ Radio/
rdimport --delete-cuts --to-cart=010002 --delete-source ENVIRO $DROPBOX/Sea\ Change\ Radio/*
else
echo "Sea Change Radio Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi

#Literature
DROPBOX=$WAZU_HOME/RadioDropBox/Literature
BACKUP=$WAZU_HOME/RadioBackup/Literature
#Bookwaves
NUMFILES=`ls $DROPBOX/Bookwaves/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Bookwaves/* $BACKUP/Bookwaves/
rdimport --delete-cuts --to-cart=020003 --delete-source LITERATURE $DROPBOX/Bookwaves/*
else
echo "Bookwaves Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Catskill Review
NUMFILES=`ls $DROPBOX/Catskill\ Review/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Catskill\ Review/* $BACKUP/Catskill\ Review/
rdimport --delete-cuts --to-cart=020004 --delete-source LITERATURE $DROPBOX/Catskill\ Review/*
else
echo "Catskill Review Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Poets West
NUMFILES=`ls $DROPBOX/Poets\ West/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Poets\ West/* $DROPBOX/Poets\ West/
rdimport --delete-cuts --to-cart=020001 --delete-source LITERATURE $DROPBOX/Poets\ West/*
else
echo "Poets West Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi

#News
DROPBOX=$WAZU_HOME/RadioDropBox/News
BACKUP=$WAZU_HOME/RadioBackup/News
#Counterspin
NUMFILES=`ls $DROPBOX/Counterspin/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 0 ]; then
cp $DROPBOX/Counterspin/* $BACKUP/Counterspin/
rdimport --delete-cuts --to-cart=030010 --delete-source NEWS $DROPBOX/Counterspin/*
else
echo "Counterspin Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Behind the News
NUMFILES=`ls $DROPBOX/Behind\ the\ News/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 0 ]; then
cp $DROPBOX/Behind\ the\ News/* $BACKUP/Behind\ the\ News/
rdimport --delete-cuts --to-cart=030009 --delete-source NEWS $DROPBOX/Behind\ the\ News/*
else
echo "Behind the News Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Flashpoints
NUMFILES=`ls $DROPBOX/Flashpoints/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 0 ]; then
cp $DROPBOX/Flashpoints/* $BACKUP/Flashpoints/
rdimport --delete-cuts --to-cart=030008 --delete-source NEWS $DROPBOX/Flashpoints/*
else
echo "Flashpoints Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Building Bridges
NUMFILES=`ls $DROPBOX/Building\ Bridges/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 0 ]; then
cp $DROPBOX/Building\ Bridges/* $BACKUP/Building\ Bridges/
rdimport --delete-cuts --to-cart=030003 --delete-source NEWS $DROPBOX/Building\ Bridges/*
else
echo "Building Bridges Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Law and Disorder
NUMFILES=`ls $DROPBOX/Law\ and\ Disorder/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Law\ and\ Disorder/* $BACKUP/Law\ and\ Disorder/
rdimport --delete-cuts --to-cart=030001 --delete-source NEWS $DROPBOX/Law\ and\ Disorder/*
else
echo "Law and Disorder Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Shortwave Report
NUMFILES=`ls $DROPBOX/Shortwave\ Report/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Shortwave\ Report/* $BACKUP/Shortwave\ Report/
rdimport --delete-cuts --to-cart=030004 --delete-source NEWS $DROPBOX/Shortwave\ Report/*
else
echo "Shortwave Report Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi

#Politics
DROPBOX=$WAZU_HOME/RadioDropBox/Politics
BACKUP=$WAZU_HOME/RadioBackup/Politics
#Unwelcome Guests
NUMFILES=`ls $DROPBOX/Unwelcome\ Guests/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 2 ]; then
cp $DROPBOX/Unwelcome\ Guests/* $BACKUP/Unwelcome\ Guests/
rdimport --delete-cuts --to-cart=040014 --delete-source POLITICS $DROPBOX/Unwelcome\ Guests/*hour1*
rdimport --delete-cuts --to-cart=040015 --delete-source POLITICS $DROPBOX/Unwelcome\ Guests/*hour2*
else
echo "Unwelcome Guests Folder contains more than two files, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Dialect
NUMFILES=`ls $DROPBOX/Dialect/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Dialect/* $BACKUP/Dialect/
rdimport --delete-cuts --to-cart=040013 --delete-source POLITICS $DROPBOX/Dialect/*
else
echo "Dialect Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Letters and Politics
NUMFILES=`ls $DROPBOX/Letters\ and\ Politics/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Letters\ and\ Politics/* $BACKUP/Letters\ and\ Politics/
rdimport --delete-cuts --to-cart=040012 --delete-source POLITICS $DROPBOX/Letters\ and\ Politics/*
else
echo "Letters and Politics Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#The Monitor
NUMFILES=`ls $DROPBOX/The\ Monitor/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/The\ Monitor/* $BACKUP/The\ Monitor/
rdimport --delete-cuts --to-cart=040011 --delete-source POLITICS $DROPBOX/The\ Monitor/*
else
echo "The Monitor Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Background Briefing
NUMFILES=`ls $DROPBOX/Background\ Briefing/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Background\ Briefing/* $BACKUP/Background\ Briefing/
rdimport --delete-cuts --to-cart=040002 --delete-source POLITICS $DROPBOX/Background\ Briefing/*
else
echo "Background Briefing Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Hard Knock Radio
NUMFILES=`ls $DROPBOX/Hard\ Knock\ Radio/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Hard\ Knock\ Radio/* $BACKUP/Hard\ Knock\ Radio/
rdimport --delete-cuts --to-cart=040003 --delete-source POLITICS $DROPBOX/Hard\ Knock\ Radio/*
else
echo "Hard Knock Radio Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Economic Update
NUMFILES=`ls $DROPBOX/Economic\ Update/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Economic\ Update/* $BACKUP/Economic\ Update/
rdimport --delete-cuts --to-cart=040007 --delete-source POLITICS $DROPBOX/Economic\ Update/*
else
echo "Economic Update Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#First Voices
NUMFILES=`ls $DROPBOX/First\ Voices/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/First\ Voices/* $BACKUP/First\ Voices/
rdimport --delete-cuts --to-cart=040004 --delete-source POLITICS $DROPBOX/First\ Voices/*
else
echo "First Voices Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Indigenous Politics
NUMFILES=`ls $DROPBOX/Indigenous\ Politics/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Indigenous\ Politics/* $BACKUP/Indigenous\ Politics/
rdimport --delete-cuts --to-cart=040005 --delete-source POLITICS $DROPBOX/Indigenous\ Politics/*
else
echo "Indigenous Radio Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Making Contact
NUMFILES=`ls $DROPBOX/Making\ Contact/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Making\ Contact/* $BACKUP/Making\ Contact/
rdimport --delete-cuts --to-cart=040008 --delete-source POLITICS $DROPBOX/Making\ Contact/*
else
echo "Making Contact Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Sprouts
NUMFILES=`ls $DROPBOX/Sprouts/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Sprouts/* $BACKUP/Sprouts/
rdimport --delete-cuts --to-cart=040009 --delete-source POLITICS $DROPBOX/Sprouts/*
else
echo "Sprouts Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi
#Whats the Frequency Kenneth
NUMFILES=`ls $DROPBOX/Whats\ the\ Frequency\ Kenneth/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Whats\ the\ Frequency\ Kenneth/* $BACKUP/Whats\ the\ Frequency\ Kenneth/
rdimport --delete-cuts --to-cart=040010 --delete-source POLITICS $DROPBOX/Whats\ the\ Frequency\ Kenneth/*
else
echo "Whats the Frequency Kenneth Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi

#Science
DROPBOX=$WAZU_HOME/RadioDropBox/Science
BACKUP=$WAZU_HOME/RadioBackup/Science
#Exploration
NUMFILES=`ls $DROPBOX/Exploration/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
if [ $NUMFILES -eq 1 ]; then
cp $DROPBOX/Exploration/* $BACKUP/Exploration/
rdimport --delete-cuts --to-cart=050001 --delete-source SCIENCE $DROPBOX/Exploration/*
else
echo "Exploration Folder contains more than one file, requires manual import" >> $LOGS/multiplefileerror.txt
fi
fi

#Music
DROPBOX=$WAZU_HOME/RadioDropBox/Music
BACKUP=$WAZU_HOME/RadioBackup/Music
#The Nightfly
NUMFILES=`ls $DROPBOX/The\ Nightfly/ | wc -l`
if [ $NUMFILES -gt 0 ]; then
cp $DROPBOX/The\ Nightfly/* $BACKUP/The\ Nightfly/
echo "The Nightfly Folder contains audio files, requires manual import" >> $LOGS/importnotify.txt
fi

export DISPLAY=:0 && export XAUTHORITY=/home/wazu/.Xauthority && sudo -u wazu notify-send "Backing up and Importing" "Backing up and importing of files has completed"


Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2