Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Software >> OS >> Unix >> Linux >> Red Hat Enterprise Linux >> How to use blkid command to check whether media is present in a CD-ROM drive

e.g. if disk is present in the drive

# blkid /dev/sr0
/dev/sr0: UUID="2013-05-31-23-04-19-00" LABEL="ARCH_201306" TYPE="iso9660" PTTYPE="dos"

# echo $?
0
 

=> If media is present, there will be some output showing the media label etc AND the value of $? will be 0


e.g. if disk is not present in the drive

# blkid /dev/sr0
# echo $?
2

 

[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]