1846643 Members
2239 Online
110256 Solutions
New Discussion

Re: Disk config

 
Denise Spinger
Occasional Advisor

Disk config

My problem is: how can i change the hardware address of the disks in HP-UX 11i? The address is /dev/dsk/c8t0d0 and I need it to be /dev/dsk/c8t0d7.

Thanks,

Deise
10 REPLIES 10
Kent Ostby
Honored Contributor

Re: Disk config

Deise --

What model of machine are you on and what model of disk are you using ?

diskinfo /dev/rdsk/c8t0d0 will give you the Vendor and Type.

Best regards,

Kent Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Pete Randall
Outstanding Contributor

Re: Disk config

Deise,

Though I've done similar things for tape device files, I'm not completely convinced that this is even possible for disks and I'm reasonably sure that it's not a good idea. Disk device file names are base on the hardware address (path/instance/scsi ID) and changing them, I would think, would lead to mass confusion for the O/S.


Pete


Pete
Denise Spinger
Occasional Advisor

Re: Disk config

The response of diskinfo is:

SCSI describe of /dev/rdsk/c8t0d0:
vendor: DEC
product id: HSG80
type: direct access
size: 53321554 Kbytes
bytes per sector: 512

in fact someone has made rhis in this machine before, but i couldn??t find how. I have a disk that should be /dev/rdsk/c8t0d1 but has changed to /dev/rdsk/c8t0d6.

Thanks,

Deise
Massimo Bianchi
Honored Contributor

Re: Disk config

In theis thread, very similar, there is explained a solution.

But i would use it with care, and only if truly forced.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xf9e4f6ba6e3e1049aba32d2b44d4b50a,00.html

Massimo
Enrico P.
Honored Contributor

Re: Disk config

Hi,
cX is the external bus' s card istance
tX is the scsi target
dX is the lun' s disk array

You can change the card istance' s value whit the above procedure but I don't think you can modify the lun' s value. It depend by how disk array is partitioned.
Can you post your
ioscan -fnCext_bus
ioscan -fnCdisk
ll /dev/dsk ?

Enrico.
Bill Hassell
Honored Contributor

Re: Disk config

The device file names are not important so you could change /dev/dsk/c8t0d0 to /dev/dsk/MyFunnyName and it would work just as before..UNLESS that disk is (or going to be) a logical in a volume group or is already recorded in some other location (like /etc/fstab). The disk names work like this:

/dev/dsk/c8t0d0 requires a second device file located in /dev/rdsk/c8t0d0 (for the raw device name) and to keep sysadmins from going totally braindead, this convention should be maintained. The c8 portion refers to the instance or occurrance of the I/O card in the backplane. The I/O is scanned during installation and the first disk I/O card is discovered )and it has a disk attached) then it will be called instance 0 and device files will start with c0. The next disk I/O will be named c1 and so on. This convention is part of the insf command which creates device files.

Note that if you add another card at a later time, the instance will not follow the backplane order but instead will follow the order in which it was first seen. That's why using Ignite/UX to restore a system can result in new device file names as all the cards will be seen for the first timwe, in backplane order.

The t0 is the hardware address of the disk such as the SCSI address. And finally the d0 portion is the LUN or sub-unit inside the disk. For example, a dual floppy device might have a SCSI address of 5 and the left drive is LUN 0 while the right drive is LUN 1. For disk arrays, there really aren't individual disk drives (they are hidden by the array controler) but sections of disk space call Logical Unit Numbers or LUNs.

So the name tells a fair amount about the device but to decode what the kernel thinks about this device, always use lssf as in:

lssf /dev/dsk/c8t0d0

lssf does not care about the naming convention, just the major and minor numbers. ANother command which asociates real hardware with device files is ioscan, a tool that almost every other Unix vendor wishes they had. To see everything:

ioscan -kf

To see just the disks:

ioscan -kfC disk

To see the device files associated with all the tape drives:

ioscan -knfC tape

and so on. The physical hardware path and options are stored in the devicefile's major and minor numbers. So the actual name isn't too important by itself.

Here's the caveat: if this disk is part of a volume group, do NOT change the device file name! It has been recorded in /etc/lvmtab and renaming the device will cause the volume group to fail upon activation (typically bootup). In your example, /dev/dsk/c8t0d0 is supposed to be /dev/dsk/c8t0d7 but this indicates that the device pointed to LUN 0 and you want to rename it so it looks like a device that points to LUN 7. Renaming the devicefile will not change the LUN as that is recorded in the minor number. You can change the name but lssf will still report the LUN recorded in the minor number.

Perhaps telling us why you want to change it will make it easier to understand your question.


Bill Hassell, sysadmin
Geoff Wild
Honored Contributor

Re: Disk config

Have a look at the ioinit command with the -f option.

-f infile Use the file infile to reassign instance numbers to devices within a specified class.
infile may have multiple entries, each to appear on a separate line, each field in the entry separated by 1 or more blanks.
Entries should conform to the following format:

h/w_path class_name instance_#

ioinit preprocesses the contents of infile, looking for invalid entries, and prints out explanatory messages.
An entry is considered to be invalid if the specified hardware path or class name does not already exist in the system, or if the specified instance number already exists for the given class.


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Denise Spinger
Occasional Advisor

Re: Disk config

Enrico,

I am sending the response to the commands attached. I tried to use ioinit -f this weekwend but it did not work.

Thanks,

Deise
Enrico P.
Honored Contributor

Re: Disk config

Hi,
in the ioscan command I don' t see the c8... disks, have you modified the card istance number?
If the disks in the question are in the card istance number 12 you already have the c12t0d7 special file.
However how Bill wrote, I think you can modify the special file in the /dev/dsk and /dev/rdsk directories without modify the correspondent disk.

E.g.

mv /dev/dsk/c8t0d0 /dev/dsk/c8t0d7
mv /dev/rdsk/c8t0d0 /dev/rdsk/c8t0d7

Take care that the disk in the question not be already part of a VG and that you don' t have already the c8t0d7 special file in the /dev/dsk and /dev/rdsk directories.
I never try this and I can' t test it.
I don' t know if it work, I ask for the other forum member support.

Enrico.





Denise Spinger
Occasional Advisor

Re: Disk config

I am sorry but a attached the wrong file. This is the right one. The file I sent is with the commands executed in my production equipment. The problem is in my development environment, wich i am sending the file now. If i have problem in my production equipment i change the processes to my development equipment. I have added two disks to production and to development and i need to see the disks in development site as /dev/dsk/c8t0d0 because when it takes the production site i already have another disks defined in that place.

Thanks,

Deise