728x90

I

In this post we will be discussing about the following things.

  • 1.What is MBR partition table?
  • 2.What were the demerits of MBR partition structure?
  • 3.What is GPT Partition table?
  • 4.What are the plus points of GPT?
  • 5.What tools in Linux can be used to create GPT partition structure?

With the increasing demand for large size partitions, the partitioning and file systems are becoming more complex and advanced.

there are two mainly used disk partition styles.They are as follows.

1.MBR (Master Boot Record) partitioning style

2.GPT (GUID Partition Table)

Both the above mentioned schemes are used to identify the location of the partition on the hard disk.the type of partition used is decided when the disk is initiliazed.

the above shown diagram shows a disk initialization dialog in windows, when a new disk is added to the machine. when you initialize the disk these days you are presented with exactly the same options as shown in the above figure.

Master Boot Record (MBR) or Globally Unique Identifier Partition Table (GPT.).Previously there was only one option MBR.

MBR Partitioning style:

in this style the MBR resides in the first 512 bytes of the hard disk. This 512 bytes contains two things in MBR partitioning scheme.

  1. 440 bytes for boot loader(Grub, or windows boot loader)
  2. the remaining space is used for the partition table, ie: there can only be 4 primary partition in an MBR partitioning scheme.this remaining area also has the partition location information.

this can be done by two methods

  • CHS method: in this method a partition is located through cylinder,head,sector method. this is mentioned by a 24 bit number, in this case it can only mention disk at the max of 8gb.
  • LBA method: LBA stands for Logical Block Addressing, in this each and every sector is numbered serially resulting easy addressing of spaces upto 2TB.

Demerits of MBR partitioning scheme:

  1. it only allows four primary partitions.
  2. the workaround for creating more than four partition by making one of them extended(containing logical partitions inside that) this also leads to problems sometimes as some operating systems can only boot from Primary partitions. → Can be possible only some operating system can only boot from primary partititions.
  3. the CHS implementation in MBR partition table can lead to problems because the Cylinder,Head,Sector geometry of the disk can change.
  4. even the LBA scheme implemented puts a 2tb limitation.
  5. Logical partitions are stored in Linked List data structure over the extended partition, and can easily fail, which intern make can make some logical partitions inaccessible.

GPT Partition Style:

Now the MBR type partition table keep the partition table info such as information about the four primary partition in the first 512 bytes of the hard disk. In case of GPT the first sector is kept for "protective MBR" so that, old bios based computers can also boot from GPT partition table.

The GPT partition information starts from the second block or call it LBA 1

Note: LBA is nothing but the sectors numbered in such a way that it can be easily addressed, like LBA 0 is for MBR,LBA 1 for GPT header info etc.


LBA 0 - Protective MBR

LBA 1 - GPT Header information (GPT partition information)

LBA 2 - GPT partition array entry → 128 bytes for each partition array (1byte), which calls partition code

                                                → can reach upto 16,384 bytes. (16 byte), which calls GUID, consisting of randomly UUID


And most of the time LBA 2 contains GPT partition array entry.

the partition array entry typically reserves 128 bytes for each partition entry. Now for a disk of 512-byte sectors the partition array entry can reach upto 16,384 bytes. And in most cases the 34'th sector or call it block is the first usable sector in the disk.

Merits of GPT partition Style:

1.GPT supports up to 128 partitions so there is no need for extended of logical partitions.

2.GPT addresses 64 bit number LBA scheme, so it can address up to 8 ZiB size partitions.

3.GPT structure have primary and secondary header, so recovery is more promising that MBR

4.GPT provides 1 byte partition code, but GPT give you 16byte GUID value to uniquely identify the partition.

Tools for Creating GPT partitions:

Fdisk cannot create a GPT partition so we need to use some other tool to create it.

1.Parted can be used to create GPT partition table, and partitions of more than 2tb size.

2.Gdisk is also a nice tool to create GPT partition table.

728x90

Class 'ZipArchive' not found 에러가 발생하는 이유는 zip 모듈이 없어서이다.

