Advertisements

Tag Archives: pvcreate

HP-UX: Disk added to Volume Group but showing different Total PE and Free PE than expected

After I added a disk to LVM

root@hpux:~ # pvcreate /dev/rdisk/disk670
Physical volume “/dev/rdisk/disk670” has been successfully created.

Disk added but it shows wrong total and free PE

root@hpux:~ # vgextend -g pvgLP0data vgLP0data /dev/disk/disk670
Volume group “vgLP0data” has been successfully extended.
Volume Group configuration for /dev/vgLP0data has been saved in /etc/lvmconf/vgLP0data.conf
vlunx045:/root# vgdisplay -v vgLP0data
— Volume groups —
VG Name /dev/vgLP0data
VG Write Access read/write
VG Status available, exclusive
Max LV 2047
Cur LV 8
Open LV 8
Cur Snapshot LV 0
Max PV 2048
Cur PV 8
Act PV 8
Max PE per PV 447994
VGDA 16
PE Size (Mbytes) 32
Unshare unit size (Kbytes) 1024
Total PE 447994
Alloc PE 447986
Current pre-allocated PE 0
Free PE 8
Total PVG 1
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 2.2
VG Max Size 14335819m
VG Max Extents 447994
Cur Snapshot Capacity 0p
Max Snapshot Capacity 14335819m

— Logical volumes —
LV Name /dev/vgLP0data/lvsapdata1
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata2
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata3
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata4
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata5
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata6
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata7
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata8
LV Status available/syncd
LV Size (Mbytes) 0
Current LE 0
Allocated PE 0
Used PV 0

— Physical volumes —
PV Name /dev/disk/disk949
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk950
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk951
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk952
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk953
PV Status available
Total PE 63999
Free PE 2
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk954
PV Status available
Total PE 63999
Free PE 2
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk955
PV Status available
Total PE 63999
Free PE 3
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk670
PV Status available
Total PE 1
Free PE 1
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

— Physical volume groups —
PVG Name pvgLP0data
PV Name /dev/disk/disk949
PV Name /dev/disk/disk950
PV Name /dev/disk/disk951
PV Name /dev/disk/disk952
PV Name /dev/disk/disk953
PV Name /dev/disk/disk954
PV Name /dev/disk/disk955
PV Name /dev/disk/disk670

We need to change VG Max Size. But first, let’s remove the disk from the volume group

root@hpux:~ # vgreduce vgLP0data /dev/disk/disk670
Physical volume “/dev/disk/disk670” has been successfully deleted from
physical volume group “pvgLP0data”.
Volume group “vgLP0data” has been successfully reduced.
Volume Group configuration for /dev/vgLP0data has been saved in /etc/lvmconf/vgLP0data.conf

Then run vgmodify to change the VG Max Size for the volume group. This volume group version is 2.2 so we use the following options:

root@hpux:~ # vgmodify -r -a -S 20t vgLP0data
Reconfiguration of physical volume “/dev/disk/disk949” for the
requested maximum volume group size 20971520 MB succeeded.
Previous number of extents: 63999
Number of extents after reconfiguration: 63999
Physical volume “/dev/disk/disk949” was changed.

Volume Group configuration for /dev/vgLP0data has been saved.

Reconfiguration of physical volume “/dev/disk/disk950” for the
requested maximum volume group size 20971520 MB succeeded.
Previous number of extents: 63999
Number of extents after reconfiguration: 63999
Physical volume “/dev/disk/disk950” was changed.

Volume Group configuration for /dev/vgLP0data has been saved.

Reconfiguration of physical volume “/dev/disk/disk951” for the
requested maximum volume group size 20971520 MB succeeded.
Previous number of extents: 63999
Number of extents after reconfiguration: 63999
Physical volume “/dev/disk/disk951” was changed.

Volume Group configuration for /dev/vgLP0data has been saved.

Reconfiguration of physical volume “/dev/disk/disk952” for the
requested maximum volume group size 20971520 MB succeeded.
Previous number of extents: 63999
Number of extents after reconfiguration: 63999
Physical volume “/dev/disk/disk952” was changed.

Volume Group configuration for /dev/vgLP0data has been saved.

Reconfiguration of physical volume “/dev/disk/disk953” for the
requested maximum volume group size 20971520 MB succeeded.
Previous number of extents: 63999
Number of extents after reconfiguration: 63999
Physical volume “/dev/disk/disk953” was changed.

