Operating System - HP-UX
1832351 Members
2214 Online
110041 Solutions
New Discussion

How to setup a new disk into a new volume group.

 
SOLVED
Go to solution
Gino Castoldi_2
Honored Contributor

How to setup a new disk into a new volume group.

Hi,

Background info:
L2000/rp5450, HP-UX 11.0 MC/SG 11.09.

I added a new disk (9.1GB LVD) into the front bay of a L2000 server.

I want this new disk to be in its own new volume group. Since we have volume groups
vg00 and vg01 already, I want to create a new vg02 volume group with just this one single new disk. Note, I do not want this to be part
of MC/Service Guard. I want to mount and unmount this new disk at will.

My question is how do I go about doing this?

(10 points to any good answer).
Thank you.
Gino
13 REPLIES 13
Pete Randall
Outstanding Contributor
Solution

Re: How to setup a new disk into a new volume group.

Gino,

Use SAM, disks and filesystems, create (using lvm), you should see your new disk, fill in the blanks.

Good luck,
Pete

Pete
Hartmut Lang
Trusted Contributor

Re: How to setup a new disk into a new volume group.

I would suggest you use "sam" for this tasks. It will guide you to all the nedded steps:

Go to the "section disks and file systems". Select "volume groups" and add a new volume group. Add your new disk as physical volume to this volume group.

The next step would be to create logical volumes on top of this volume group. The logical voule will contain your filesystem (or swap or raw-data).

It is this filesytsem you can mount. You cannot mount a disk or a volume-group.

You can also do all this steps through comand-line. But i recommend sam for this job.

Hartmut
Tom Geudens
Honored Contributor

Re: How to setup a new disk into a new volume group.

Hi,
# Search disk
ioscan -fnC disk

# Create special files for disk
insf

# pvcreate disk (replace ? with your values)
pvcreate /dev/rdsk/c?t?d?

# Create directory for volumegroup
mkdir /dev/vg02

# Create special file for volumegroup
# (check number ! 0x020000 should be all right)
mknod /dev/vg02/group c 64 0x020000

# Create volumegroup (replace ? with your values)
vgcreate -e 20000 -p 24 /dev/vg02 /dev/dsk/c?t?d?

# The vgcreate options are the ones we use in our environment. Yours may differ.

Regards,
Tom
A life ? Cool ! Where can I download one of those from ?
Sukant Naik
Trusted Contributor

Re: How to setup a new disk into a new volume group.

Hi Gino,

Here are the steps

1. Run the command as root for the server to recognize the new disk
#insf -e

2. Run the command
# mkdir /dev/vg03

3. Now we need to do a mknod.
# ll /dev/*/group
You might get a output like this
# ll /dev/*/group
crw-r----- 1 root sys 64 0x000000 May 5 13:36 /dev/vg00/group
crw-rw-rw- 1 root sys 64 0x070000 May 7 14:20 /dev/vglock/group
crw-rw-rw- 1 root sys 64 0x080000 May 7 14:20 /dev/vgshare/group

so create a new node like this
# mknod /dev/vg02/group c 64 0x030000

4. Run ioscan command and get the raw device path for the new disk
# ioscan -fnC disk

5. Initialize the disk. Remember the raw device
# pvcreate -f /dev/rdsk/

6. Now create the volumegroup (Remember the block device file)
# vgcreate /dev/vg02 /dev/dsk/

Thats all.

By the way the simplest method is by using sam command.


-Sukant
Who dares he wins
Pete Randall
Outstanding Contributor

Re: How to setup a new disk into a new volume group.

Sorry, Gino, I though SAM was smart enough to lead you through the steps if you started at file systems. Follow Hartmut's steps.

Pete

Pete
John Palmer
Honored Contributor

Re: How to setup a new disk into a new volume group.

The basics are:-

mkdir -m 755 /dev/vg02
cd /dev/vg02
mknod group c 64 0x020000
pvcreate -f /dev/rdsk/c?d?t?
vgcreate /dev/vg02 /dev/dsk/c?d?t?${DISKS}

Note that the minor number supplied to mknod should be unique in the system as it identifies the volume group. Making it the same as your vg?? is a reasonable standard.