phpinfo() 하여서 확인해보면 알 수 있다.

 

모듈을 설치하려면 PHP 다시 컴파일하거나 모듈만 설치하는 방법이 있다.

귀찮으니 모듈만 따로 설치하자.

Zip 모듈은 pecl 에서 다운로드 받으면 된다. 여기서 Stable 버전을 다운받는다.

http://pecl.php.net/package/zip

 

wget http://pecl.php.net/get/zip-1.10.2.tgz

압축을 해제하고

tar xvfz zip-1.10.2.tgz

cd zip-1.10.2

phpize     (혹시 phpize: command not found 라고 나오면 yum install php-devel  한후 다시 실행)

./configure --with-php-config=/usr/local/php/bin/php-config --enable-zip && make

cd modules/

ls 를 하면 zip.la  zip.so 가 보인다.

zip.so를 php 확장 디렉토리로 복사한다.

cp zip.so /usr/local/php/lib/php/extensions

php 설정파일을 열어서 zip.so 부분을 추가해준다.

vi /etc/php.ini

extension_dir="/usr/local/php/lib/php/extensions"

extension="zip.so" 를 추가.

/usr/local/apache2/bin/apachectl restart



출처: https://mara.tistory.com/327 [Absolute Purpose]

 

In CentOS 7.4 

yum install php-pecl-zip

 

728x90

Hahaha, jump directly to nginx this, the tomcat learned before, and tomcat+nginx have not said, I installed nginx, in the use of variables in the nginx configuration file, see the use of the echo command Variable output, I also wrote in my configuration file, a test, and then gave an error, a check to know that this command is a third-party module, and then began to go to Baidu how to add third-party modules, this problem is also I got I took a lot of blogs to solve it one day, and I quickly recorded it.

Tip: All operations are inrootCompleted by the user.

The first step is to download echo-nginx-module.

download link:https://github.com/openresty/echo-nginx-module/releases

In the second step, enter the command nginx -V to view the nginx version information installed by yum, and output the corresponding version number and compilation information.

Then download the tar.gz tarball for the corresponding version of nginx

download link:http://nginx.org/en/download.html

The third step is to pass the downloaded nginx and echo-nginx-module modules.Tool uploadGo to the virtual machine, then cp to /usr/local/src directory, extract

After decompression is completed, enter the decompression directory of nginx.

Before proceeding to the next step, it is best to back up your /usr/sbin/nginx

The fourth step, configuration parameters

Enter the command: ./configure --prefix=/usr/local/nginx --add-module=/usr/local/src/echo-nginx-module-0.61Then add configuration parameters later

Is the nginx -V outputconfigure argumentsAfter the addition, add to the back, the final command is as follows:

./configure --prefix=/usr/local/nginx --add-module=/usr/local/src/echo-nginx-module-0.61 --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'

The red is to be changed, this is the data on my virtual machine, the following is the error resolution, you can install the following error database before configuring the parameters, of course, if you want to solve the problem one by one until the installation Success, of course, is fine.

Error resolution

1, missing libxml2/libxslt:

  1.  
  2. ./configure: error: the HTTP XSLT module requires the libxml2/libxslt
  3.  
  4. libraries. You can either do not enable the module or install the libraries.
  5.  
  6.  
  7.  
  8. solution:
  9.  
  10. yum -y install libxml2 libxml2-dev
  11.  
  12. yum -y install libxslt-devel

2, the lack of gd-devel

  1.  
  2. ./configure: error: the HTTP image filter module requires the GD library.
  3.  
  4. You can either do not enable the module or install the libraries.
  5.  
  6.  
  7.  
  8. solution:
  9.  
  10. yum -y install gd-devel

3, the lack of ExtUtils

  1.  
  2. ./configure: error: perl module ExtUtils::Embed is required
  3.  
  4.  
  5.  
  6. solution:
  7.  
  8. yum -y install perl-devel perl-ExtUtils-Embed

