Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

format disks

30 views
Skip to first unread message

Tiago Dias

unread,
Jan 29, 2002, 4:49:04 AM1/29/02
to
Hello anyone knows the command to format the disks ?

thanks

Tiago


mnah...@aurinko.ntc.nokia.com

unread,
Jan 29, 2002, 5:43:51 AM1/29/02
to
In article <a35r96$30e$1...@sunnews.cern.ch>, Tiago Dias wrote:

> Hello anyone knows the command to format the disks ?

Please define "format". I assume , with "disks", you mean the SCSI HDDs
in your HP-UX 10.x or 11.x box... that would be any of the following
commands, depending on what you mean...(and remember to read the manual
page first!):

(ioscan sometimes)
insf
mknod
mediainit
format
dd
pvcreate
vgcreate
vgextend
lvcreate
lvextend
mkfs
newfs
mount

The ones you _usually_ need are pvcreate, vgcreate/extend,
lvcreate/extend, mkfs/newfs and mount. And ioscan if you aren't quite
sure what device you should use.

--
Mikko Nahkola <mikko....@nokia.com>
My ideas, not my employer's. No warranty. YMMV.
#include <disclaimer.h>

luke west

unread,
Feb 24, 2002, 2:04:45 PM2/24/02
to
mnah...@aurinko.ntc.nokia.com wrote in message news:<H1v58.5441$NB2.1...@news2.nokia.com>...

> In article <a35r96$30e$1...@sunnews.cern.ch>, Tiago Dias wrote:
>
> > Hello anyone knows the command to format the disks ?
>
> Please define "format". I assume , with "disks", you mean the SCSI HDDs
> in your HP-UX 10.x or 11.x box... that would be any of the following
> commands, depending on what you mean...(and remember to read the manual
> page first!):
>
> (ioscan sometimes)
> insf
> mknod
> mediainit
> format
> dd
> pvcreate
> vgcreate
> vgextend
> lvcreate
> lvextend
> mkfs
> newfs
> mount
>
> The ones you _usually_ need are pvcreate, vgcreate/extend,
> lvcreate/extend, mkfs/newfs and mount. And ioscan if you aren't quite
> sure what device you should use.

In the past when I've installed new hardwware, Ive only needed the
insf -e to install the special files. Then vgcreate etc, never
pvcreate.
I've a lot of experience of HP kit, but never tried this before!
I've now tried to connect up a new harddrive - an IBM - and I've run
the mediainit command (no errors) but am running the pvcreate command.
I've no idea of how long it will take to run tho.... (2 hrs and
counting)
ho hum!
Lets see!

From the question I guess u r from a Sun background, there is no
equivalent of the format command. HP-UX is more grown-up, and tries to
prevent u from getting to the hardware itself. but there r ways....

L

Simon Green

unread,
Feb 25, 2002, 5:38:43 AM2/25/02
to
luke west wrote:


If your pvcreate is taking 2 hours, then you have a problem. It only takes
a couple of seconds, even on very large drives or RAID LUNs. FWIW I once
installed an IBM drive on an HP box and I never did mediainit (in fact
that's the first time I've ever heard of it -- learn something new every
day, thanks! ;-).

Simon

mnah...@aurinko.ntc.nokia.com

unread,
Feb 26, 2002, 6:26:37 AM2/26/02
to
luke west wrote:
> mnah...@aurinko.ntc.nokia.com wrote in message

>> In article <a35r96$30e$1...@sunnews.cern.ch>, Tiago Dias wrote:


>> > Hello anyone knows the command to format the disks ?

>> The ones you _usually_ need are pvcreate, vgcreate/extend,


>> lvcreate/extend, mkfs/newfs and mount. And ioscan if you aren't quite
>> sure what device you should use.

> In the past when I've installed new hardwware, Ive only needed the
> insf -e to install the special files. Then vgcreate etc, never
> pvcreate.

That's strange. I find that I need to run the pvcreate almost every time
if I have a blank disk I'm adding to the system, or a used-without-LVM
disk... and "pvcreate -f" if I'm adding disks that have belonged to a
different volume group.

Indeed, I don't think I've managed to add an LVM disk _without_ running
pvcreate ever except with SAM and that doesn't count.

> I've a lot of experience of HP kit, but never tried this before!
> I've now tried to connect up a new harddrive - an IBM - and I've run
> the mediainit command (no errors) but am running the pvcreate command.
> I've no idea of how long it will take to run tho.... (2 hrs and
> counting)

