Operating System - HP-UX
1822785 Members
4208 Online
109645 Solutions
New Discussion юеВ

initialize the disk drive

 
SOLVED
Go to solution
szhiyong
Frequent Advisor

initialize the disk drive

Hi,

I want to install a new disk drive. My workstation is HP-UX
B.10.20.

Would someone please tell me how to initialize the disk drive?

Thanks a lot!

zhiyong
My life is now asking and learning, I wish It can change into replying and discussing
15 REPLIES 15
Hai Nguyen_1
Honored Contributor

Re: initialize the disk drive

1. shut down the server
2. Plug in the new disk. If this is an external disk, you do not have to power down the disk array.
3. Power back up the server
4. Check new device file for the new disk:
#ioscan -funC disk
5. If not shown, try:
# ioscan -fnC disk

Hai
Kevin Wright
Honored Contributor
Solution

Re: initialize the disk drive

Then run pvcreate to make the LVM metadata on the disk...if using LVM.
Sanjay_6
Honored Contributor

Re: initialize the disk drive

Hi,

Once you have plugged / connected the disk to your system scsi channel (Make sure the scsi id of this disk is unique on that bus), if you have rebooted the system, the device files would have been generated automatically. Do a "ioscan -fnC disk" to see if the disk is sensed and the device file is seen. If the device file has not been generated, you can do so by running the command "insf -e" from the root prompt.

say the device file is /dev/dsk/cxdytz. First do a pvcreate on the disk,

pvcreate -f /dev/rdsk/cxtydz

Now create a vg using vgcreate or extend and existing vg to this disk using vgextend.

Refer to the hp manual "Managing Systems and Workgroups: A Guide for HP-UX System Administrators" for more help.

http://docs.hp.com/hpux/onlinedocs/B2355-90742/B2355-90742.html

Hope this helps.

Regds
S.K. Chan
Honored Contributor

Re: initialize the disk drive

First of all run .. (example c2t2d0)..
# /etc/diskinfo /dev/rdsk/c2t2d0
and if it shows the correct info especially the "size" as you expect it, then you're all set. Just use "pvcreate" to initialize the disk as a physical volume to be used in a volume group. For example ..
# pvcreate /dev/rdsk/c2t2d0
then continue with the rest of the steps ..
If you use SAM to create/extend a VG you don't even have to run "pvcreate".
Dave Chamberlin
Trusted Contributor

Re: initialize the disk drive

You will need to decide if you will create a new volume group or add this disk to an existing group. To start do an ioscan to get the disk info and make sure it is detected, then:

pvcreate -f /dev/rdsk/cxtydz
where x y and z are your particulars.

To put the disk in its own volume group, say vg01, you would use like:
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x010000
vgcreate -e 20000 /dev/vg01 /dev/dsk/cxtydz

With the volume group created, you will need to create a logical volume:
lvcreate -L MM -n u01 /dev/vg01
where MM is how many megs, u01 will be the name of the logical vol.

then create the file system:
newfs -F vxfs /dev/vg01/ru01

the filesystem can then be mounted:
mount /dev/vg01/u01 /u01

You would then also add a line in your /etc/fstab file to mount the filesystem on bootup.
You should read then man pages for pvcreate, vgcreate, lvcreate and newfs.
szhiyong
Frequent Advisor

Re: initialize the disk drive

Hi,

Thanks a lot for fast reply!!

I check the "diskinfo /dev/rdsk/c1t4d0", but the size is 0 byte.

Even after I use pvcreate, I use "diskinfo /dev/rdsk/c1t4d0", the size is also o bytes.

Would someone tell me how to solve this problem?

zhiyong
My life is now asking and learning, I wish It can change into replying and discussing
Dave Chamberlin
Trusted Contributor

Re: initialize the disk drive

You have to use diskinfo like this:
diskinfo /dev/rdsk/cxtydz

hope that helps.
Dave Chamberlin
Trusted Contributor

Re: initialize the disk drive

ignore my last message. Diskinfo may not give all information for non-HP devices. What type of disk is it? What does the command: ioscan -fnC disk show?
szhiyong
Frequent Advisor

Re: initialize the disk drive

Hi,

Thanks a lot for reply.

I fixed the problem by the sam. There is initialize the disk option in the sam. It is sdisk driver. But I do not how to use command to do this.

Is pvcreate used to initialize the disk drive.

zhiyong
My life is now asking and learning, I wish It can change into replying and discussing
Michael Tully
Honored Contributor

Re: initialize the disk drive

Hi,

Yes it is:

# /usr/sbin/pvcreate /dev/rdsk/c1t4d0
or to force it
# /usr/sbin/pvcreate -f /dev/rdsk/c1t4d0

HTH
Michael
Anyone for a Mutiny ?
szhiyong
Frequent Advisor

Re: initialize the disk drive

Hi,All,

Thanks for reply.

I totally understand.

zhiyong
My life is now asking and learning, I wish It can change into replying and discussing
Fragon
Trusted Contributor

Re: initialize the disk drive

For a new disk, you can make a full test first:
#mediainit /dev/rdsk/c1t4d0
(mediainit initializes mass storage media by formatting the media, writing and reading test patterns to verify media integrity,then sparing any defective blocks found.)
If success, you can then make LVM.


-Live as you wish-
Gerald Zhou
szhiyong
Frequent Advisor

Re: initialize the disk drive

Hi,Gerald,

Thanks for help.I really appreciate it.

This command is realy help me to solve my problem.

zhiyong
My life is now asking and learning, I wish It can change into replying and discussing
Frank Slootweg
Honored Contributor

Re: initialize the disk drive

Just out of interest:

*Exactly* which type of disk drive was it (i.e. manufacturer/supplier, product number, etc.) and was it indeed a "new" disk or was it a disk which came from another system (If so, please some details about that system.)?

Also, is this a 'professional'/production/etc. system, or just some 'play' system?

Thanks.