Operating System - HP-UX
1834136 Members
2527 Online
110064 Solutions
New Discussion

[ Reading CD volume label ]

 
madhavabk
Regular Advisor

[ Reading CD volume label ]

Hi all,

I would like to know the commands/ options to read the volume label of CD.

On solaris we will be able to get this information with fstyp command only.

But on HPUX the commands out put does not contain the volume label.

The requirement is very urgent.

Thanks
Madhava
7 REPLIES 7
Jdamian
Respected Contributor

Re: [ Reading CD volume label ]

I searched in google.

Briefly, the sector 17 in disc contains volume label and other info. Volume label is 32 bytes long and is the second field in that sector.

The structure of 17th sector is:

System ID (32 bytes)
Volume label (32 bytes)
Volume Set ID (128 bytes)
Application ID (128 bytes)
Copyright (37 bytes)
Publisher (128 bytes)
Data preparer (128 bytes)
Abstract Description (37 bytes)
Bibliography (37 bytes).

As sector size varies you must run "diskinfo -v" command to get sector size

Then get 17th sector:

dd if=/dev/rdsk/c0t0d0 of=/sector17 ibs=2048 skip=16 count=1

Now you can display the contents of "volume label":
dd if=/sector17 bs=32 skip=1 count=1


Try
madhavabk
Regular Advisor

Re: [ Reading CD volume label ]

Thanks a lot J. Damian Benavent,

This is really a best way. But this solution i want to have more clarity.

I am able to copy the contents of 17th sector. But the file is incomplete and also i am not able to get the volume label from there.

Can you tell me how i should make use of fstyp along with this to get exactly what i want.

Thanks,
Madhava
Jdamian
Respected Contributor

Re: [ Reading CD volume label ]

I think fstyp cannot be used to display the CD volume label.
madhavabk
Regular Advisor

Re: [ Reading CD volume label ]

Hello J. Damian Benavent,

I know fstyp will not provide the volume label.
my Concern was, the dd command is not returning the volume label on HP for CD ( where as i get volume label with fstyp -v on Solaris for same CD).

( i am talking about same volume label String not command. I am not able to find the volume label that is returned on Solaris in copied contents by dd command on HP ).


That is my concern.
I copied all sectors contents to find the volume label it is not present in copied file.

Please treat this as urgent and provide the solution if any.

Thanks,
Madhava
Florian Heigl (new acc)
Honored Contributor

Re: [ Reading CD volume label ]

First, I never tried that on solaris, if You could provide a simple output, that would really help me understanding what information You seek.

second, You said You got incomplete data, out of sector 17, did You use a 2048byte block size with dd?
yesterday I stood at the edge. Today I'm one step ahead.
RAC_1
Honored Contributor

Re: [ Reading CD volume label ]

HP also has fstyp command. did you try it??

fstyp -v /dev/dsk/cxtxdx
Also diskinfo -v /dev/dsk/cxtxdx

Does that help??
There is no substitute to HARDWORK
madhavabk
Regular Advisor

Re: [ Reading CD volume label ]

Hi all,
Sorry for not giving logs.
Following will be full detail:

===================================
dd if=/dev/rdsk/c0t0d0 of=/tmp/sector17 ibs=2048 obs=2048 skip=16 count=1

o/p
vi /tmp/sector17
^ACD001^ALINUX Personal Data, Feb 15, 2005 /Ã ^B^BÃ
/^A^A^A^A^H^H¸îî¸^T2"¨¨^H^HF^A^A^E^^^V^B^A^A^A




MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD
CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING

2005021518554800^V2005021518554800^V000000000000000
02005021518554800^V^A

============================================
# dd if=/tmp/sector17 bs=32 skip=1 count=1
Personal Data, Feb 15, 21+0 records in
1+0 records out
============================================

SOLARIS
fstyp -v
Volume id