Operating System - HP-UX
1830898 Members
3216 Online
110017 Solutions
New Discussion

Re: translate block device name to raw device name

 
SOLVED
Go to solution
shai kedem
Occasional Advisor

translate block device name to raw device name

Hello,

from most unix commands, you get the disk name by its block device name, i.e. /dev/dsk/c1t1d1
Does any one know how to get the raw device name (i.e. /dev/rdsk/c1t1d1) from the block device name ? is simply just putting "r" in front of the dsk word ? or is there a command in unix or a C function call which convert the names ?
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: translate block device name to raw device name

Hi:

Yes, putting an 'r' in front of the block device name denotes the "raw" device name.

...JRF...
rajsri
Frequent Advisor
Solution

Re: translate block device name to raw device name

Hi ,
putting r in front of dsk is the option , but even from ioscan -fknC disk command it will show you device filenames , including raw device files.
Dan Hetzel
Honored Contributor

Re: translate block device name to raw device name

Hi,

You're right, the only difference between the name of the block device and the name of the raw device is the 'r'.

If you want to convert it in a script, you can use:
RAW_DEVICE_NAME=`echo $BLOCK_DEVICE_NAME | sed 's/dsk/rdsk/'`

Best regards,

Dan

Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com