Volume Group configuration for /dev/vgLP0data has been saved.

Reconfiguration of physical volume “/dev/disk/disk954” for the
requested maximum volume group size 20971520 MB succeeded.
Previous number of extents: 63999
Number of extents after reconfiguration: 63999
Physical volume “/dev/disk/disk954” was changed.

Volume Group configuration for /dev/vgLP0data has been saved.

Add the disk back and it will show the correct Total PE and Free PE

root@hpux:~ # vgextend -g pvgLP0data vgLP0data /dev/disk/disk670
Volume group “vgLP0data” has been successfully extended.
Physical volume group “pvgLP0data” has been successfully extended.
Volume Group configuration for /dev/vgLP0data has been saved in /etc/lvmconf/vgLP0data.conf

root@hpux:~ # vgdisplay -v vgLP0data
— Volume groups —
VG Name /dev/vgLP0data
VG Write Access read/write
VG Status available, exclusive
Max LV 2047
Cur LV 8
Open LV 8
Cur Snapshot LV 0
Max PV 2048
Cur PV 8
Act PV 8
Max PE per PV 524288
VGDA 16
PE Size (Mbytes) 32
Unshare unit size (Kbytes) 1024
Total PE 511992
Alloc PE 447986
Current pre-allocated PE 0
Free PE 64006
Total PVG 1
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 2.2
VG Max Size 20t
VG Max Extents 655360
Cur Snapshot Capacity 0p
Max Snapshot Capacity 20t

— Logical volumes —
LV Name /dev/vgLP0data/lvsapdata1
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata2
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata3
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata4
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata5
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata6
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata7
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata8
LV Status available/syncd
LV Size (Mbytes) 0
Current LE 0
Allocated PE 0
Used PV 0

— Physical volumes —
PV Name /dev/disk/disk949
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk950
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk951
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk952
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk953
PV Status available
Total PE 63999
Free PE 2
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk954
PV Status available
Total PE 63999
Free PE 2
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk955
PV Status available
Total PE 63999
Free PE 3
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk670
PV Status available
Total PE 63999
Free PE 63999
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

— Physical volume groups —
PVG Name pvgLP0data
PV Name /dev/disk/disk949
PV Name /dev/disk/disk950
PV Name /dev/disk/disk951
PV Name /dev/disk/disk952
PV Name /dev/disk/disk953
PV Name /dev/disk/disk954
PV Name /dev/disk/disk955
PV Name /dev/disk/disk670

Advertisements

HP-UX: Adding a new disk that is part of a Physical Volume Group (PVG)

root@hpux:~ # vgdisplay -v vgLP0data
— Volume groups —
VG Name /dev/vgLP0data
VG Write Access read/write
VG Status available, exclusive
Max LV 2047
Cur LV 7
Open LV 7
Cur Snapshot LV 0
Max PV 2048
Cur PV 7
Act PV 7
Max PE per PV 447994
VGDA 14
PE Size (Mbytes) 32
Unshare unit size (Kbytes) 1024
Total PE 447993
Alloc PE 447986
Current pre-allocated PE 0
Free PE 7
Total PVG 1
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 2.2
VG Max Size 14335819m
VG Max Extents 447994
Cur Snapshot Capacity 0p
Max Snapshot Capacity 14335819m

— Logical volumes —
LV Name /dev/vgLP0data/lvsapdata1
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata2
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata3
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata4
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata5
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata6
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

LV Name /dev/vgLP0data/lvsapdata7
LV Status available/syncd
LV Size (Mbytes) 2047936
Current LE 63998
Allocated PE 63998
Used PV 7

— Physical volumes —
PV Name /dev/disk/disk949
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk950
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk951
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk952
PV Status available
Total PE 63999
Free PE 0
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk953
PV Status available
Total PE 63999
Free PE 2
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk954
PV Status available
Total PE 63999
Free PE 2
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/disk/disk955
PV Status available
Total PE 63999
Free PE 3
Current pre-allocated PE 0
Autoswitch On
Proactive Polling On

— Physical volume groups —
PVG Name pvgLP0data
PV Name /dev/disk/disk949
PV Name /dev/disk/disk950
PV Name /dev/disk/disk951
PV Name /dev/disk/disk952
PV Name /dev/disk/disk953
PV Name /dev/disk/disk954
PV Name /dev/disk/disk955

