1829744 Members
1196 Online
109992 Solutions
New Discussion

Setting up new VG and LV

 
SOLVED
Go to solution
James_497
Occasional Contributor

Setting up new VG and LV

Greetings:

**WARNING: Newbie questions about to be asked**

Ok, so...I'm used to dealing with AIX more than HP-UX, and my AIX knowledge is a bit out of date. The only reason that I'm asking the following question is that I need to get up to speed and learn this stuff ASAP for a project. That having been said, I apologize in advance for asking any stupid question, but at least I'm asking, right?

I have a CLARiiON CX400 that I have hooked to my RP7400. On the CLARiiON, I have created a LUN. I want that LUN to be accessible through my RP7400 server. For it to be accessible, it has to be mounted, obviously. However, I can't seem to create the "LUN" correctly in HP-UX. Here are the steps, as I understand them, that I should need to take.

1) Run ioscan -funC disk to see if the disk shows up (it does: /dev/dsk/c70d7)
2) Create the physical volume on the server (the RP7400) by using pvcreate.
3) Make the directory to use with mkdir
4) Create the volume group with vgcreate.
5) Create the logical volume with lvcreate
6) Create and mount a file system

At this point, I should be good to go, if this list is correct and all went well. However, I can't get past step 2: I get some error message about 'not a character disk'.

Can someone help me out and point me in the dir of correct instructions? I will be doing this on a test system (of course), and I'm not looking for someone to do this for me...just a point in the right direction.

Thanks!
5 REPLIES 5
Patrick Wallek
Honored Contributor
Solution

Re: Setting up new VG and LV

2) Run pvcreate using /dev/rdsk/c7t0d7

# pvcreate /dev/rdsk/c7t0d7

3) Create /dev/vg?? dir and group file
Assume vg03 as an example
# mkdir /dev/vg03
# mknod /dev/vg03/group c 64 0x030000

The last string is the minor number for the group file which should be unique and ideally should match the vg??. To see all group files do:

# ll /dev/vg*/group

and note the 0x0????? number for each. Remember that this is a hex number.

Your steps 4-6 sound good.

Re: Setting up new VG and LV

welcome to HPUX - you quickly found one of the most annoying features of HPUX's LVM:

pvcreate /dev/dsk/cXtYdZ

returns *not a character device*

just do:

pvcreate /dev/rdsk/cXtYdZ

Instead! Note rdsk instead of dsk.

/dev/dsk contains block special files
/dev/rdsk contains character special files.

I've never really understood why pvcreate doesn't accept either, but it doesn't!

All your other steps look fine.

HTH

Duncan

I am an HPE Employee
Accept or Kudo
A. Clay Stephenson
Acclaimed Contributor

Re: Setting up new VG and LV

You have a few problems. Your first is that pvcreate requires a character device rather than a block device. Use the "rdsk" device nodes rather than the "dsk" device nodes. I assume your c70d7 is a typo because it should look like /dev/rdsk/cXtYdZ.

3b) You must create a "group" device node. The major device number is 64 and the minor device number must be unique. Do an "ls -l /dev/vg*/group" and note the minor device number. By convention, vg00 uses 0x000000, vg01 uses 0x010000, vg02 uses 0x020000, and so on but that is simply convention. As long as the minor device number is unique you are ok.

mkdir /dev/vg05
mknod /dev/vg05/group c 64 0x050000

You also need to activate thr Volume group before mounting filesystems so
5B) vgchange -a y /dev/vg05.
If it ain't broke, I can fix that.
Robert Bennett_3
Respected Contributor

Re: Setting up new VG and LV

James -

pvcreate needs rdsk, not dsk.

Here's a quick little cheatsheet.

# pvcreate /dev/rdsk/cxtydz
# mkdir /dev/vgxx
# mknod /dev/vgxx/group c 64 0x0X0000
# ll /dev/vgxx/group - shows new volume group
# vgcreate /dev/vgxx /dev/dsk/cxtydz
# vgdisplay -v vgxx | more
# lvcreate -L SIZE /dev/vgxx
# newfs -F vxfs /dev/vgxx/lvol1
# mkdir /NEWFILE
# mount /dev/vgxx /NEWFILE
# vi /etc/fstab
"All there is to thinking is seeing something noticeable which makes you see something you weren't noticing which makes you see something that isn't even visible." - Norman Maclean
James_497
Occasional Contributor

Re: Setting up new VG and LV

Thanks, guys!

Following your instructions, I have successfully created the directory that I needed, and it is ready for testing.

This was just what I needed. Now, I'll document it and add it to my handy HP-UX toolbelt.

10 points all around!

Thanks again--

--James