Menu

#20 Mounting CD fails on PC with more than one CD drive

open
nobody
None
5
2003-11-09
2003-11-09
Ross
No

When booting off the CD on a PC with two or more CD
drives (eg: hdc & hdd), attempting to mount the CD at
boot will fail

The code to read the CD drives is:

CDEV=`dmesg | grep D-ROM | grep hd | cut -d: -f1 | sort
| uniq` # CD-ROM devices

which will get all CD drives, but the code to actually
mount the drive assumes only one device exists:

if [ "$CDEV" ]
then
echo -n "Attempting to mount CD-ROM at $CDEV:"
... etc

Instead of an if, shouldn't a for loop be used instead? eg:

for CD in $CDEV
do
... etc

Discussion


Log in to post a comment.