public ZipArchive::setCompressionName(string $name, int $method, int $compflags = 0): bool
name
Name of the entry.
method
The compression method, one of the ZipArchive::CM_* constants.
compflags
Compression level.
Returns true on success or false on failure.
The compression level (compflags) option is, generally speaking, an integer value between 0 and 9. The behavior of the system depends on the selected method and the value of compflags and can sometimes be not you expected.
The result below is from PHP 8.1 on Windows platform and may possibly be different on other systems or versions:
for the CM_DEFAULT method, always CM_DEFLATE is used with level 9, regardless of what you put as compflags,
for the CM_STORE method, for compflags 0-9 you get the same result, which is obvious because the method itself means “no compression at all”. However, for compflags>9, surprisingly the CM_DEFLATE method is used instead with compression level 9.
for CM_DEFLATE method, 1 means the fastest and weakest compression, while 9 - the slowest and strongest one. compflags=0 and compflags>9 works as it if were with compflags=9,
for CM_BZIP2 method, 1 means the fastest and weakest compression, while 9 - the slowest and strongest one. compflags=0 works like compflag=9, and if you use compflags>9, the method will surprisingly switch to CM_DEFLATE level 9,
for CM_XZ method, 0 means the fastest and weakest compression, while 9 - the slowest and strongest one. For compflags>9 the method surprisingly switch to CM_DEFLATE level 9.
[root@Node1 ~]# fdisk /dev/sdb //对/dev/sdb进行分区
Welcome to fdisk (util-linux 2.23.2)
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xafcc8a41.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p //主分区
Partition number (1-4, default 1): 1
First sector (2048-41943039, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +10G
Partition 1 of type Linux and of size 10 GiB is set
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (2-4, default 2): 2
First sector (20973568-41943039, default 20973568):
Using default value 20973568
Last sector, +sectors or +size{K,M,G} (20973568-41943039, default 41943039):
Using default value 41943039
Partition 2 of type Linux and of size 10 GiB is set
Command (m for help): t
Partition number (1,2, default 2): 2
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@Node1 ~]# fdisk -l | grep "LVM$"
/dev/sdb1 2048 20973567 10485760 8e Linux LVM
/dev/sdb2 20973568 41943039 10484736 8e Linux LVM
/dev/sdc5 4096 41947135 20971520 8e Linux LVM
/dev/sdc6 41949184 62914559 10482688 8e Linux LVM
lv_all - All fields in this section.
lv_uuid - Unique identifier.
lv_name - Name. LVs created for internal use are enclosed in brackets.
lv_path - Full pathname for LV.
lv_attr - Various attributes - see man page.
lv_major - Persistent major number or -1 if not persistent.
lv_minor - Persistent minor number or -1 if not persistent.
lv_read_ahead - Read ahead setting in current units.
lv_kernel_major - Currently assigned major number or -1 if LV is not active.
lv_kernel_minor - Currently assigned minor number or -1 if LV is not active.
lv_kernel_read_ahead - Currently-in-use read ahead setting in current units.
lv_size - Size of LV in current units.
seg_count - Number of segments in LV.
origin - For snapshots, the origin device of this LV.
origin_size - For snapshots, the size of the origin device of this LV.
snap_percent - For snapshots, the percentage full if LV is active.
copy_percent - For mirrors and pvmove, current percentage in-sync.
move_pv - For pvmove, Source PV of temporary LV created by pvmove.
convert_lv - For lvconvert, Name of temporary LV created by lvconvert.
lv_tags - Tags, if any.
mirror_log - For mirrors, the LV holding the synchronisation log.
modules - Kernel device-mapper modules required for this LV.
4.2 pvs 字段
1234567891011
pv_all - All fields in this section.
pe_start - Offset to the start of data on the underlying device.
pv_size - Size of PV in current units.
pv_free - Total amount of unallocated space in current units.
pv_used - Total amount of allocated space in current units.
pv_attr - Various attributes - see man page.
pv_pe_count - Total number of Physical Extents.
pv_pe_alloc_count - Total number of allocated Physical Extents.
pv_tags - Tags, if any.
pv_mda_count - Number of metadata areas on this device.
pv_mda_used_count - Number of metadata areas in use on this device.
4.3 vgs 字段
1234567891011121314151617181920212223
vg_all - All fields in this section.
vg_fmt - Type of metadata.
vg_uuid - Unique identifier.
vg_name - Name.
vg_attr - Various attributes - see man page.
vg_size - Total size of VG in current units.
vg_free - Total amount of free space in current units.
vg_sysid - System ID indicating when and where it was created.
vg_extent_size - Size of Physical Extents in current units.
vg_extent_count - Total number of Physical Extents.
vg_free_count - Total number of unallocated Physical Extents.
max_lv - Maximum number of LVs allowed in VG or 0 if unlimited.
max_pv - Maximum number of PVs allowed in VG or 0 if unlimited.
pv_count - Number of PVs.
lv_count - Number of LVs.
snap_count - Number of snapshots.
vg_seqno - Revision number of internal metadata. Incremented whenever it changes.
vg_tags - Tags, if any.
vg_mda_count - Number of metadata areas on this VG.
vg_mda_used_count - Number of metadata areas in use on this VG.
vg_mda_free - Free metadata area space for this VG in current units.
vg_mda_size - Size of smallest metadata area for this VG in current units.
vg_mda_copies - Target number of in use metadata areas in the VG.