4, lack of GeoIP

  1.  
  2. ./configure: error: the GeoIP module requires the GeoIP library.
  3.  
  4. You can either do not enable the module or install the library.
  5.  
  6.  
  7.  
  8. solution:
  9.  
  10. yum -y install GeoIP GeoIP-devel GeoIP-data

5, the lack of Google perftools

  1.  
  2. ./configure: error: the Google perftools module requires the Google perftools
  3.  
  4. library. You can either do not enable the module or install the library.
  5.  
  6.  
  7.  
  8. The translation is: Google perftools module needs Google perftools library, you can choose not to start or install the library
  9.  
  10. I will not enable it here, remove the --with-google_perftools_module from the parameters.

Fifth, compile

Enter: make -j2

After compiling, an nginx file will be generated in the unz directory of the nginx decompression directory. Test this file first, enter objs/nginx -t, and see the result.

The display is successful, then use this file instead of /usr/sbin/nginx this file, and then test it, it is still successful, hahaha, basically got it.

Then start nginx, if the following situation occurs, the nginx service process may be stuck, causing port 80 to be occupied.

  1.  
  2. nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
  3.  
  4. nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
  5.  
  6. nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
  7.  
  8. nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
  9.  
  10. nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
  11.  
  12. nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
  13.  
  14. nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
  15.  
  16. nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
  17.  
  18. nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
  19.  
  20. nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
  21.  
  22. nginx: [emerg] still could not bind()

Solved:

Nginx -s stop or

First check the process information: ps -aux | grep nginx and then kill the process kill process number, then restart nginx.

At this point, this third-party module is ready.

 

 

 

https://www.programmersought.com/article/8968116526/

728x90

 

If you see the following error while compiling nginx from source, follow the steps below:

1
2
3
4
5
6
checking for perl
 + perl version: This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi
Can't locate ExtUtils/Embed.pm in @INC (you may need to install the ExtUtils::Embed module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5).
BEGIN failed--compilation aborted.


./configure: error: perl module ExtUtils::Embed is required

Issue the following by command:

1 yum install perl-ExtUtils-Embed

Result:

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
[root@CentOS-82-64-minimal nginx-1.14.1]# yum install perl-ExtUtils-Embed
Last metadata expiration check: 2:06:33 ago on Wed 08 Jul 2020 06:31:28 AM CEST.
Dependencies resolved.
================================================================================
 Package                       Arch     Version               Repository   Size
================================================================================
Installing:
 perl-ExtUtils-Embed           noarch   1.34-416.el8          AppStream    79 k
Installing dependencies:
 perl-CPAN-Meta-Requirements   noarch   2.140-396.el8         AppStream    37 k
 perl-CPAN-Meta-YAML           noarch   0.018-397.el8         AppStream    34 k
 perl-ExtUtils-Command         noarch   1:7.34-1.el8          AppStream    19 k
 perl-ExtUtils-Install         noarch   2.14-4.el8            AppStream    46 k
 perl-ExtUtils-MakeMaker       noarch   1:7.34-1.el8          AppStream   300 k
 perl-ExtUtils-Manifest        noarch   1.70-395.el8          AppStream    37 k
 perl-ExtUtils-ParseXS         noarch   1:3.35-2.el8          AppStream    83 k
 perl-JSON-PP                  noarch   1:2.97.001-3.el8      AppStream    68 k
 perl-Math-BigInt              noarch   1:1.9998.11-7.el8     BaseOS      196 k
 perl-Math-Complex             noarch   1.59-416.el8          BaseOS      108 k
 perl-Test-Harness             noarch   1:3.42-1.el8          AppStream   279 k
 perl-devel                    x86_64   4:5.26.3-416.el8      AppStream   599 k
 perl-version                  x86_64   6:0.99.24-1.el8       AppStream    67 k
 python3-pyparsing             noarch   2.1.10-7.el8          BaseOS      142 k
 systemtap-sdt-devel           x86_64   4.2-6.el8             AppStream    81 k