Well, you might not have much luck with that - apparently some disks
don't like mediainit. Yes, I've managed to break a couple with
it. Stuff like disk reports only 2 _kilo_bytes total space after
that... don't know how that happened but it did.

Mediainit was mainly useful with what you'd call "very old" disks - less
than 1 GB typically. All the ones that broke were 2 to 4 GB. Haven't
tried with these newer >9GB disks at all, but I've heard that they
should survive it... OTOH so should the 2GB disks too. YMMV. Hope you
have a spare disk.

Robert Gilster

unread,
Feb 26, 2002, 9:25:47 AM2/26/02
to


> > I've a lot of experience of HP kit, but never tried this before!
> > I've now tried to connect up a new harddrive - an IBM - and I've run
> > the mediainit command (no errors) but am running the pvcreate command.
> > I've no idea of how long it will take to run tho.... (2 hrs and
> > counting)

Straight from the HP SRC (Tim Lovejoy actually), and it hasn't hurt me
yet,
1) mediainit the disk
2) pvcreate
3) vgcreate
4) lvcreate
5) newfs

Done this for lots and lots of disks and never had any problems. The
mediainit step takes about 50 years to finish. Never can tell what
nasties the vendor left on the drive when you bought it, the mediainit I
would presume wipes any test residue out.

--
All these opinions are mine,
and are not necessarily shared
by The Boeing Company.

luke west

unread,
Feb 26, 2002, 3:09:34 PM2/26/02
to
Robert Gilster <robert.l...@boeing.com> wrote in message news:<3C7B9AEB...@boeing.com>...

> > > I've a lot of experience of HP kit, but never tried this before!
> > > I've now tried to connect up a new harddrive - an IBM - and I've run
> > > the mediainit command (no errors) but am running the pvcreate command.
> > > I've no idea of how long it will take to run tho.... (2 hrs and
> > > counting)
>
> Straight from the HP SRC (Tim Lovejoy actually), and it hasn't hurt me
> yet,
> 1) mediainit the disk
took about 1 hour
> 2) pvcreate
gave up after 6 hours of machine locking up.....

> 3) vgcreate
> 4) lvcreate
> 5) newfs
>
> Done this for lots and lots of disks and never had any problems. The
> mediainit step takes about 50 years to finish. Never can tell what
> nasties the vendor left on the drive when you bought it, the mediainit I
> would presume wipes any test residue out.

Did u have to give the mediainit any special flags? I just called it
with....

mediainit -v /dev/rdsk/c0t4d0

I'm re-running it at the moment, so will check up in an hour or two,
and then try ...

pvcreate /dev/rdsk/c0t4d0
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x030000
vgcreate /dev/vg01 /dev/dsk/c0t4d0

then go from there (it's a plan at least...!!! :)

Thanks for the toughts - i'd still appreciate any thoughts u have
about the use of the -f option to mediainit...

thanks

L

Frank Slootweg

unread,
Feb 27, 2002, 10:50:24 AM2/27/02
to
Robert Gilster <robert.l...@boeing.com> wrote:
>> > I've a lot of experience of HP kit, but never tried this before!
>> > I've now tried to connect up a new harddrive - an IBM - and I've run
>> > the mediainit command (no errors) but am running the pvcreate command.
>> > I've no idea of how long it will take to run tho.... (2 hrs and
>> > counting)
>
> Straight from the HP SRC (Tim Lovejoy actually), and it hasn't hurt me
> yet,
> 1) mediainit the disk

As Mikko mentioned, for 'modern' disks, i.e. any thing made in the
last decade or so, 1) mediainit is not neccessary and 2) can only do
more harm than good.

As you say, it hasn't hurt you *yet*! :-(

> 2) pvcreate
[deleted]

Robert Gilster

unread,
Feb 27, 2002, 1:00:41 PM2/27/02
to

