lvm hpux
TRANSCRIPT
-
8/12/2019 lvm Hpux
1/23
root@hpeos003[] vgexport -m /etc/lvmconf/vgora1.map -p /dev/vgora1
vgexport: Volume group "/dev/vgora1" s st ll act ve.
root@hpeos003[] cat /etc/lvmconf/vgora1.map
1 d!
str p#
3 $str pe
% &str pe
root@hpeos003[]
root@hpeos003[] str ngs /etc/lvmta!
/dev/vg00
/dev/ds'/c1t1(d0
/dev/ds'/c3t1(d0
/dev/vgora1
/dev/ds'/c0t1d0
/dev/ds'/c0t d0
/dev/ds'/c0t3d0
/dev/ds'/c%t)d0
/dev/ds'/c%t10d0
/dev/ds'/c(t1d0
/dev/ds'/c(t d0
/dev/ds'/c(t3d0
/dev/ds'/c%t11d0
root@hpeos003[]
When we want to create a mapfile for our volume group, we use the preview option *-p ) tovgexport . This does not remove the volume group from the /etc/lvmta! files. As you can see,the content of the mapf le is simple-a number followed by a name. In this way, when we import thevolume group, L ! "nows which e#tents belong to which logical volume. In the $%A is an e#tentmap for that particular dis". !ar"ed against an individual e#tent is the logical volume number to whichit belongs. In this way, when vg mport recreates the device files under the /dev/vg+ directory, it"nows &') how many device files to create and &() what to call those device files. Without a mapfile,
-
8/12/2019 lvm Hpux
2/23
vg mport would simply call the device files &and hence the logical volumes), lvol1 , lvol ,lvol3 , etc. This is not catastrophic, but it does mean that we have a bit more investigating to do towor" out which logical volume contains which information. ere I will actually remove the volumegroup from this system. &*otice that there is no entry in /etc/lvmta! , and all device files pertainingto the volume group have been deleted.) +or vgexport to wor", no filesystems, swap, or dumpdevices can be open, and the volume group must be deactivated
root@hpeos003[] vgchange -a n /dev/vgora1
Volume group "/dev/vgora1" has !een successfull# changed.
root@hpeos003[] vgexport -m /etc/lvmconf/vgora1.map -s /dev/vgora1
,h#s cal volume "/dev/ds'/c0t1d0" has !een successfull# deleted from
ph#s cal volume group ",V 0".
,h#s cal volume "/dev/ds'/c0t d0" has !een successfull# deleted from
ph#s cal volume group ",V 0".
,h#s cal volume "/dev/ds'/c0t3d0" has !een successfull# deleted from
ph#s cal volume group ",V 0".
,h#s cal volume "/dev/ds'/c%t)d0" has !een successfull# deleted from
ph#s cal volume group ",V 1".
,h#s cal volume "/dev/ds'/c%t10d0" has !een successfull# deleted from
ph#s cal volume group ",V 1".
,h#s cal volume "/dev/ds'/c%t11d0" has !een successfull# deleted from
ph#s cal volume group ",V 1".
root@hpeos003[]
root@hpeos003[] str ngs /etc/lvmta!
/dev/vg00/dev/ds'/c1t1(d0
/dev/ds'/c3t1(d0
root@hpeos003[] ll /dev/vgora1
/dev/vgora1 not found
root@hpeos003[]
-
8/12/2019 lvm Hpux
3/23
root@hpeos003[] cat /etc/lvmconf/vgora1.map
V $ 3(( 03d)3f)f!0)a
1 d!
str p#
3 $str pe
% &str pe
root@hpeos003[]
*otice that I have used the -s option on the vgexport command this time. This has stored the $Iof the volume group in the mapf le . This may be useful later when we import the volume group. I
will now import the volume group. In this instance, I will call the volume group the same name,although this is technically not necessary.
root@hpeos003[] m'd r /dev/vgora1
root@hpeos003[] m'nod /dev/vgora1/group c % 0x010000
root@hpeos003[]
root@hpeos003[] vg mport -m /etc/lvmconf/vgora1.map -s /dev/vgora1
root@hpeos003[]
root@hpeos003[] str ngs /etc/lvmta!
/dev/vg00
/dev/ds'/c1t1(d0
/dev/ds'/c3t1(d0
/dev/vgora1
/dev/ds'/c0t1d0
/dev/ds'/c0t d0
/dev/ds'/c0t3d0
/dev/ds'/c%t)d0
/dev/ds'/c%t10d0
-
8/12/2019 lvm Hpux
4/23
/dev/ds'/c%t11d0
/dev/ds'/c(t1d0
/dev/ds'/c(t d0
/dev/ds'/c(t3d0
root@hpeos003[]
root@hpeos003[] ll /dev/vgora1
total 0
!r -r----- 1 root s#s % 0x010003 2ct 30 1):1 $str pe
!r -r----- 1 root s#s % 0x01000% 2ct 30 1):1 &str pe
!r -r----- 1 root s#s % 0x010001 2ct 30 1):1 d!
cr -r -r-- 1 root s#s % 0x010000 2ct 30 1):11 group
cr -r----- 1 root s#s % 0x010003 2ct 30 1):1 r$str pe
cr -r----- 1 root s#s % 0x01000% 2ct 30 1):1 r&str pe
cr -r----- 1 root s#s % 0x010001 2ct 30 1):1 rd!
cr -r----- 1 root s#s % 0x01000 2ct 30 1):1 rstr p#
!r -r----- 1 root s#s % 0x01000 2ct 30 1):1 str p#
root@hpeos003[]
root@hpeos003[] vgchange -a # /dev/vgora1
ct vated volume group
Volume group "/dev/vgora1" has !een successfull# changed.
root@hpeos003[] vgcfg!ac'up /dev/vgora1
Volume roup conf gurat on for /dev/vgora1 has !een saved n/etc/lvmconf/vgora1.conf
root@hpeos003[]
*otice that I used the -s option with the vg mport command. This is the scan option. When wee#ported the volume group, the -s option stored the $I in the mapf le . When we imported thevolume group, vg mport scanned every dis" on the system for any dis" that reported it had the same
$I as stored in the mapf le . This scan option sounds li"e a fantastic idea. In reality, if you have alarge number of dis"s &especially +ibre hannel dis"s), then the scan option can ta"e a considerableamount of time to complete. If you decide not to use it, then you will need to list all of the dis"s
-
8/12/2019 lvm Hpux
5/23
belonging to the volume group on the command line.
root@hpeos003[] vg mport -m /etc/lvmconf/vgora1.map /dev/vgora1 /dev/ds'/c0t1d0/dev/ds'
/c0t d0 /dev/ds'/c0t3d0 /dev/ds'/c%t)d0 /dev/ds'/c%t10d0 /dev/ds'/c%t11d0/dev/ds'(t1d0
/dev/ds'/c(t d0 /dev/ds'/c(t3d0
vg mport: 4arn ng: Volume roup conta ns " " ,Vs5 ")" spec f ed. 6ont nu ng.
4arn ng: !ac'up of th s volume group ma# not ex st on th s mach ne.
,lease remem!er to ta'e a !ac'up us ng the vgcfg!ac'up command after act vat ngthe volume
group.
root@hpeos003[]
root@hpeos003[] str ngs /etc/lvmta!
/dev/vg00
/dev/ds'/c1t1(d0
/dev/ds'/c3t1(d0/dev/vgora1
/dev/ds'/c0t1d0
/dev/ds'/c0t d0
/dev/ds'/c0t3d0
/dev/ds'/c%t)d0
/dev/ds'/c%t10d0
/dev/ds'/c%t11d0
/dev/ds'/c(t1d0
/dev/ds'/c(t d0
/dev/ds'/c(t3d0
root@hpeos003[]
-
8/12/2019 lvm Hpux
6/23
root@hpeos003[] vgchange -a # /dev/vgora1
ct vated volume group
Volume group "/dev/vgora1" has !een successfull# changed.
root@hpeos003[] vgcfg!ac'up /dev/vgora1
Volume roup conf gurat on for /dev/vgora1 has !een saved n/etc/lvmconf/vgora1.conf
root@hpeos003[]
As you can see, the Warning is simply a warning/ vg mport has identified the Alternate 0 Lin"s. Ihave seen in some instances that the vg mport does not accept all of the Alternate 0 Lin" dis"slisted on the command line. In such circumstances, you may have to add them to the volume groupwith vgextend
root@hpeos003[] vgd spla# -v vgora1
--- Volume groups ---
V 7ame /dev/vgora1
V 4r te ccess read/ r te
V 8tatus ava la!le
9ax V ((
6ur V %
2pen V %
9ax ,V 1
6ur ,V
ct ,V
9ax ,; per ,V 1 %
?otal ,; 10%))%
lloc ,; 1
-
8/12/2019 lvm Hpux
7/23
ree ,; 103 )%
?otal ,V 0
?otal 8pare ,Vs 0
?otal 8pare ,Vs n use 0
--- og cal volumes ---
V 7ame /dev/vgora1/d!
V 8tatus ava la!le/s#ncd
V 8 =e *9!#tes> 1000
6urrent ; (0
llocated ,; (00
Ased ,V
V 7ame /dev/vgora1/str p#
V 8tatus ava la!le/s#ncd
V 8 =e *9!#tes> 1 00
6urrent ; 300
llocated ,; 300
Ased ,V 3
V 7ame /dev/vgora1/$str pe
V 8tatus ava la!le/s#ncd
V 8 =e *9!#tes> 1 00
6urrent ; 300
llocated ,; 00
Ased ,V
V 7ame /dev/vgora1/&str pe
V 8tatus ava la!le/s#ncd
-
8/12/2019 lvm Hpux
8/23
V 8 =e *9!#tes> 1 00
6urrent ; 300
llocated ,; 300
Ased ,V 3
--- ,h#s cal volumes ---
,V 7ame /dev/ds'/c0t1d0
,V 7ame /dev/ds'/c(t1d0 lternate n'
,V 8tatus ava la!le
?otal ,; 1
-
8/12/2019 lvm Hpux
9/23
?otal ,; 1
-
8/12/2019 lvm Hpux
10/23
-
8/12/2019 lvm Hpux
11/23
If you later reali2e what your logical volumes should be called, the simplest way to rename a logicalvolume is to rename the device files
root@hpeos003[vgora1] mv lvol1 d!
root@hpeos003[vgora1] mv rlvol1 rd!
root@hpeos003[vgora1] mv lvol str p#
root@hpeos003[vgora1] mv rlvol rstr p#
root@hpeos003[vgora1] mv lvol3 $str pe
root@hpeos003[vgora1] mv rlvol3 r$str pe
root@hpeos003[vgora1] mv lvol% &str pe
root@hpeos003[vgora1] mv rlvol% r&str pe
root@hpeos003[vgora1]
root@hpeos003[vgora1] lvd spla# /dev/vgora1/d!
--- og cal volumes ---
V 7ame /dev/vgora1/d!
V 7ame /dev/vgora1V ,erm ss on read/ r te
V 8tatus ava la!le/s#ncd
9 rror cop es 1
6ons stenc# Becover# 946
8chedule parallel
V 8 =e *9!#tes> 1000
6urrent ; (0
llocated ,; (00
8tr pes 0
8tr pe 8 =e *&!#tes> 0
Cad !loc' on
-
8/12/2019 lvm Hpux
12/23
llocat on str ct
2 ? meout *8econds> default
root@hpeos003[vgora1]
root@hpeos003[] vgexport -m /etc/lvmconf/vgora1.map -p /dev/vgora1
vgexport: Volume group "/dev/vgora1" s st ll act ve.
root@hpeos003[] cat /etc/lvmconf/vgora1.map
1 d!
str p#
3 $str pe
% &str pe
root@hpeos003[]
root@hpeos003[] str ngs /etc/lvmta!
/dev/vg00
/dev/ds'/c1t1(d0
/dev/ds'/c3t1(d0
/dev/vgora1
/dev/ds'/c0t1d0
/dev/ds'/c0t d0
/dev/ds'/c0t3d0
/dev/ds'/c%t)d0
/dev/ds'/c%t10d0
/dev/ds'/c(t1d0
/dev/ds'/c(t d0
/dev/ds'/c(t3d0
/dev/ds'/c%t11d0
root@hpeos003[]
-
8/12/2019 lvm Hpux
13/23
When we want to create a mapfile for our volume group, we use the preview option *-p ) tovgexport . This does not remove the volume group from the /etc/lvmta! files. As you can see,the content of the mapf le is simple-a number followed by a name. In this way, when we import thevolume group, L ! "nows which e#tents belong to which logical volume. In the $%A is an e#tentmap for that particular dis". !ar"ed against an individual e#tent is the logical volume number to whichit belongs. In this way, when vg mport recreates the device files under the /dev/vg+ directory, it
"nows &') how many device files to create and &() what to call those device files. Without a mapfile,vg mport would simply call the device files &and hence the logical volumes), lvol1 , lvol ,lvol3 , etc. This is not catastrophic, but it does mean that we have a bit more investigating to do towor" out which logical volume contains which information. ere I will actually remove the volumegroup from this system. &*otice that there is no entry in /etc/lvmta! , and all device files pertainingto the volume group have been deleted.) +or vgexport to wor", no filesystems, swap, or dumpdevices can be open, and the volume group must be deactivated
root@hpeos003[] vgchange -a n /dev/vgora1
Volume group "/dev/vgora1" has !een successfull# changed.
root@hpeos003[] vgexport -m /etc/lvmconf/vgora1.map -s /dev/vgora1
,h#s cal volume "/dev/ds'/c0t1d0" has !een successfull# deleted from
ph#s cal volume group ",V 0".
,h#s cal volume "/dev/ds'/c0t d0" has !een successfull# deleted from
ph#s cal volume group ",V 0".
,h#s cal volume "/dev/ds'/c0t3d0" has !een successfull# deleted from
ph#s cal volume group ",V 0".
,h#s cal volume "/dev/ds'/c%t)d0" has !een successfull# deleted from
ph#s cal volume group ",V 1".
,h#s cal volume "/dev/ds'/c%t10d0" has !een successfull# deleted from
ph#s cal volume group ",V 1".
,h#s cal volume "/dev/ds'/c%t11d0" has !een successfull# deleted from
ph#s cal volume group ",V 1".
root@hpeos003[]
root@hpeos003[] str ngs /etc/lvmta!
/dev/vg00
/dev/ds'/c1t1(d0
-
8/12/2019 lvm Hpux
14/23
/dev/ds'/c3t1(d0
root@hpeos003[] ll /dev/vgora1
/dev/vgora1 not found
root@hpeos003[]
root@hpeos003[] cat /etc/lvmconf/vgora1.map
V $ 3(( 03d)3f)f!0)a
1 d!
str p#
3 $str pe
% &str pe
root@hpeos003[]
*otice that I have used the -s option on the vgexport command this time. This has stored the $Iof the volume group in the mapf le . This may be useful later when we import the volume group. Iwill now import the volume group. In this instance, I will call the volume group the same name,although this is technically not necessary.
root@hpeos003[] m'd r /dev/vgora1
root@hpeos003[] m'nod /dev/vgora1/group c % 0x010000
root@hpeos003[]
root@hpeos003[] vg mport -m /etc/lvmconf/vgora1.map -s /dev/vgora1
root@hpeos003[]
root@hpeos003[] str ngs /etc/lvmta!
/dev/vg00
/dev/ds'/c1t1(d0
/dev/ds'/c3t1(d0
/dev/vgora1
/dev/ds'/c0t1d0
-
8/12/2019 lvm Hpux
15/23
/dev/ds'/c0t d0
/dev/ds'/c0t3d0
/dev/ds'/c%t)d0
/dev/ds'/c%t10d0
/dev/ds'/c%t11d0
/dev/ds'/c(t1d0
/dev/ds'/c(t d0
/dev/ds'/c(t3d0
root@hpeos003[]
root@hpeos003[] ll /dev/vgora1
total 0
!r -r----- 1 root s#s % 0x010003 2ct 30 1):1 $str pe
!r -r----- 1 root s#s % 0x01000% 2ct 30 1):1 &str pe
!r -r----- 1 root s#s % 0x010001 2ct 30 1):1 d!
cr -r -r-- 1 root s#s % 0x010000 2ct 30 1):11 group
cr -r----- 1 root s#s % 0x010003 2ct 30 1):1 r$str pe
cr -r----- 1 root s#s % 0x01000% 2ct 30 1):1 r&str pe
cr -r----- 1 root s#s % 0x010001 2ct 30 1):1 rd!
cr -r----- 1 root s#s % 0x01000 2ct 30 1):1 rstr p#
!r -r----- 1 root s#s % 0x01000 2ct 30 1):1 str p#
root@hpeos003[]
root@hpeos003[] vgchange -a # /dev/vgora1
ct vated volume group
Volume group "/dev/vgora1" has !een successfull# changed.
root@hpeos003[] vgcfg!ac'up /dev/vgora1
Volume roup conf gurat on for /dev/vgora1 has !een saved n/etc/lvmconf/vgora1.conf
root@hpeos003[]
-
8/12/2019 lvm Hpux
16/23
*otice that I used the -s option with the vg mport command. This is the scan option. When wee#ported the volume group, the -s option stored the $I in the mapf le . When we imported thevolume group, vg mport scanned every dis" on the system for any dis" that reported it had the same
$I as stored in the mapf le . This scan option sounds li"e a fantastic idea. In reality, if you have alarge number of dis"s &especially +ibre hannel dis"s), then the scan option can ta"e a considerableamount of time to complete. If you decide not to use it, then you will need to list all of the dis"s
belonging to the volume group on the command line.
root@hpeos003[] vg mport -m /etc/lvmconf/vgora1.map /dev/vgora1 /dev/ds'/c0t1d0/dev/ds'
/c0t d0 /dev/ds'/c0t3d0 /dev/ds'/c%t)d0 /dev/ds'/c%t10d0 /dev/ds'/c%t11d0/dev/ds'(t1d0
/dev/ds'/c(t d0 /dev/ds'/c(t3d0
vg mport: 4arn ng: Volume roup conta ns " " ,Vs5 ")" spec f ed. 6ont nu ng.
4arn ng: !ac'up of th s volume group ma# not ex st on th s mach ne.
,lease remem!er to ta'e a !ac'up us ng the vgcfg!ac'up command after act vat ngthe volume
group.
root@hpeos003[]
root@hpeos003[] str ngs /etc/lvmta!
/dev/vg00
/dev/ds'/c1t1(d0
/dev/ds'/c3t1(d0
/dev/vgora1
/dev/ds'/c0t1d0
/dev/ds'/c0t d0/dev/ds'/c0t3d0
/dev/ds'/c%t)d0
/dev/ds'/c%t10d0
/dev/ds'/c%t11d0
/dev/ds'/c(t1d0
-
8/12/2019 lvm Hpux
17/23
/dev/ds'/c(t d0
/dev/ds'/c(t3d0
root@hpeos003[]
root@hpeos003[] vgchange -a # /dev/vgora1
ct vated volume group
Volume group "/dev/vgora1" has !een successfull# changed.
root@hpeos003[] vgcfg!ac'up /dev/vgora1
Volume roup conf gurat on for /dev/vgora1 has !een saved n/etc/lvmconf/vgora1.conf
root@hpeos003[]
As you can see, the Warning is simply a warning/ vg mport has identified the Alternate 0 Lin"s. Ihave seen in some instances that the vg mport does not accept all of the Alternate 0 Lin" dis"slisted on the command line. In such circumstances, you may have to add them to the volume groupwith vgextend
root@hpeos003[] vgd spla# -v vgora1
--- Volume groups ---
V 7ame /dev/vgora1
V 4r te ccess read/ r te
V 8tatus ava la!le
9ax V ((
6ur V %
2pen V %
9ax ,V 1
6ur ,V
ct ,V
9ax ,; per ,V 1
-
8/12/2019 lvm Hpux
18/23
,; 8 =e *9!#tes> %
?otal ,; 10%))%
lloc ,; 1 1000
6urrent ; (0
llocated ,; (00
Ased ,V
V 7ame /dev/vgora1/str p#
V 8tatus ava la!le/s#ncd
V 8 =e *9!#tes> 1 00
6urrent ; 300
llocated ,; 300
Ased ,V 3
V 7ame /dev/vgora1/$str pe
V 8tatus ava la!le/s#ncd
V 8 =e *9!#tes> 1 00
6urrent ; 300
llocated ,; 00
Ased ,V
-
8/12/2019 lvm Hpux
19/23
V 7ame /dev/vgora1/&str pe
V 8tatus ava la!le/s#ncd
V 8 =e *9!#tes> 1 00
6urrent ; 300
llocated ,; 300
Ased ,V 3
--- ,h#s cal volumes ---
,V 7ame /dev/ds'/c0t1d0
,V 7ame /dev/ds'/c(t1d0 lternate n'
,V 8tatus ava la!le
?otal ,; 1
-
8/12/2019 lvm Hpux
20/23
,V 7ame /dev/ds'/c%t)d0
,V 8tatus ava la!le
?otal ,; 1
-
8/12/2019 lvm Hpux
21/23
/dev/vgora1
root@hpeos003[vgora1] ll
total 0
cr -r -r-- 1 root s#s % 0x010000 2ct 30 1): 3 group
!r -r----- 1 root s#s % 0x010001 2ct 30 1): 3 lvol1
!r -r----- 1 root s#s % 0x01000 2ct 30 1): 3 lvol
!r -r----- 1 root s#s % 0x010003 2ct 30 1): 3 lvol3
!r -r----- 1 root s#s % 0x01000% 2ct 30 1): 3 lvol%
cr -r----- 1 root s#s % 0x010001 2ct 30 1): 3 rlvol1
cr -r----- 1 root s#s % 0x01000 2ct 30 1): 3 rlvol
cr -r----- 1 root s#s % 0x010003 2ct 30 1): 3 rlvol3
cr -r----- 1 root s#s % 0x01000% 2ct 30 1): 3 rlvol%
root@hpeos003[vgora1]
root@hpeos003[vgora1] lvd spla# /dev/vgora1/lvol1
--- og cal volumes ---
V 7ame /dev/vgora1/lvol1
V 7ame /dev/vgora1
V ,erm ss on read/ r te
V 8tatus ava la!le/s#ncd
9 rror cop es 1
6ons stenc# Becover# 946
8chedule parallel
V 8 =e *9!#tes> 1000
6urrent ; (0
llocated ,; (00
8tr pes 0
8tr pe 8 =e *&!#tes> 0
Cad !loc' on
llocat on str ct
-
8/12/2019 lvm Hpux
22/23
2 ? meout *8econds> default
root@hpeos003[vgora1]
If you later reali2e what your logical volumes should be called, the simplest way to rename a logicalvolume is to rename the device files
root@hpeos003[vgora1] mv lvol1 d!
root@hpeos003[vgora1] mv rlvol1 rd!
root@hpeos003[vgora1] mv lvol str p#
root@hpeos003[vgora1] mv rlvol rstr p#
root@hpeos003[vgora1] mv lvol3 $str pe
root@hpeos003[vgora1] mv rlvol3 r$str pe
root@hpeos003[vgora1] mv lvol% &str pe
root@hpeos003[vgora1] mv rlvol% r&str pe
root@hpeos003[vgora1]
root@hpeos003[vgora1] lvd spla# /dev/vgora1/d!
--- og cal volumes ---
V 7ame /dev/vgora1/d!
V 7ame /dev/vgora1
V ,erm ss on read/ r te
V 8tatus ava la!le/s#ncd
9 rror cop es 1
6ons stenc# Becover# 946
8chedule parallel
V 8 =e *9!#tes> 1000
6urrent ; (0
-
8/12/2019 lvm Hpux
23/23
llocated ,; (00
8tr pes 0
8tr pe 8 =e *&!#tes> 0
Cad !loc' on
llocat on str ct
2 ? meout *8econds> default
root@hpeos003[vgora1]