Installing weak dependencies:
 perl-CPAN-Meta                noarch   2.150010-396.el8      AppStream   191 k
 perl-Encode-Locale            noarch   1.05-9.el8            AppStream    21 k
 perl-Time-HiRes               x86_64   1.9758-1.el8          AppStream    61 k


Transaction Summary
================================================================================
Install  19 Packages


Total download size: 2.4 M
Installed size: 7.5 M
Is this ok [y/N]: y
Downloading Packages:
(1/19): perl-CPAN-Meta-YAML-0.018-397.el8.noarc 421 kB/s |  34 kB     00:00
(2/19): perl-CPAN-Meta-Requirements-2.140-396.e 425 kB/s |  37 kB     00:00
(3/19): perl-Encode-Locale-1.05-9.el8.noarch.rp 795 kB/s |  21 kB     00:00
(4/19): perl-ExtUtils-Command-7.34-1.el8.noarch 589 kB/s |  19 kB     00:00
(5/19): perl-CPAN-Meta-2.150010-396.el8.noarch. 1.4 MB/s | 191 kB     00:00
(6/19): perl-ExtUtils-Install-2.14-4.el8.noarch 1.5 MB/s |  46 kB     00:00
(7/19): perl-ExtUtils-Embed-1.34-416.el8.noarch 1.4 MB/s |  79 kB     00:00
(8/19): perl-ExtUtils-Manifest-1.70-395.el8.noa 1.2 MB/s |  37 kB     00:00
(9/19): perl-ExtUtils-MakeMaker-7.34-1.el8.noar 5.5 MB/s | 300 kB     00:00
(10/19): perl-ExtUtils-ParseXS-3.35-2.el8.noarc 2.9 MB/s |  83 kB     00:00
(11/19): perl-JSON-PP-2.97.001-3.el8.noarch.rpm 2.2 MB/s |  68 kB     00:00
(12/19): perl-Time-HiRes-1.9758-1.el8.x86_64.rp 2.2 MB/s |  61 kB     00:00
(13/19): perl-Test-Harness-3.42-1.el8.noarch.rp 5.2 MB/s | 279 kB     00:00
(14/19): perl-version-0.99.24-1.el8.x86_64.rpm  2.4 MB/s |  67 kB     00:00
(15/19): systemtap-sdt-devel-4.2-6.el8.x86_64.r 3.0 MB/s |  81 kB     00:00
(16/19): perl-Math-BigInt-1.9998.11-7.el8.noarc 2.7 MB/s | 196 kB     00:00
(17/19): perl-devel-5.26.3-416.el8.x86_64.rpm   5.0 MB/s | 599 kB     00:00
(18/19): perl-Math-Complex-1.59-416.el8.noarch. 1.7 MB/s | 108 kB     00:00
(19/19): python3-pyparsing-2.1.10-7.el8.noarch. 9.4 MB/s | 142 kB     00:00
--------------------------------------------------------------------------------
Total                                           6.1 MB/s | 2.4 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Installing       : perl-version-6:0.99.24-1.el8.x86_64                   1/19
  Installing       : perl-CPAN-Meta-Requirements-2.140-396.el8.noarch      2/19
  Installing       : perl-Time-HiRes-1.9758-1.el8.x86_64                   3/19
  Installing       : perl-ExtUtils-ParseXS-1:3.35-2.el8.noarch             4/19
  Installing       : perl-Test-Harness-1:3.42-1.el8.noarch                 5/19
  Installing       : python3-pyparsing-2.1.10-7.el8.noarch                 6/19
  Installing       : systemtap-sdt-devel-4.2-6.el8.x86_64                  7/19
  Installing       : perl-Math-Complex-1.59-416.el8.noarch                 8/19
  Installing       : perl-Math-BigInt-1:1.9998.11-7.el8.noarch             9/19
  Installing       : perl-JSON-PP-1:2.97.001-3.el8.noarch                 10/19
  Installing       : perl-ExtUtils-Manifest-1.70-395.el8.noarch           11/19
  Installing       : perl-ExtUtils-Command-1:7.34-1.el8.noarch            12/19
  Installing       : perl-Encode-Locale-1.05-9.el8.noarch                 13/19
  Installing       : perl-CPAN-Meta-YAML-0.018-397.el8.noarch             14/19
  Installing       : perl-CPAN-Meta-2.150010-396.el8.noarch               15/19
  Installing       : perl-devel-4:5.26.3-416.el8.x86_64                   16/19
  Installing       : perl-ExtUtils-Install-2.14-4.el8.noarch              17/19
  Installing       : perl-ExtUtils-MakeMaker-1:7.34-1.el8.noarch          18/19
  Installing       : perl-ExtUtils-Embed-1.34-416.el8.noarch              19/19
  Running scriptlet: perl-ExtUtils-Embed-1.34-416.el8.noarch              19/19
  Verifying        : perl-CPAN-Meta-2.150010-396.el8.noarch                1/19
  Verifying        : perl-CPAN-Meta-Requirements-2.140-396.el8.noarch      2/19
  Verifying        : perl-CPAN-Meta-YAML-0.018-397.el8.noarch              3/19
  Verifying        : perl-Encode-Locale-1.05-9.el8.noarch                  4/19
  Verifying        : perl-ExtUtils-Command-1:7.34-1.el8.noarch             5/19
  Verifying        : perl-ExtUtils-Embed-1.34-416.el8.noarch               6/19
  Verifying        : perl-ExtUtils-Install-2.14-4.el8.noarch               7/19
  Verifying        : perl-ExtUtils-MakeMaker-1:7.34-1.el8.noarch           8/19
  Verifying        : perl-ExtUtils-Manifest-1.70-395.el8.noarch            9/19
  Verifying        : perl-ExtUtils-ParseXS-1:3.35-2.el8.noarch            10/19
  Verifying        : perl-JSON-PP-1:2.97.001-3.el8.noarch                 11/19
  Verifying        : perl-Test-Harness-1:3.42-1.el8.noarch                12/19
  Verifying        : perl-Time-HiRes-1.9758-1.el8.x86_64                  13/19
  Verifying        : perl-devel-4:5.26.3-416.el8.x86_64                   14/19
  Verifying        : perl-version-6:0.99.24-1.el8.x86_64                  15/19
  Verifying        : systemtap-sdt-devel-4.2-6.el8.x86_64                 16/19
  Verifying        : perl-Math-BigInt-1:1.9998.11-7.el8.noarch            17/19
  Verifying        : perl-Math-Complex-1.59-416.el8.noarch                18/19
  Verifying        : python3-pyparsing-2.1.10-7.el8.noarch                19/19