What harm would that be? While I'm all for cutting out the mediainit
step, as it takes forever, what is so hazardous about mediainit to a
"modern" disk - or (and don't take this the wrong way) is that just a
personal bias?

Ken Green

unread,
Feb 27, 2002, 4:18:20 PM2/27/02
to
Robert Gilster wrote:

I believe that there have been drives that did not know how
to format themselves properly. I've never seen one, but thats
what I've been told. What I have known happen is for the
format to take so long that mediainit timed out, and left the
drive in a mess. But that was probably back in the days of
HP-UX 6.5 & 3.1, maybe 7... anyway back when we first
got drives with a larger capacity than the 571MB 7937
Eagle.

The only time I think it's worth using mediainit is if you are
getting media error from the drive. It will force the drive
to spare out defective sectors. But on production systems
it's probably better to throw the drive at this point.

Cheers

Ken


Frank Slootweg

unread,
Feb 28, 2002, 4:30:04 AM2/28/02
to

mediainit tries to do a low level format (LLF) of the disk. A LLF also
initializes the *non-data* areas, i.e. the 'pre-amble' and 'post-amble'
in the sectors, i.e. (including) information like track and sector
numbers.

Now the good news is that most modern drives ('silently') ignore LLF
requests.

*However*, if a drive does not ignore a LLF request, it may make the
drive less reliable (because the drive can not write the pre-amble and
post-amble with the same precision (i.e. at the exact correct physical
locations) as is done during manufacturing), and in a bad case, it can
make a somewhat operational disk (mostly) inoperable.

So bottom line: It *does* *no* 'good' and it *can* do harm, so why use
it?

Probably the only use today is low level formatting of 'floppies'
(diskettes), but most diskettes are low level formatted at the factory,
so also that use is minimal. If you need to (re-) low level format a
diskette, I advise to do so on a PC with (MS) Windows or (MS) DOS, i.e.
"FORMAT A:".

The mediainit(1M) manual page mentions some other very rare uses,
like sparing and interleaving (not needed for modern drives),
partitioning DDS tapes (does *anybody* use that?) and even older stuff
like initializing CS/80 cartridge tapes.

My advice: Don't use mediainit unless some *'official'* document says
you *have* to (and preferably says *why*).

I hope this helps.

Frank "Started with 270KByte *hard* (fixed head per track) discs!" Slootweg
^

Robert Gilster

unread,
Feb 28, 2002, 10:04:09 AM2/28/02
to

Fine, you don't have to twist my arm too much. I personally, after
reading the man page, didn't see any real use for it - but I felt like
being argumentative anyway.

Like I said somewhere else, I only use mediainit to wipe out tar headers
so that I can use the tape in an Omniback session - AND BECAUSE I GOT AN
E-MAIL FROM THE HP SRC TELLING ME THAT ITS THE PREFERRED METHOD OF
FORMATTING A NEW LVOL - but that was a little while ago. But, I can
easily forget all about that. I don't hold you guys to every word you
say for ever and ever. Times change and so do methods.

Frank Slootweg

unread,
Mar 1, 2002, 3:13:41 AM3/1/02
to
Robert Gilster <robert.l...@boeing.com> wrote:
> Frank Slootweg wrote:
[deleted]

> Fine, you don't have to twist my arm too much. I personally, after
> reading the man page, didn't see any real use for it - but I felt like
> being argumentative anyway.
>
> Like I said somewhere else, I only use mediainit to wipe out tar headers
> so that I can use the tape in an Omniback session - AND BECAUSE I GOT AN
> E-MAIL FROM THE HP SRC TELLING ME THAT ITS THE PREFERRED METHOD OF
> FORMATTING A NEW LVOL - but that was a little while ago. But, I can
> easily forget all about that. I don't hold you guys to every word you
> say for ever and ever. Times change and so do methods.

Yes, contrary to popular belief :-), HP employees are people too and
'hence' they sometimes give 'bad' (read: non-perfect) advice. It is
quite human to think "Hey, this worked and gave no problems, so I'll
keep using/advising that!" while there *are* some effects/issues/
<whatever> which you are unaware of. In the "HP SRC"'s 'defense', there
are quite a lot of 'hardware' people who are not aware of these issues,
so a 'software' person is even less likely to be aware of them.

So, if you think that I am human too - which several people strongly
doubt -, you should also take *my* advice with a grain (pound?) of salt.

Robert Gilster

unread,
Mar 1, 2002, 1:36:44 PM3/1/02
to

Frank Slootweg wrote:

> So, if you think that I am human too - which several people strongly
> doubt -, you should also take *my* advice with a grain (pound?) of salt.

I trust everybody, but then I'm naive as heck.

Besides, you contribute to the group which automatically makes you a cut
above.

0 new messages