1753734 Members
4729 Online
108799 Solutions
New Discussion юеВ

Re: CDROM locked

 
Juan M Leon
Trusted Contributor

CDROM locked

Hello I would like some orientation to write a c program to send unlock signal to cdrom. I have a problem wehre the cdrom was mounted using pfs and the terminal window was closed by accident. I killed the process and reboot the server however everytime that I attempt to mount the cd after the reboot it sayd that the device is busy. I dont think the device is damaged because I was able to mount the cdrom.
any help writing a c code using sctl_io to unlock the cd will be appreciated.

thanks in advance
7 REPLIES 7
Mel Burslan
Honored Contributor

Re: CDROM locked

when you run the command

pfs_mount

without any arguments, do you see your cdrom being mounted even though it refuses to mount it when you request it ??

Also did you try to mount the cdrom with the regular mount command instead of using pfs_mount ? And what response did you get for it ?

________________________________
UNIX because I majored in cryptology...
Stephen Keane
Honored Contributor

Re: CDROM locked

I can post some code snippets if you like?
Stephen Keane
Honored Contributor

Re: CDROM locked

Something like this maybe?
Juan M Leon
Trusted Contributor

Re: CDROM locked

Jeff,

Thanks for the code, I tried to compile and I got the following error.
I am not much of C programmer I do scripting but not C.
(Bundled) cc: "unlockcd.c", line 7: warning 5: "const" will become a keyword.
(Bundled) cc: "unlockcd.c", line 7: error 1000: Unexpected symbol: "unsigned".
(Bundled) cc: "unlockcd.c", line 8: warning 5: "const" will become a keyword.
(Bundled) cc: "unlockcd.c", line 8: error 1000: Unexpected symbol: "unsigned".
(Bundled) cc: "unlockcd.c", line 9: warning 5: "const" will become a keyword.
(Bundled) cc: "unlockcd.c", line 9: error 1000: Unexpected symbol: "unsigned".
(Bundled) cc: "unlockcd.c", line 11: error 1705: Function prototypes are an ANSI feature.

and I conpiled using the following
cc unlockcd.c -o unlockcd

thanks for your help
Stephen Keane
Honored Contributor

Re: CDROM locked

Sorry, didn't realise you were using the built in 'cc' compiler, try this ...
Juan M Leon
Trusted Contributor

Re: CDROM locked

Stephen,

Thanks for the updated code. seems to compile witgh no problems and seems to be doing something. the following lines shows what I did, however I am still unable to unlock the CD.

Usage : ./unlockcd cd_device
unix # ./unlockcd /dev/dsk/c1t1d0
Failed to open /dev/dsk/c1t1d0 because Device busy
unix # ./unlockcd /dev/dsk/c1t1d0
Failed to open /dev/dsk/c1t1d0 because Device busy
unix # ./unlockcd /dev/rdsk/c1t1d0
Drive /dev/rdsk/c1t1d0 unlocked
unix # mount /dev/dsk/c1t1d0 /cdrom
/dev/dsk/c5t2d0: Device busy
unix # ./unlockcd /dev/rdsk/c1t1d0
Drive /dev/rdsk/c1t1d0 unlocked
unix # ./unlockcd /dev/dsk/c1t1d0
Failed to open /dev/dsk/c1t1d0 because Device busy

I tried use the rdsk and seems to open unlock the device but if I try dsk it reports unable to open the device and cannot do anything. any suggestions.
Juan M Leon
Trusted Contributor

Re: CDROM locked

Stephen, I think it took a little bit time before responding. now I am able to open the case and mount the cdrom.

Thanks for you help.