Saturday, May 5, 2012

How to mount cdrom on Solaris

We will not gonna use vold in mounting/unmounting media devices in this post. You need to determine first your cdrom by doing iostat -En. I'm using Virtualbox as my test machine on this post.
# iostat -En
c0t0d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: ATA      Product: VBOX HARDDISK    Revision: 1.0  Serial No:
Size: 21.47GB <21474835968 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 24 Predictive Failure Analysis: 0
c0t1d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: VBOX     Product: CD-ROM           Revision: 1.0  Serial No:
Size: 0.00GB <0 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 7 Predictive Failure Analysis: 0
In our posts above, the logical device name of our cdrom is c0t1d0. So basically, our cdrom is in /dev/dsk/c0t1d0s0. We gonna mount now the cdrom on /cdrom. Make sure /cdrom directory exist.
# ls -ld /cdrom
drwxr-xr-x   2 root     root         512 Oct  1 11:44 /cdrom
# df -k /cdrom
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0    16913063 1303986 15439947     8%    /
# mount -F hsfs -o ro /dev/dsk/c0t1d0s0 /cdrom
# df -k /cdrom
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t1d0s0    2096480 2096480       0   100%    /cdrom
You would notice that there is now /cdrom when you do df.

No comments:

Post a Comment