Installed:
  perl-CPAN-Meta-2.150010-396.el8.noarch
  perl-CPAN-Meta-Requirements-2.140-396.el8.noarch
  perl-CPAN-Meta-YAML-0.018-397.el8.noarch
  perl-Encode-Locale-1.05-9.el8.noarch
  perl-ExtUtils-Command-1:7.34-1.el8.noarch
  perl-ExtUtils-Embed-1.34-416.el8.noarch
  perl-ExtUtils-Install-2.14-4.el8.noarch
  perl-ExtUtils-MakeMaker-1:7.34-1.el8.noarch
  perl-ExtUtils-Manifest-1.70-395.el8.noarch
  perl-ExtUtils-ParseXS-1:3.35-2.el8.noarch
  perl-JSON-PP-1:2.97.001-3.el8.noarch
  perl-Math-BigInt-1:1.9998.11-7.el8.noarch
  perl-Math-Complex-1.59-416.el8.noarch
  perl-Test-Harness-1:3.42-1.el8.noarch
  perl-Time-HiRes-1.9758-1.el8.x86_64
  perl-devel-4:5.26.3-416.el8.x86_64
  perl-version-6:0.99.24-1.el8.x86_64
  python3-pyparsing-2.1.10-7.el8.noarch
  systemtap-sdt-devel-4.2-6.el8.x86_64


Complete!

done!

+ Recent posts