LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Puppy (https://www.linuxquestions.org/questions/puppy-71/)
-   -   Check for prescense of CD/DVD (https://www.linuxquestions.org/questions/puppy-71/check-for-prescense-of-cd-dvd-4175549193/)

Fixit7 07-28-2015 03:47 PM

Check for prescense of CD/DVD
 
Is there a way to check if there is a CD/DVD in /mnt/sr0/?

rokytnji 07-28-2015 04:31 PM

Try

Code:

probedisk
I know it was in older Puppy Linux. Not sure of newer versions.

Also. Is there a CD/DCD drive wizard on the setup menu.

Pupinfo comes to mind.

Might help, or not.

http://puppylinux.org/wikka/HowToDetectDevices

Fixit7 07-28-2015 04:58 PM

I forgot to put in my post that I needed to check using a bash script.

Keith Hedger 07-28-2015 07:41 PM

Code:

findmnt /dev/sr0
see the man page for more details

Fixit7 07-28-2015 07:52 PM

I do not have findmnt nor does Puppy Package Manager have it.

I will look around.

michaelk 07-28-2015 07:59 PM

What about the find command i.e.

find -s /dev/sr0

Fixit7 07-28-2015 08:15 PM

find: unknown predicate `-s'

michaelk 07-28-2015 08:17 PM

Sorry I meant file not find...

Fixit7 07-28-2015 10:29 PM

With a DVD in the drive, it gives this.

# file -s /dev/sr0
/dev/sr0: ISO 9660 CD-ROM filesystem data 'CDROM

With no DVD...

# file -s /dev/sr0
/dev/sr0: writable, no read permission


It looks like a script that looks and finds 'writable' would indicate an empty drive.

michaelk 07-28-2015 10:44 PM

I've never tried with an audio CD so not sure what file will output. Typical disc filesystems are either ISO9660 or UDF. cd-info is another utility but do not know if available on puppy.

Keith Hedger 07-29-2015 05:05 AM

Quote:

Originally Posted by Fixit7 (Post 5397554)
I do not have findmnt nor does Puppy Package Manager have it.

I will look around.

findmnt is part of util-linux and should be available on most modern distros, it may not be in the standard path though so try
Code:

which findmnt

Fixit7 07-29-2015 05:31 AM

Thanks I installed it.

findmnt /dev/sr0 does not return anything on a CD that has files on it.

No icon appears on the desktop when a CD is inserted.??

Mount will mount it, but still no icon on desktop ?

Keith Hedger 07-29-2015 06:49 AM

Is the CD a music CD as they don't have 'real' file system and so findmnt will return nothing and you wont get a cd on your desktop, so for instance when I insert a dvd I get
Code:

keithhedger@LFSCerebro:~-> findmnt /dev/sr0
TARGET                      SOURCE  FSTYPE OPTIONS
/media/THE_AMAZING_SPIDER_M /dev/sr0 udf    ro,nosuid,nodev,noexec,noatime,uid=1

But if I insert a CD I get no output, there is a fuse system that will create a fake file system for a CD, can't remember what it's called, cdfs or some such.

Fixit7 07-29-2015 08:06 AM

It's a data CD with no music on it.

Keith Hedger 07-29-2015 08:15 AM

Then it should mount OK this must be a puppy linux thing, which I can't help you with, its probably just a permissions thing, you may need to add yourself to a specific group to be able to mount cdroms eg group 'cdrom'.
Try mounting it manually and see what happens.


All times are GMT -5. The time now is 01:11 PM.