HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: pvmove - coding [DestinationPhysicalVolume[:PE...
Operating System - Linux
1825805
Members
2182
Online
109687
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2011 11:25 AM
06-08-2011 11:25 AM
I am moving some Logical Volumes to different LUN's but my question is simple...
Not sure of exact format for coding the [DestinationPhysicalVolume[:PE[-PE]...] on the command line...
If I am moving an extent to two or three seperate LUN's: /dev/mpath/mpath1 /dev/mpath/mpath2 and /dev/mpath/mpath3 what is the format for coding that on the command line ??
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2011 11:16 PM
06-08-2011 11:16 PM
Solution
> If I am moving an extent to two or three seperate LUN's
For LVM, one physical extent is an indivisible unit: you cannot split it to multiple destination PVs. One source extent will be moved to one destination extent, that's it.
If you want to make the LUN /dev/mpath/mpath1 empty (e.g. because it must be removed), but the mpath1 LUN is bigger than the destination LUNs, you can specify multiple destinations:
pvmove /dev/mpath/mpath1 /dev/mpath/mpath2 /dev/mpath/mpath3
This command will attempt to move all the extents away from mpath1: it will first use all the free extents on mpath2. If it is not enough, the remaining extents of mpath1 will be moved to mpath3. (Of course, mpath2 and mpath3 must already be members of the same VG for this to work at all.)
Note: the first (and only the first) PV you specify on the pvmove command line will be the source of the move operation. All the other disk devices will be (potential) destinations, to be used in order until there are no more allocated extents to move at the source.
Or you can specify no destinations at all:
pvmove /dev/mpath/mpath1
This command will attempt to make mpath1 empty by moving all the extents to any other PVs of the same VG. In this case, pvmove will grab any free extents space on the other PVs of this VG it needs to complete the move. This is the "I don't care how you do it, just make mpath1 empty so I can disconnect it, please" command.
If you want to only move a part of the contents:
pvmove /dev/mpath/mpath1:0-499 /dev/mpath/mpath2
pvmove /dev/mpath/mpath1:500-999 /dev/mpath/mpath3
These commands will move the first 500 extents of mpath1 to mpath2, and the next 500 extents to mpath3, no matter which LVs they belong to. If mpath1 contains more than 1000 extents, the remaining extents will not be moved.
Or if you want to move all of mpath1, but only use a part of mpath2's capacity and put all the rest to mpath3:
pvmove /dev/mpath/mpath1 /dev/mpath/mpath2:0-499 /dev/mpath/mpath3
This will move the first 500 extents of mpath1 to physical extents 0-499 of mpath2 (assuming that they are free; if not, the command will probably display an error message and do nothing). The rest of mpath1's contents are moved to mpath3.
If you really want to micro-manage extent allocation (for some special situation), you can even specify multiple groups of extents as either source or destination:
pvmove /dev/mpath/mpath1:0-999 /dev/mpath/mpath2:0-99:200-1999
This will move the first 1000 extents of mpath1 to mpath2, leaving a gap of 100 extents at mpath2 extents 100-199.
If you plan to move something to specific extents on the destination, you'd better be sure you know which extents are free and which are not. "pvdisplay -m" and "lvdisplay -m" will help here.
The output of "pvdisplay -m" adds to normal pvdisplay output a list of LV allocations on that PV:
--- Physical Segments ---
Physical extent 0 to 1023:
Logical volume /dev/vg0/lvol0
Logical extents 0 to 1023
Physical extent 1024 to 3071:
Logical volume /dev/vg0/lvol1
Logical extents 0 to 2047
Physical extent 3072 to 4607:
Logical volume /dev/vg0/lvol2
Logical extents 0 to 1535
Physical extent 4608 to 7102:
FREE
(If you're familiar with HP-UX, this is sort of like HP-UX "pvdisplay -v" output, only in more compact form.)
"lvdisplay -m" works in the same way.
MK
For LVM, one physical extent is an indivisible unit: you cannot split it to multiple destination PVs. One source extent will be moved to one destination extent, that's it.
If you want to make the LUN /dev/mpath/mpath1 empty (e.g. because it must be removed), but the mpath1 LUN is bigger than the destination LUNs, you can specify multiple destinations:
pvmove /dev/mpath/mpath1 /dev/mpath/mpath2 /dev/mpath/mpath3
This command will attempt to move all the extents away from mpath1: it will first use all the free extents on mpath2. If it is not enough, the remaining extents of mpath1 will be moved to mpath3. (Of course, mpath2 and mpath3 must already be members of the same VG for this to work at all.)
Note: the first (and only the first) PV you specify on the pvmove command line will be the source of the move operation. All the other disk devices will be (potential) destinations, to be used in order until there are no more allocated extents to move at the source.
Or you can specify no destinations at all:
pvmove /dev/mpath/mpath1
This command will attempt to make mpath1 empty by moving all the extents to any other PVs of the same VG. In this case, pvmove will grab any free extents space on the other PVs of this VG it needs to complete the move. This is the "I don't care how you do it, just make mpath1 empty so I can disconnect it, please" command.
If you want to only move a part of the contents:
pvmove /dev/mpath/mpath1:0-499 /dev/mpath/mpath2
pvmove /dev/mpath/mpath1:500-999 /dev/mpath/mpath3
These commands will move the first 500 extents of mpath1 to mpath2, and the next 500 extents to mpath3, no matter which LVs they belong to. If mpath1 contains more than 1000 extents, the remaining extents will not be moved.
Or if you want to move all of mpath1, but only use a part of mpath2's capacity and put all the rest to mpath3:
pvmove /dev/mpath/mpath1 /dev/mpath/mpath2:0-499 /dev/mpath/mpath3
This will move the first 500 extents of mpath1 to physical extents 0-499 of mpath2 (assuming that they are free; if not, the command will probably display an error message and do nothing). The rest of mpath1's contents are moved to mpath3.
If you really want to micro-manage extent allocation (for some special situation), you can even specify multiple groups of extents as either source or destination:
pvmove /dev/mpath/mpath1:0-999 /dev/mpath/mpath2:0-99:200-1999
This will move the first 1000 extents of mpath1 to mpath2, leaving a gap of 100 extents at mpath2 extents 100-199.
If you plan to move something to specific extents on the destination, you'd better be sure you know which extents are free and which are not. "pvdisplay -m" and "lvdisplay -m" will help here.
The output of "pvdisplay -m" adds to normal pvdisplay output a list of LV allocations on that PV:
--- Physical Segments ---
Physical extent 0 to 1023:
Logical volume /dev/vg0/lvol0
Logical extents 0 to 1023
Physical extent 1024 to 3071:
Logical volume /dev/vg0/lvol1
Logical extents 0 to 2047
Physical extent 3072 to 4607:
Logical volume /dev/vg0/lvol2
Logical extents 0 to 1535
Physical extent 4608 to 7102:
FREE
(If you're familiar with HP-UX, this is sort of like HP-UX "pvdisplay -v" output, only in more compact form.)
"lvdisplay -m" works in the same way.
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2011 04:08 AM
06-09-2011 04:08 AM
Re: pvmove - coding [DestinationPhysicalVolume[:PE[-PE]...]
Thanks for the great explaination...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP