LinuxQuestions.org
Review your favorite Linux distribution.
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 05-02-2007, 05:22 AM   #1
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189
Blog Entries: 1

Rep: Reputation: 30
mounting problems...


hello there again guys, i had already started a bash script that opens the hdd...im having trouble with the mounting part, it produces an error like:

mount: can't find /cdrom in /etc/fstab or /etc/mtab

my script enables the user to place his cd-rom for 5 seconds before it will close, then it will mount and open the cd-rom with nautilus(since im using GNOME) then after 5 seconds it will unmount and then eject the hdd... here is my code

#!/bin/bash

echo -n "Enter password: "

read -s password


if [ "$password" = "jaepi" ]; then
eject /dev/hdd
fi
sleep 5
eject -t /dev/hdd
mount /dev/cdrom

if [ "$?" -eq "0" ]; then
nautilus /cdrom
sleep 5
umount /dev/cdrom
eject /dev/hdd
sleep 5
eject -t /dev/hdd
else
exit 1
fi


what do you think is wrong?? did i miss to set a path or something?? please help...thanks
 
Old 05-02-2007, 06:11 AM   #2
reverse
Member
 
Registered: Apr 2007
Distribution: Gentoo
Posts: 337

Rep: Reputation: 30
Replace:
Code:
mount /dev/cdrom
with:

Code:
mount /dev/cdrom /mnt/cdrom
or whatever. *OR* add a /dev/cdrom entry in /etc/fstab

P.S.: the password thing is more or less useless

Last edited by reverse; 05-02-2007 at 06:13 AM.
 
Old 05-02-2007, 06:12 AM   #3
rtspitz
Member
 
Registered: Jan 2005
Location: germany
Distribution: suse, opensuse, debian, others for testing
Posts: 307

Rep: Reputation: 32
the problem seems to be that you haven't defined in /etc/fstab where the mount-command should mount '/dev/cdrom' !
so 'mount /dev/cdrom' doesn't know the mount-target, see line 9 of your code (empty lines skipped)
 
Old 05-02-2007, 12:04 PM   #4
t2000
LQ Newbie
 
Registered: Jan 2005
Distribution: Mandrake 10.1 community, Gentoo, Fedora
Posts: 17

Rep: Reputation: 0
you also won't be able to unmount the cdrom after running nautilus on it. why don't you use automount?
 
Old 05-02-2007, 10:08 PM   #5
jaepi
Member
 
Registered: Apr 2007
Location: Urban Jungle
Distribution: Ubuntu
Posts: 189
Blog Entries: 1

Original Poster
Rep: Reputation: 30
i got it...thanks guys...i was not able to see what's inside my /etc/fstab directory...that's why i missed the mount point of the hdd...weeee...thanks again...

now, i know how to open the hdd and close it then open the nautilus...the problem that im undergoing right now is how to write files into the cdrom...like for example, after placing the cdrom, i want to burn some mp3 files located at the /home/username directory...
 
Old 05-03-2007, 12:28 PM   #6
t2000
LQ Newbie
 
Registered: Jan 2005
Distribution: Mandrake 10.1 community, Gentoo, Fedora
Posts: 17

Rep: Reputation: 0
You can use cdrecord, it's easy to use, ships with your distro and there are lots of tutorials online.
 
  


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
Mounting Problems Jongi SUSE / openSUSE 2 09-09-2005 08:33 PM
new... problems mounting the_hommer Debian 5 12-26-2004 10:16 PM
Mounting problems Thunderhawk Linux - Software 5 10-09-2004 08:49 AM
Mounting problems tearinox Linux - Newbie 7 08-27-2003 06:53 PM
Problems with mounting Constantin Linux - Newbie 1 05-27-2002 03:31 PM


All times are GMT -5. The time now is 11:43 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration