摘要
今天给一台服务器装系统后发现忘记自动VG name和LV的name,于是就在装好的系统上面做lv名字修改了,强迫症就是这样的表现吧。。。
收集必要信息
[root@ns3723990
/data
]
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda4
DTVG lvm2 a-- 5.35t 0
/dev/sdb1
DTVG lvm2 a-- 5.46t 0
/dev/sdc1
DTVG lvm2 a-- 5.46t 0
/dev/sdd1
DTVG lvm2 a-- 5.46t 0
/dev/sde1
DTVG lvm2 a-- 5.46t 1.83t
[root@ns3723990
/data
]
# vgs -v
VG Attr Ext
#PV #LV #SN VSize VFree VG UUID VProfile
DTVG wz--n- 4.00m 5 1 0 27.18t 1.83t KBJwfa-GO0R-rjWS-Vrfs-rss3-dGVk-XpV7Q5
[root@ns3723990
/data
]
# lvs -v
LV VG
#Seg Attr LSize Maj Min KMaj KMin Pool Origin Data% Meta% Move Cpy%Sync Log Convert LV UUID LProfile
data DTVG 5 -wi-ao---- 25.35t -1 -1 251 0 ehGOzZ-CwWx-o72d-OlJU-JLyO-5uaZ-tBjyIO
[root@ns3723990
/data
]
#
|
开始修改VG名字
[root@ns3723990
/data
]
# vgrename KBJwfa-GO0R-rjWS-Vrfs-rss3-dGVk-XpV7Q5 LookBackVG
Processing VG DTVG because of matching UUID KBJwfa-GO0R-rjWS-Vrfs-rss3-dGVk-XpV7Q5
Volume group
"KBJwfa-GO0R-rjWS-Vrfs-rss3-dGVk-XpV7Q5"
successfully renamed to
"LookBackVG"
[root@ns3723990
/data
]
# lvscan
ACTIVE
'/dev/LookBackVG/data'
[25.35 TiB] inherit
[root@ns3723990
/data
]
# lvchange -ay /dev/LookBackVG/data
[root@ns3723990
/data
]
# lvscan
ACTIVE
'/dev/LookBackVG/data'
[25.35 TiB] inherit
[root@ns3723990
/data
]
#
|
开始修改LV名字
[root@ns3723990
/data
]
# lvrename /dev/LookBackVG/data datadir
Renamed
"data"
to
"datadir"
in
volume group
"LookBackVG"
[root@ns3723990
/data
]
# lvscan
ACTIVE
'/dev/LookBackVG/datadir'
[25.35 TiB] inherit
[root@ns3723990
/data
]
#
|
最后不要忘记修改fstab挂载配置文件