HP-UNIX 11i learning notes

zhaozj2021-02-16  79

Physical Volume, called PV: refers to a physical hard disk, a hard disk is a PV logical volume group Logical Volume Group, called VG: A VG contains an integer PV, which is understood as a big hard disk. Logical Volume Logical Volume, called LV: equivalent to a logical partition for a large hard drive, a VG can have several LVs. File System File System: On the basis of logical volume, you can create a file system, then mount to a directory so that you can use this hard drive in a manner. Of course, you may also do not build a file system, and directly use Naked devices, access data in Trunk mode, and many databases use this way to access data. According to the above description, the order and the corresponding commands of the hard disk under HPUX are as follows: About device files Query #ioscan -func disk list all Disk Devices and Device Files 1. First build physical volume: # pvcreate -f / dev / rdsk / CCDDTT This must use the hard disk character device files in the CCDDTTTTTT:, for example, C0T6D0, etc., can be used in the HP to see the hard disk character device file EXM: # pvcreate -f / dev / rdsk / c0t6d0 2. Re-establish the logical volume group: # MKDIR / DEV / VG0X EXM: MKDIR / DEV / VG01 # MKNOD / DEV / VG0X / Group C 64 0x0x0000 Exam: MKNOD / DEV / VG01 / GROUP C 64 0x020000 # vgcreate VG0X / DEV / DSK / CCDTTTTEV / DEV / DSK / CCDTTT EXAM: VGCReate / Dev / VG01 / DEV / DSK / C06D0 3. Then divided the logical volume: # lvcreate -l size vg0x size: This logical volume size Exam: # lvcreate -l 200 -n lv01 / dev / vg01 4. Built the file system in the LV: # Newfs -f file_system_type / dev / vg0x / rlvoly file_system_type: File system type, including HFS and VXFS, pay attention to this logical volume character device file. Exam: # newfs -f hfs / dev / vg01 / rlv01 5. Will this file system mount to a directory: # mkdir / directory # mount / dev / vg0x / lvoly / directory Exam: #mkdir / data # mount / dev / VG01 / LV01 / DATA is here so that you can use this hard drive. Sometimes you may add, delete logical volumes, or need to expand file systems in an existing environment. We can do this: 6. Add logical volume 1) Add file system volume. For example, add a 200M file system volume on VG01, volume is Named Data, Mount to Directory / SAMPLE.

A, create a logical volume, type command at the system prompt: # lvcreate -l 200 -n data / dev / vg01 b, create a file system on logical volume DATA: # newfs -f hfs / dev / vg01 / rdata Note: If you are a VXFS file system, use # newfs -f vxfs / dev / vg01 / rdata c, create directory / sample, and logic volume data mount to / sample. # Mkdir sample "# mount / dev / vg01 / data / sample D. Use the BDF command to see / dev / vg01 / data mount to / sample. 2) Add non-file system volume (Raw Data Volume). Create a logical volume, type the logical volume, type it in the system prompt Command: # lvcreate -l 200 -n data / dev / vg01 b, create directory / sample, and will logic Data Mount to / sample. # Mkdir sample # mount / dev / vg01 / data / sample c, with bdf commands, You will see / dev / vg01 / data mount to / sample. 7. Delete logical volume, such as: Delete the logical volume of the VG01 named DATA, MOUNT to / SAMPLE. 1) Uninstall the logical volume you want to delete: A, first Use the umount command to unload the logical volume data from / sample from / sample: # umount / sample b, if the system prompts the device is busy, you cannot uninstall; then in the root system prompt, type the following command, enter the single user: # Shutdown -y 0 Under the single user, first on the Mount, type commands: # mount -a Use the bdf command to see if the logical volume is already mount, if you type, type the following command: # umount / sample 2) Delete logical volume / DEV / VG01 / DATA, with command: # lvremove / dev / vg01 / data 8. Expand file system 1) Expand file system, first find the logical volume corresponding to this file system, only first expand the logical volume, to the file system With the expanded space, the file system can be expanded. 2) To expand the logical volume, advanced single user, in the root system prompt, type command: # shutdown -y 0 3) After entering the single user, first put all file system Mount first On, type the command: # mount -a 4) Use the bdf command to see if the file system is already mount, if mount, with the command #umount file system name Umount this file system. For example, if you want to expand "/ usr" to 500m, type command: # umount / usr 5) Use commands: # LVEXTEND -L 500 / dev / vg00 / lvol4 here, assume / usr correspondence / dev / vg00 / lvol4 6) Use commands: # extendFS / DEV / VG00 / LVOL4 to expand the file system.

Note: If it is a VXFS file system, use the # extendFS -F VXFS / DEV / VG00 / LVOL4 7) Use the command: # mount / dev / vg00 / lvol4 / usr, file system mount to / usr, file system "/ usr "It is expanded, 8) Use the command: # init 3 to enter the original multi-user run level. 9. UNIX file system UNIX file system is a tree structure, which is generally referred to as a collection of files on a logical volume. From the root start, from the surface, the file system seems to be a whole, but in fact, the file system can be divided into different parts, accounting for a logical volume separately, is a file system. 10. Add new hard drive 1. Pvcreate / dev / rdsk / cxTydz 2. VGEXTEND / DEV / VGXX / DEV / DSK / CXTYDZ 3. lvcreate -n name / dev / vgxx 4. LVEXTEND -L 200 / DEV / VGXX / NAME / dev / dsk / cxtydz vgextend / dev / vg01 /dev/dsk/c0t6d0http://www.cnoug.org/viewthread.php?tid=260&highlight=+lunar

转载请注明原文地址:https://www.9cbs.com/read-14316.html

New Post(0)