It's also worth checking out 'man vgcreate' to see if any of the options are of interest.

Regards,
John
Juan Manuel López
Valued Contributor

Re: How to setup a new disk into a new volume group.

Hi,
I will explain you the right way to create a new vg with a new disk:

1. Use " pvcreate /dev/rdsk/cxtxdx " to create the new disk.

2. Now create the new VG:

" mkdir /dev/vg03 "
" mknod /dev/vg01/group c64 0x030000 "
" vgcreate vg03 /dev/dsk/cxtxdx "

3. Now you can create your logical volumes lv:

" lvcreate -L100 vg03 "

4. And create the filesystems.

I hope this help you.
Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Tom Geudens
Honored Contributor

Re: How to setup a new disk into a new volume group.

Hi again,
... a little to quick there, sorry ...
After you create your volumegroup, you can create logical volumes/filesystems on it. Example :
lvcreate -L 200 -n lv_opt_example vg02
newfs -F vxfs /dev/vg02/rlv_opt_example

Which you can then mount as you wish :
mkdir /opt/example
mount /dev/vg02/lv_opt_example /opt/example

Regards,
Tom
A life ? Cool ! Where can I download one of those from ?
Peter Kloetgen
Esteemed Contributor

Re: How to setup a new disk into a new volume group.

Hi Gino,

either you use sam, chose menu disks and file systems. Then volume groups, from action menu chose add a new volume group, follow the steps as desired...

via command line it's also possible of course:

pvcreate to make a disk accessable for LVM
vgcreate to make a new volume group
vgdisplay to show new volume group
lvcreate to make a new logical volume
lvdisplay to show logical volumes

for exact usage, have a look to the manpages. Don't forget to make an entry in /etc/fstab, which is done automatically by sam, and to create a file system for your logical volumes, which is also done automatically, if you use sam. And you have to mount it when using command line.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
T G Manikandan
Honored Contributor

Re: How to setup a new disk into a new volume group.

Hello,
Use the command line

# pvcreate -f /dev/dsk/cxtxdx
# mkdir /dev/vg02
# mknod /dev/vg02/group c 64 0xNN0000 # where NN is the unique minor number (in hex)
# vgcreate /dev/vg02 /dev/dsk/cxtxdx
# lvcreate -L -n lvol1 /dev/vg02

Remember to choose a unique minor number for 'mknod' by looking at what is already used with:

# ls -l /dev/*/group

OR

use sam
to first create a volume group with choosing the disk and then create logical volumes and then file systems.
SAM is the easiest way

Thanks
MANOJ SRIVASTAVA
Honored Contributor

Re: How to setup a new disk into a new volume group.

Hi Gino

You may do like this

1. insf to create drive for the new additions only.

2. pvcreate -f /dev/rdsk/cxtydz

3. mkdir /dev/vg02

4. mknod /dev/vg02/group c 64 0x300000 ( unique)

5. vgcreate /dev/vg02 /dev/dsk/cxtydz

6 lvcreate -L < size > /dev/vg02

7.newfs /dev/vg02/rlvol1

8.Add the entry in /etc/fstab for the mount point.


Manoj Srivastava
Juan Manuel López
Valued Contributor

Re: How to setup a new disk into a new volume group.

I think you have to give a lot of 10 points !!
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Helen French
Honored Contributor

Re: How to setup a new disk into a new volume group.

Hi Gino:

I would do this:

1) Find the device file of disk
# ioscan -fnC disk
2) Create new group file for new VG
# mkdir /dev/vg02
# mknod group c 64 0x020000
3) Creating VG
# vgcreate /dev/vg03 /dev/dsk/cxtydz
4) Create LV (on your wish)
# lvcreate -L 2048 /dev/vg02 (create 2GB LV)
5) Create FS
# newfs -F vxfs /dev/vg02/rlvol1
6) Create mount points
# mkdir /new_dir
7) Mount it
# mount /dev/vg02/lvol1 /new_dir
8) If you use MS/SG, then edit /etc/lvmrc file and put this new VG information on that, so that it activates when the system boots.

HTH,
Shiju
Life is a promise, fulfill it!