Add the disk to LVM

root@hpux:~ # pvcreate /dev/rdisk/disk670
Physical volume “/dev/rdisk/disk670” has been successfully created.

Add the disk to volume group and add the flag -g to add to PVG section

root@hpux:~ # vgextend -g pvgLP0data vgLP0data /dev/disk/disk670
Volume group “vgLP0data” has been successfully extended.
Physical volume group “pvgLP0data” has been successfully extended.
Volume Group configuration for /dev/vgLP0data has been saved in /etc/lvmconf/vgLP0data.conf

Scanning for new disk in a VMware host running Suse Linux 10 SP4

Scanning for new disk in a VMware host running Suse 10 SP4

root@linux:~ # cat /etc/*release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10
PATCHLEVEL = 4
LSB_VERSION=”core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64″

I use the following command to scan the SCSI bus

root@linux:~ # echo “- – -” > /sys/class/scsi_host/host0/scan

List the disks. It’s the last one

root@linux:~ # fdisk -l

Then I make a partition for the disk. The first time, when there is not a valid DOS partition I like to write and call fdisk again

root@linux:~ # fdisk /dev/sdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

The number of cylinders for this disk is set to 9137.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Running again and this time creating the partition

root@linux:~ # fdisk /dev/sdf

The number of cylinders for this disk is set to 9137.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-9137, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-9137, default 9137):
Using default value 9137

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Add the partition to LVM

root@linux:~ # pvcreate /dev/sdf1
Physical volume “/dev/sdf1” successfully created

Verify the file system size

root@linux:~ # df -h /usr/oradata/oradvt061t
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/softwarevg-dvt061lv
168G 133G 26G 84% /usr/oradata/oradvt061t

Add the disk to the volume group

root@linux:~ # vgextend softwarevg /dev/sdf1
Volume group “softwarevg” successfully extended

See the characteristics of the volume group

root@linux:~ # vgdisplay softwarevg
— Volume group —
VG Name softwarevg
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 11
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 4
Max PV 0
Cur PV 4
Act PV 4
VG Size 385.98 GB
PE Size 4.00 MB
Total PE 98810
Alloc PE / Size 69376 / 271.00 GB
Free PE / Size 29434 / 114.98 GB
VG UUID 0BsKwN-18al-1TT8-gctq-fRK4-ccJl-fNXL6g

And the disk added

root@dsv080:~ # pvdisplay /dev/sdf1
— Physical volume —
PV Name /dev/sdf1
VG Name softwarevg
PV Size 69.99 GB / not usable 793.00 KB
Allocatable yes
PE Size (KByte) 4096
Total PE 17918
Free PE 17918
Allocated PE 0
PV UUID 21Q3wb-2tKn-xUdP-9ZBa-tqbp-vhvS-MhSbVt

Increase the logical volume using the new disk

root@linux:~ # lvextend -l +17918 /dev/softwarevg/dvt061lv
Extending logical volume dvt061lv to 239.99 GB
Logical volume dvt061lv successfully resized

Then resize the file system

root@linux:~ # ext2online /dev/softwarevg/dvt061lv
ext2online v1.1.18 – 2001/03/18 for EXT2FS 0.5b

Verify the file system size

root@linux:~ # df -h /usr/oradata/oradvt061t
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/softwarevg-dvt061lv
237G 133G 92G 60% /usr/oradata/oradvt061t

Error: pvcreate: Device /dev/mapper/software01p1 not found

When trying to run pvcreate on a partition that exists on the system, it says that device is not found.

root@linux:/ # pvcreate /dev/mapper/software01p1
Device /dev/mapper/software01p1 not found.

The device exists on the system

root@linux:/ # ls -l /dev/mapper/software01*
brw——- 1 root root 253, 7 Jul 27 10:23 /dev/mapper/software01
brw——- 1 root root 253, 8 Jul 27 10:27 /dev/mapper/software01p1

The problem was that the LVM filter is not configured to consider it as a valid device.

Edit the file /etc/lvm/lvm.conf and edit the parameter filter accordingly. I used the filter below:

root@linux:/ # vi /etc/lvm/lvm.conf
filter = [ “a|cciss/.*|” “a|/dev/mapper/.*|”, “r|/dev/sd.*|”, “r|/dev/dm-.*|” ]

%d bloggers like this: