1834508 Members
3095 Online
110068 Solutions
New Discussion

Re: Use of Mediainit

 
SOLVED
Go to solution
Stefan Saliba
Trusted Contributor

Use of Mediainit

I recently came along the command mediainit, which is used to initialize a disk or tape.

When should this command be used. I've never used it to install a new disk. What is the use of mediainit on tapes and what does it mean to partition a tape using the mediainit command


13 REPLIES 13
Peter Kloetgen
Esteemed Contributor

Re: Use of Mediainit

Hi Stefan,

The mediainit command can be used, if you have to send medias like disks or tapes to be veryfied and if the data on it shall not be viewable for anybody. This command formats media.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
steven Burgess_2
Honored Contributor

Re: Use of Mediainit

Hi

You shouldn't have to use medianit on disks these days as they are already formatted when they leave the suppliers shop

Plus - depending on the size of your disk - you could be waiting for quite a while for it to complete

Steve
take your time and think things through
Stefan Farrelly
Honored Contributor

Re: Use of Mediainit


If you have a disk which develops a fault - ie. a bad block, then you use mediainit to do a low level format it on it (then you can pvcreate it and reuse it).

We use it when we get disks that cant be pvcreate'ed - when this produces an I/O error (or dd does). Then we mediainit them. If the mediainit fails the disk is dead - bin it, but most of the time mediainit works fine.

If you use foreign non-HP disks on your HP server then you usually mediainit them first to verify you can use them.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Frank Slootweg
Honored Contributor
Solution

Re: Use of Mediainit

You *never* use mediainit(1M) for hard-disks.

mediainit(1M) is from days long, long gone.

I.e. you also do *not* use it to 'solve' hard-disk I/O errors, nor for non-HP hard-disks.

See http://groups.google.com/groups?selm=a5ktas$d7l$1@support.neth.hp.com for a more complete explanation.

Stefan Farrelly
Honored Contributor

Re: Use of Mediainit


Frank - you completely contradict yourself. You say *never* use mediainit but in your link you advise not to use it and even say you use it for older disks.

Thats what we use it for - older disks. Ive never used it on a disk > 9GB and never had it screw up a drive. Using it on non-HP drives it works brilliantly - for example we had a bunch of Apple SE drives going spare so we tried, unsuccessfully, to pvcreate them, so we ran mediainit first, now we can pvcreate them and use them. Without using mediainit we couldnt have used them. Also, when we have disks that report I/O errors from the dd command, mediainit fixes them so we can use these disks rather than bin them.

Im afraid I dont agree with you.

Im from Palmerston North, New Zealand, but somehow ended up in London...
Frank Slootweg
Honored Contributor

Re: Use of Mediainit

Stefan (F.), I don't see where I contradict myself. I only mention mediainit for disks of at least a decade (10 years) ago. I am sure that your <9GB disks are newer than that.

If, for example for the Apple SE drives, you are talking about drives with a incorrect sector size, then you *can* indeed use mediainit to (try to) get them to 'work'. *However*, while doing so, you have made them much less reliable, for the reasons giving. If that is what you want, then by all means go ahead, but don't expect people to accept that as good advice.

As to disks reporting I/O errors: mediainit does *not* *fix*' these. It may *mask* them for a while, only to bite you in the future. Disks which report I/O errors have to be checked/fixed/replaced, *not* mediainit-ed.

> I'm afraid I dont agree with you.

I understand what you are saying, but as I say in my News article, your advice "hasn't hurt you *yet*! :-(".

For what it is worth, recently Bill Hassell gave, effectively, similar advice on (not using) mediainit.


Stefan Farrelly
Honored Contributor

Re: Use of Mediainit

Hi Frank,

Thanks for the feedback. Ive used mediainit tons of times on disks with are dead with I/O errors when I do a test dd on them, mediainit fixes rhem every time. To me thats the difference between throwing away a disk or reusing it - a big difference.

Can you point me to where Bill recommended not to use mediainit ?

Cheers,

Stefan
Im from Palmerston North, New Zealand, but somehow ended up in London...
Frank Slootweg
Honored Contributor

Re: Use of Mediainit

Hi Stefan (F.),

I think the most recent one is not really Bill Hassell not recommending it, but Sanjay doing so and Bill not contradicting (but expanding on it):

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

The (ITRC Forums) search engine gives some other hits for "Bill Hassell mediainit", but, for me these give dead URLs, even for the one I mention in this post (i.e. that one only worked once).
Stefan Farrelly
Honored Contributor

Re: Use of Mediainit

Hi Frank,

Sanjay says its not advisable - not Bill. But Sanjay doesnt explain his reasoning why not to use it on modern drives. Bill did not backup his advise not to use it.

Bill says mediainit actually just asks modern drives to format themselves - he doesnt say not to use it or even advise not to use it.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Stefan Saliba
Trusted Contributor

Re: Use of Mediainit

Ok

I think I got the gist. AVOID using mediainit especially on new disks. If you want to play around and revive a disk that should be in the bin, then there is nothing to lose by using mediainit.

Thanks guys

Good Day




Frank Slootweg
Honored Contributor

Re: Use of Mediainit

Hi Stefan (F.),

Yes, I know what Sanjay/Bill wrote. The point is that Sanjay's advice matches mine and that Bill did not correct Sanjay. Don't you think he would have if he disagreed with it?

Same for my News article. Bill also posts frequently in that group and rest assured that he will correct someone if they are wrong *and* dangerous.

I would have liked to give 'better' references to ITRC Forums postings from Bill, but as I wrote, the ITRC Forums search engine gives dead URLs to me (I can't even post anymore after that and have to start from scratch). Feel free to do similar searches. Mine gave about six or so hits.


Bill Hassell
Honored Contributor

Re: Use of Mediainit

OK, my aadvice is similar to Frank's: mediainit is not necessary on disk manufactured in the last 5-8 years. They come pre-formatted (meaning that the bad sectors have been relocated and all the hardware headers are complete.

The process of mediainit has been a firmware task since the early 90's, that is, the mediainit program does not actually do anything except start the process on the disk, then waits (for hours, days for 72Gb and higher) for the disk to say it's done.

When you use LVM to carve up the disk and bad block relocation is turned on, any attempt to write on a bad block will cause an automatic relocation to take place. You'll get an errno 5 (I/O error) trying to read the block. fsck will *NEVER* fix a bad block as it is strictly a tool to straighten out tangled directories. To fix a read error on the disk, you must rewrite the data in that block.

Note that mediainit will also do this but it will take a (very) long time.


Bill Hassell, sysadmin
Arockia Jegan
Trusted Contributor

Re: Use of Mediainit

Hi,

We don't need to use the mediainit for the new drives. It takes a lots of time to format the drives.