Trouble removing Physical Disk from Volume Group

Tags
aix, disk, group, physical, volume

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 1 Week Ago
Trouble removing Physical Disk from Volume Group

I want to remove hdisk1 from volume group diskpool_4 and migrate PV from hdisk1 to hdisk2 , but facing problems, so what is the quickest way to migratepv and remove hdisk1 --

Code:
# lspv | grep diskpool_4
hdisk1          00c7780e2e21ec86                    diskpool_4      active
hdisk2          00c7780ea5bd16bb                    diskpool_4      active

# lsvg -l diskpool_4
diskpool_4:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
clodba              jfs        720     1440    2    open/stale    N/A


# lsvg diskpool_4
VOLUME GROUP:       diskpool_4               VG IDENTIFIER:  00c7780e00004c000000013c210bf284
VG STATE:           active                   PP SIZE:        256 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      2234 (571904 megabytes)
MAX LVs:            1024                     FREE PPs:       794 (203264 megabytes)
LVs:                1                        USED PPs:       1440 (368640 megabytes)
OPEN LVs:           1                        QUORUM:         2 (Enabled)
TOTAL PVs:          2                        VG DESCRIPTORS: 3
STALE PVs:          1                        STALE PPs:      1
ACTIVE PVs:         2                        AUTO ON:        yes
MAX PPs per VG:     1048576                  MAX PVs:        1024
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable
MIRROR POOL STRICT: off
PV RESTRICTION:     none                     INFINITE RETRY: no
DISK BLOCK SIZE:    512                      CRITICAL VG:    no
#

# lsvg -p diskpool_4
diskpool_4:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk2            active            1117        396         224..79..00..00..93
hdisk1            active            1117        398         184..00..01..00..213

#  lspv -l hdisk1
hdisk1:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
clodba                719     719     40..223..222..223..11 N/A
# lspv -l hdisk2
hdisk2:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
clodba                720     721     00..144..223..223..131 N/A


# migratepv -l clodba hdisk1 hdisk2
0516-076 lmigratelv: Cannot remove last good copy of stale partition.
        Resynchronize the partitions with syncvg and try again.
0516-812 migratepv: Warning, migratepv did not completely succeed;
        all physical partitions have not been moved off the PV.

# syncvg -v diskpool_4
0516-1296 lresynclv: Unable to completely resynchronize volume.
        The logical volume has bad-block relocation policy turned off.
        This may have caused the command to fail.
0516-934 /etc/syncvg: Unable to synchronize logical volume clodba.
0516-932 /etc/syncvg: Unable to synchronize volume group diskpool_4.

Check the copies of LV
Code:
# lslv -m clodba
clodba:N/A
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0225 hdisk1            0305 hdisk2
0002  0226 hdisk1            0306 hdisk2
0003  0227 hdisk1            0307 hdisk2
0004  0228 hdisk1            0308 hdisk2
.......................................................
......................................................
.....................................................

REMOVE COPY from hdisk2

# rmlvcopy clodba 1 hdisk2


# lslv -m clodba
clodba:N/A
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0225 hdisk1
0002  0226 hdisk1
.....................................
...............................
..................................

MigratePV from hdisk1 to hdisk2

Code:
migratepv -l clodba hdisk1 hdisk2


Last edited by filosophizer; 1 Week Ago at 07:20 AM..
# 2  
Old 1 Week Ago
First, before anything else, backup your data and make sure it is recoverable in a usable way.
Two tested copies at least.


Looking at this part ....
Code:
#  lspv -l hdisk1
hdisk1:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
clodba                719     719     40..223..222..223..11 N/A
# lspv -l hdisk2
hdisk2:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
clodba                720     721     00..144..223..223..131 N/A

.... suggests the logical volume is mirrored (as suggested) but you must have (at least) one LP that map to PPs that are both on hdisk2. That's a bit of a problem to the point that it's probably not worth mirroring. Lose hdisk2 and you lose logical volume integrity, the filesystem and data. It may be recoverable as far as the filesystem goes, but the data loss is unpredictable.

You may be able to turn on relocation with a chlv or a chvg -b ....command and force the re-sync. What does the full output of lslv -m clodba give you? Sadly it will be quite long given the number of LPs. You will probably see that copy 1 is entirely on hdisk1 except for one PP. You might manage to force the removal of the PPs from hdisk1 with rmlvcopy clodba 1 hdisk1 and if that works, you will have hdisk1 empty (check lspv -l hdisk1) and hdisk2 should be reduced to just 720 PPs in use.

For the future I would consider setting the volume group mirror pool strictness (is that the -M flag?) to force PPs for each LP to be on separate PVs and even to keep LV copies from being mixed across volumes. Personally, I'm more anorak than that and force the creation/extention to use the PPs I set, but that's just me.


