1834439 Members
2173 Online
110067 Solutions
New Discussion

The "mediainit" command

 
SOLVED
Go to solution
Ewan McDonald
Advisor

The "mediainit" command

Hi all, I need some extra details on the mediainit command.

One of my customers is using this as a test command to ensure the disk is working correctly. When doing this to Fibre Channel Disks, they have been failing. What I need to know is: Can you perform the "mediainit" command with FC disks or is it only intended for SCSI?
The second thing I need to know is how harmful is mediainit to the disks? So far I've only ever used this command if one of my SCSI disks were not showing up on a diskinfo etc... I'd never run the command on a good disk. Is this me being paranoid and is it perfectly safe to run this command on a good disk?

Cheers,

Ewan
8 REPLIES 8
Peter Godron
Honored Contributor

Re: The "mediainit" command

Ewan,
read
man mediainit
Which will answer your second question ;-)
Hint: You are not being paranoid.
Regards
Pete Randall
Outstanding Contributor

Re: The "mediainit" command

A far better (and much less destructive) way to test disks is to use dd:

dd if=/dev/rdsk/c3t6d0 of=/dev/null bs=1024k


Pete

Pete
Kent Ostby
Honored Contributor

Re: The "mediainit" command

Ewan -- I have looked and haven't seen anything that would point to mediainit not working for a Fibre Channel Disk.

I wouldn't recommend it though.

The "dd" that Pete suggests is a much better way to go.

Best regards,

Oz
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Ewan McDonald
Advisor

Re: The "mediainit" command

Hi guys, thanks for your answers but I haven't really got to the end of my problem yet...

One of my customers has used the "mediainit" command to test one of the disks I supplied him. Now this disk will not perform "pvcreate -f" or even a "dd" to /dev/null to flash the disk led. Both these commands worked when I was testing before shipping. What I am trying to determine is whether this is due to him using this command, or whether the disk has become faulty while in transit. It may even be that he hasn't done something to initialise the disk? It shows up in Ioscan, passes tests in STM although only takes about 10 seconds when it should take about 10 mins. It doesn't ask for the read/write option at the start of the test either - just goes straight into testing the disk.

Any more help would be very greatfully appreciated :)
Pete Randall
Outstanding Contributor
Solution

Re: The "mediainit" command

Ewan,

I recall a discussion here on the Forums about wiping a disk before resale of a server. In this discussion it was mentioned by one of the folks with the HP logo next to their name that use of the mediainit command could render the disk useless.

I guess the only way to test this is to try it again on another FC disk and see if it trashes it.


Pete

Pete
Andrew Rutter
Honored Contributor

Re: The "mediainit" command

hi ewan,

mediainit was one of the original tests/verification methods used on hpux.
There is no need to use this nowadays and with modern discs and sizes it most certainly can render discs usless to hpux.
Modern discs have all there bad sectors sorted at manufacture so a mediainit should'nt be needed as it basically just initalzes the inbuilt controller self tests.

in my opinion this may just undo what was done at manufacturing?

I have used it on both scsi and fc disks and if the disc is a reasonble capacity then it can take many hours to complete.
The fc disks always fail though and are rendered destroyed as far as hpux is concerned. They will show a capacity of 0mb in diskinfo aswell.
fc disks can also be of 512 or 520 sector size depending upon the system, so care needs to be taken into consideration for this also. Mediainit only works properly with 512 sector sizes aswell.
stm tests are only very basic and provide a base test in which to start, they do not allow for any grown defects which the disc may have either. If a lic is aquired for stm then you can do more tests with the discs but this is a hp thing only.

The discs can however be brought back to life on a pc based system.

Andy
malvin drakley
Esteemed Contributor

Re: The "mediainit" command

Hi Ewan, I had this problem last year when I tried to mediainit 36gb FC discs and the drives were trashed. After extensive discussions with HP in Europe they finally admitted to me there was a problem with the command. This of course does not help when you have just trashed 10 drives in an FC10. I was fortunate that I managed to get the headers rewritten by a firm specialising in drives only, so the drives were eventually restored to use. Unfortunately HP did not offer this service and it cost £300 to restore all the drives.
Moral is, as other respondents have said is to use "dd" to wipe the drives
cheers
malv
Not me Chief, I'm Radar
Ewan McDonald
Advisor

Re: The "mediainit" command

Thanks guys...