LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mounting problems... (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-problems-550591/)

jaepi 05-02-2007 04:22 AM

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 :D

reverse 05-02-2007 05:11 AM

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

rtspitz 05-02-2007 05:12 AM

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)

t2000 05-02-2007 11:04 AM

you also won't be able to unmount the cdrom after running nautilus on it. why don't you use automount?

jaepi 05-02-2007 09:08 PM

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... :D

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...

t2000 05-03-2007 11:28 AM

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


All times are GMT -5. The time now is 03:34 PM.