Volume group creation
Physical volume and volume group creation are the most basic tasks in LVM, both in Linux and HP-UX, but although command syntax is quite similar in both operative systems the whole process differs in many ways.
- HP-UX:
The example used is valid to 11iv2 and 11iv3 HP-UX versions, with the exception of the persistent DSFs you will have to substitute them for the corresponding legacy devices used in 11iv2.
First create the physical volumes.
root@hp-ux:/# pvcreate -f /dev/rdisk/disk10 Physical volume "/dev/rdisk/disk10" has been successfully created. root@hp-ux:/# root@hp-ux:/# pvcreate -f /dev/rdisk/disk11 Physical volume "/dev/rdisk/disk11" has been successfully created. root@hp-ux:/#
In /dev create a directory named as the new volume group, change the ownership to root:root and the permissions ot 755.
root@hp-ux:/# mkdir -p /dev/vg_new root@hp-ux:/# chown root:root /dev/vg_new root@hp-ux:/# chmod 755 /dev/vg_new
Go into the VG subdirectory and create the group device special file. For the Linux guys, in HP-UX each volume group must have a group device special file under its subdirectory in /dev. This group DSF is created with the mknod command, like any other DSFs the group file must have a major and a minor number.
For LVM 1.0 volume groups the major number must be 64 and for the LVM 2.0 one must be 128. Regarding the minor number, the first two digits will uniquely identify the volume group and the remaining digits must be 0000. In the below example we’re creating a 1.0 volume group.
root@hp-ux:/dev/vg_new# mknod group c 64 0x010000
Change the ownership to root:sys and the permissions to 640.
root@hp-ux:/dev/vg_new# chown root:sys group root@hp-ux:/dev/vg_new# chmod 640 group
And create the volume group with the vgcreate command, the arguments passed are the two physical volumes previously created and the size in megabytes of the physical extent. The last one is optional and if is not provided the default of 4MB will be automatically set.
root@hp-ux:/# vgcreate -s 16 vg_new /dev/disk/disk10 /dev/disk/disk11
Volume group "/dev/vg_new" has been successfully created.
Volume Group configuration for /dev/vg_new has been saved in /etc/lvmconf/vg_new.conf
root@hp-ux:/#
root@hp-ux:/# vgdisplay -v vg_new
--- Volume groups ---
VG Name /dev/vg_new
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 0
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 6000
VGDA 2
PE Size (Mbytes) 16
Total PE 26
Alloc PE 0
Free PE 26
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
--- Physical volumes ---
PV Name /dev/disk/disk10
PV Status available
Total PE 13
Free PE 13
Autoswitch On
PV Name /dev/disk/disk11
PV Status available
Total PE 13
Free PE 13
Autoswitch On
root@hp-ux:/#
- Linux:
0 comments:
Post a Comment