LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-24-2002, 05:33 PM   #1
alexphyd
LQ Newbie
 
Registered: Oct 2002
Location: rome
Posts: 24

Rep: Reputation: 15
Command to know a cd filesystem in the cdrom,without tring to play/mount it ?


Hi, is there in linux a command or
software via which is possible to
know the filesystem type of a cd
in the cdrom (and actually also
whether there is a cd in the cdrom
or not) without tring to mount it
or play it? if there were a way,
I could then write a script
so that clicking on the cdrom
could either mount it or play it
straight away, as in Windows!This is a
nice feature, and I was wondering whether
it is possible to mime it in linux
too!

Thanks for any help

Alex
 
Old 11-24-2002, 05:42 PM   #2
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Well, there are things like automount (perhaps difficult to unerstand), supermount (unstable), amd (difficult to understand) that will check to
see if there is anything in the drive, and mount it if so when you stat the
device. You should be able to set up an icon on your desktop that will
stat the device when you activate the icon.
I've heard of people using supermount that comes with some of the latest
releases of RH and MDK, but the last time I saw a modification date on
supermount was something like 1998. . .
automount works. If, after reading up on it, you need help, post back. . .
 
Old 11-25-2002, 07:25 AM   #3
jglen490
Member
 
Registered: Apr 2002
Location: The next brick house on the right.
Distribution: Kubuntu 18.04, Bodhi 5.0
Posts: 691

Rep: Reputation: 45
Don't know what RedHat does with supermount, but with Mandrake it worked well in 8.0, was brken in 8.1, and then worked well again in 8.2. AFAIK, it also works properly in 9.0.
 
Old 11-25-2002, 07:32 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
should give you plenty of info :"cdrecord -toc"
 
Old 11-25-2002, 05:10 PM   #5
alexphyd
LQ Newbie
 
Registered: Oct 2002
Location: rome
Posts: 24

Original Poster
Rep: Reputation: 15
I have checked supermount and automount, but I could not find them. I have then discovered that only with
"expert installation" you have those command.
As for amd, I could not find that either. Is it a red hat
command only? Should I update to 9.0?
As to cdrecord -toc, I could not find any useful
option....


Alex
 
Old 11-25-2002, 06:03 PM   #6
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Do a google search, those packages are out there.
What distro are you using?
 
Old 11-26-2002, 08:15 PM   #7
alexphyd
LQ Newbie
 
Registered: Oct 2002
Location: rome
Posts: 24

Original Poster
Rep: Reputation: 15
Hi, I have Mandrake 8.1, and I found the package! it is
autofs, which manages the daemon in charge to
check the mounting every tot secs! The idea is then
that it automatically mounts the cdrom as soon as I try
to access it, and unmounts it after tot secs if notin use!
however, the firts option is already supported by KDE,
and as for the second one I can unmount simply asking
the cdrom to eject the disk, so....no help I think
unless you had something else in mind...
Also, I just verified that the mount command does not
return apparently any boolean value in response to the
operation of mounting, which seems incredible
8verified in a shell script as well as perl one).
However, I have written a c++ little program using
the sys/mount.h library where the mount
function returns a proper flag (=0 success, -1 failure)
together with an errn variable (to be found in <errn.h>)
which contains a numerical value which clearly and
univoquely defines the cause of trouble if any, so I think
I may just use this? (the idea is to setuid this
little program so that any user can launch it, which is
probably yhe way it is done in KDE as well, as only root
can use mount anyway)..
let me know of any cleverer way to do it, or if the way
I am tring is just dumb for some reason

Alex
 
Old 11-27-2002, 09:17 AM   #8
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
I don't have a system here right now to test this or see what happens but it's just an idea. How about doing a fake mount, wouldn't that give you enough information to work with?

mount -fvn /dev/cd /mnt

The man page of mount should give you more information on that.

Well I guess it doesn't really work. I just tried it and it looks like it only tries to auto detect the filesystem after the first mount call fails. And with the -f option the mount system call is never executed. You could still try a mount and umount in the same way. Don't know what you'd get for a music cd or an unknown filesystem type though.

Last edited by Mik; 11-28-2002 at 02:18 AM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CDROM refuses to mount, /dev/cdrom does not exist shane25119 Linux - Hardware 10 08-02-2009 10:43 PM
mount: unknown filesystem type 'ntfs' when trying to mount windows drive... DiZASTiX Linux - Hardware 12 09-28-2008 07:29 PM
HELP: I cannot mount my filesystem. Manuel-H Linux - Software 1 06-19-2004 08:14 AM
How do I mount my cdrom via command in MDK 9.2? StlthMd Linux - Hardware 3 01-08-2004 05:01 AM
tring to mount scd0 Peingune Linux - Newbie 6 05-15-2003 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:32 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