Does that help?
Robin
This User Gave Thanks to rbatte1 For This Post:
filosophizer (1 Week Ago)
# 3  
Old 1 Week Ago
Thanks Rbatte1

Still struggling:

Let continue from here:

Code:
REMOVE COPY from hdisk2

# rmlvcopy clodba 1 hdisk2


# lslv -m clodba
clodba:N/A
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0225 hdisk1
0002  0226 hdisk1
.....................................
...............................
..................................







# migratepv -l clodba hdisk1 hdisk2

Resulted in error

Code:
# migratepv -l clodba hdisk1 hdisk2
0516-076 lmigratelv: Cannot remove last good copy of stale partition.
        Resynchronize the partitions with syncvg and try again.
0516-812 migratepv: Warning, migratepv did not completely succeed;
        all physical partitions have not been moved off the PV.

Checking again

Code:



# lsvg -l diskpool_4
diskpool_4:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
0516-1147 : Warning - logical volume clodba may be partially mirrored.
clodba              jfs        720     1439    3    open/stale    N/A

# lsvg -p diskpool_4
diskpool_4:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk2            active            1117        397         224..00..00..00..173
hdisk1            active            1117        398         184..00..01..00..213

# lspv -l hdisk1
hdisk1:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
clodba                719     719     40..223..222..223..11 N/A

# lspv -l hdisk2
hdisk2:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
clodba                720     720     00..223..223..223..51 N/A




# syncvg -v diskpool_4
0516-1296 lresynclv: Unable to completely resynchronize volume.
        The logical volume has bad-block relocation policy turned off.
        This may have caused the command to fail.
0516-934 /etc/syncvg: Unable to synchronize logical volume clodba.
0516-932 /etc/syncvg: Unable to synchronize volume group diskpool_4.


# chlv -b y clodba
0516-012 lchangelv: Logical volume must be closed.  If the logical
        volume contains a filesystem, the umount command will close
        the LV device.
0516-704 chlv: Unable to change logical volume clodba.
#

and then

Code:
# rmlvcopy clodba 1 hdisk1
0516-1939 lquerypv: PV identifier not found in VGDA.
0516-304 getlvodm: Unable to find device id 0000000000000000 in the Device
        Configuration Database.
0516-848 rmlvcopy: Failure on physical volume 0000000000000000, it may be missing
        or removed.

# lspv
hdisk0          00c7780e79838606                    rootvg          active
hdisk1          00c7780e2e21ec86                    diskpool_4      active
hdisk2          00c7780ea5bd16bb                    diskpool_4      active


Last edited by filosophizer; 1 Week Ago at 03:58 PM..
Login to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Similar Threads More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Exporting physical disk to ldom or ZFS volume psychocandy Solaris 4 04-27-2018 05:53 AM
No space in volume group. How to create a file system using existing logical volume vamshigvk475 Red Hat 2 10-08-2015 10:23 AM
Removing a VxVM disk from a Disk Group mrkejames2 HP-UX 0 02-23-2015 05:20 PM
Logical Volume to physical disk mapping jimthompson Linux 2 01-10-2014 01:44 PM
How to create a volume group, logical volume group and file system? kamaldev UNIX for Dummies Questions & Answers 2 02-14-2013 09:57 AM
Position of the logical volume on the physical volume adilyos AIX 11 01-17-2013 03:53 PM
Removing LVM Volume Group that doesn't exist anymore thmnetwork Red Hat 7 12-04-2012 04:43 PM
Need to create an for loop for adding an disk in veritas volume group. indrajit_preet Shell Programming and Scripting 3 08-06-2012 02:26 AM
Confusion Regarding Physical Volume,Volume Group,Logical Volume,Physical partition kashifsd17 UNIX for Dummies Questions & Answers 6 07-06-2012 05:19 PM
Unmount and remove all Logical vol.Volume group and physical disk joeli HP-UX 3 01-27-2009 10:59 AM
Basic Filesystem / Physical Volume / Logical Volume Check chipahoys AIX 1 12-02-2008 08:05 AM
Physical volume- no free physical partitions markper UNIX for Dummies Questions & Answers 9 01-09-2007 02:00 PM
Volume Group disk dead mlcboy01 AIX 1 01-14-2005 02:45 AM
physical volume and physical disk. VeroL UNIX for Dummies Questions & Answers 2 01-22-2004 10:32 AM
Having problems with removing a volume group.. dilshik AIX 5 01-09-2004 09:26 AM
All times are GMT -4. The time now is 11:10 AM.

Unix & Linux Forums Content Copyright 1993-2018. All Rights Reserved.