Modify PV/VG/LV by HPUX

Source: Internet
Author: User
One of the most common PV-related parameter options is-T, which is the time (timeout value) That LVM waits for the hard disk ), the default value is 30 seconds. You can run the following command to change the timeout value to 120 seconds: # pvchange-T 120/dev/DSK/cxtxdx to remove Timeout:
# Pvchange-T 0/dev/DSK/cxtxdx
The vgvgchange command can be used to activate/not activate VG. Max_pe can only be specified when VG is created. The default number of PES is 1016. Because the default pe_size
The size is 4 MB. If max_pe is used by default, we can only use 4 GB space. These default values certainly do not meet the requirements in the era of hard disks with hundreds of GB of data. In addition
In addition to specifying a larger pe_size, max_pe can also be specified during VG creation. The default value is 1016, but the actual
LVM determines max_pe based on the actual disk size and pe_size. However, this causes another problem. For example, the hard disk we use is 36 GB, but the space is not enough,
We added another 72 GB hard disk. At this time, max_pe was fixed when creating the VG, which may lead to a waste of space. We can consider setting based on the incremental data.
The value of max_pe. The value of max_pe can be in the range of 1--65535. To modify the VG name, we can implement the following two methods: 1. create a VG with a new name and copy all the data on the existing VG with a new name.
Note: This is certainly feasible, but we often encounter two problems. One is that we may not have enough space to create a new VG. The other problem is that we copy data in this way, the time spent is also "considerable. Therefore, we tend to adopt the second, smarter way to be lazy. 2. Use vgchange for modification. The specific operations are as follows:
# Umount/dev/vg01/lvol1
# Umount/dev/vg01/lvol2
......
# Vgchange-a n/dev/vg01
# Vgexport-v-s-p-M/tmp/mapfiles/v1_1.map/dev/vg01
# Vgexport/dev/vg01
# Mkdir/dev/vgnew
# Mknod/dev/vgnew/group C 64 0 0x010000
# Vgimport-v-S-M/tmp/mapfiles/v1_1.map/dev/vgnew
# Vgcfgbackup vgnew Note: For different versions of HP-UX, install the appropriate check group file minor number patch, phco_24645 (HP-UX 11.00) or phco_25814 (HP-UX 11.11) change the LV size. For example, to change the 800 mb LV to 800 mb: # lvextend-l 800/dev/vg01/lvdata, note: Here-l 800 means to expand "to" MB, instead of expanding by 800 mb, it is still not completed. To expand the file system, you can refer to the following methods: # umount/dev/vg01/lvdata
# Extendfs-F vxfs/dev/vg01/lvdata
# Mount/dev/vg01/lvdate <mountpoint> Note: if you do not perform the preceding operations, the BDF and DF-k values may be different! The actual available size is still 500 mb. If onlinejfs exists in the system, umount: # fsadm-B <new size in KB> <mountpoint> is not required to expand the file system, it is not recommended to reduce the LV. If you want to reduce the LV, the following steps are recommended:. back up data on the original LV (fbackup or using other software, or tar to the tape drive or elsewhere)
B. Delete the original LV (lvremove)
C. Create a new LV (lvcreate)
D. generate a new file system (newfs)
E. recover the data on the original LV (restore or use other software or extract tar back). If onlinejfs exists, you can use the following methods: # lvreduce-L <new size in MB>/dev/vg01/lvdata
# Mv/dev/vg01/lvol1/dev/vg01/lvdata
# Mv/dev/vg01/rlvol1/dev/vg01/rlvdata
# Mount/dev/vg01/lvdata <mountpoint>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.