LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices


Reply
  Search this Thread
Old 07-28-2015, 03:47 PM   #1
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Rep: Reputation: 169Reputation: 169
Check for prescense of CD/DVD


Is there a way to check if there is a CD/DVD in /mnt/sr0/?
 
Old 07-28-2015, 04:31 PM   #2
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,143
Blog Entries: 21

Rep: Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481Reputation: 3481
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
 
Old 07-28-2015, 04:58 PM   #3
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I forgot to put in my post that I needed to check using a bash script.
 
Old 07-28-2015, 07:41 PM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,153

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Code:
findmnt /dev/sr0
see the man page for more details
 
Old 07-28-2015, 07:52 PM   #5
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I do not have findmnt nor does Puppy Package Manager have it.

I will look around.
 
Old 07-28-2015, 07:59 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
What about the find command i.e.

find -s /dev/sr0
 
Old 07-28-2015, 08:15 PM   #7
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
find: unknown predicate `-s'
 
Old 07-28-2015, 08:17 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
Sorry I meant file not find...
 
Old 07-28-2015, 10:29 PM   #9
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
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.
 
Old 07-28-2015, 10:44 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,750

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
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.
 
Old 07-29-2015, 05:05 AM   #11
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,153

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Quote:
Originally Posted by Fixit7 View Post
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
 
Old 07-29-2015, 05:31 AM   #12
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
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 ?
 
Old 07-29-2015, 06:49 AM   #13
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,153

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
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.
 
Old 07-29-2015, 08:06 AM   #14
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
It's a data CD with no music on it.
 
Old 07-29-2015, 08:15 AM   #15
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,153

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
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.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
DVD integrity check? protorox Linux - Software 3 04-02-2014 11:13 AM
How to check whether a bootable DVD is damaged or not ? Aquarius_Girl Linux - General 15 07-13-2010 08:27 AM
Slow USB DVD writes what do i check. Spirals Linux - Hardware 4 12-07-2009 03:41 PM
How to check whether there's a CD / DVD mounted in C++? g4j31a5 Programming 1 05-29-2007 04:45 AM
Can somebody check my dvd filesystem layout? Inexactitude Linux - Software 3 03-06-2004 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy

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