Cloude Devops Logo Free Clss Will start on Devops from July 15th
Cloud DevOps
Cloud DevOps




Wecome To Linux



How to Create Swap Partition on Linux

Centos 7 Partitions

Disk Usage df -H

Filesystem                        Size  Used Avail Use% Mounted on
/dev/mapper/centos-root           8.4G   76M  8.4G   1% /
devtmpfs                          4.1G     0  4.1G   0% /dev
tmpfs                             4.1G  672k  4.1G   1% /dev/shm
tmpfs                             4.1G  9.5M  4.1G   1% /run
tmpfs                             4.1G     0  4.1G   0% /sys/fs/cgroup
/dev/mapper/centos-usr             13G  4.5G  8.2G  36% /usr
/dev/sdb2                         521M  124M  397M  24% /boot
/dev/sdb1                         210M   10M  200M   5% /boot/efi
/dev/mapper/centos-tmp            8.4G  101M  8.3G   2% /tmp
/dev/mapper/centos-opt            4.2G  222M  4.0G   6% /opt
/dev/mapper/centos-var            8.4G  650M  7.8G   8% /var
/dev/mapper/centos-usr_local      4.2G   34M  4.2G   1% /usr/local
/dev/mapper/centos-home           418G  728M  418G   1% /home
/dev/mapper/centos-var_log        8.4G   40M  8.4G   1% /var/log
/dev/mapper/centos-var_ftp         17G   34M   17G   1% /var/ftp
/dev/mapper/centos-var_tmp        8.4G  221M  8.2G   3% /var/tmp
/dev/mapper/centos-var_www         17G   34M   17G   1% /var/www
/dev/mapper/centos-var_log_audit  4.2G   41M  4.2G   1% /var/log/audit

Partitions ssm list

-------------------------------------------------------------
Device        Free       Used      Total  Pool    Mount point
-------------------------------------------------------------
/dev/sda                       465.76 GB          PARTITIONED
/dev/sda1  0.00 KB  465.76 GB  465.76 GB  centos             
/dev/sdb                        29.82 GB                     
/dev/sdb1                      200.00 MB          /boot/efi  
/dev/sdb2                      500.00 MB          /boot      
/dev/sdb3  0.00 KB   29.13 GB   29.13 GB  centos             
-------------------------------------------------------------
----------------------------------------------------
Pool    Type  Devices     Free       Used      Total  
----------------------------------------------------
centos  lvm   2        0.00 KB  494.89 GB  494.89 GB  
----------------------------------------------------
--------------------------------------------------------------------------------------------------
Volume                     Pool    Volume size  FS      FS size       Free  Type    Mount point   
--------------------------------------------------------------------------------------------------
/dev/sdb2                            500.00 MB  xfs   496.67 MB  403.61 MB          /boot 
/dev/sdb1                            200.00 MB  vfat                                /boot/efi     
/dev/centos/home           centos    389.42 GB  xfs   389.23 GB  389.18 GB  linear  /home         
/dev/centos/opt            centos      3.91 GB  xfs     3.90 GB    3.90 GB  linear  /opt 
/dev/centos/root           centos      7.81 GB  xfs     7.80 GB    7.77 GB  linear  / 
/dev/centos/swap           centos     11.72 GB                              linear                
/dev/centos/tmp            centos      7.81 GB  xfs     7.80 GB    7.80 GB  linear  /tmp
/dev/centos/usr            centos     11.72 GB  xfs    11.71 GB    8.46 GB  linear  /usr          
/dev/centos/usr_local      centos      3.91 GB  xfs     3.90 GB    3.90 GB  linear  /usr/local 
/dev/centos/var            centos      7.81 GB  xfs     7.80 GB    7.49 GB  linear  /var
/dev/centos/var_ftp        centos     15.62 GB  xfs    15.62 GB   15.62 GB  linear  /var/ftp  
/dev/centos/var_log        centos      7.81 GB  xfs     7.80 GB    7.80 GB  linear  /var/log      
/dev/centos/var_log_audit  centos      3.91 GB  xfs     3.90 GB    3.90 GB  linear  /var/log/audit
/dev/centos/var_tmp        centos      7.81 GB  xfs     7.80 GB    7.80 GB  linear  /var/tmp           
/dev/centos/var_www        centos     15.62 GB  xfs    15.62 GB   15.62 GB  linear  /var/www              
---------------------------------------------------------------------------------------------------

Physical Layout lsblk -f



Linux Tutorial


Commentary

This is the partitioning structure used on my Dell 15z Laptop. I also set up servers in a similar manner, though some of them may have six (or more) hard disk drives. Occasionally, I need to be able to access files without access to the Internet. This configuration facilitates the operation of local provision servers. I also find it convenient to serve those files via a local Git repository, web server, and/or ftp server - all running on the laptop.

The partitioning structure works well for servers also. There are plenty of web resources discussing the various methodologies as to creating Linux partitions, so I will keep things simple.

/boot
Boot from the on-board 32GB SSD and start the Centos LVM in the left over 29 GBs. Why? If the 500GB is removed from the laptop, recovery is going to be extremely difficult.
/opt
Google Chrome and other software will install to the opt directory. I prefer to keep these types of installations away from the operating system.
/tmp
Typically emptied upon reboot.
/var/ftp
Combined with PureFTP for secure FTP for anonymous transfers.
/var/tmp
I have read articles which suggest binding /var/tmp to /tmp. In short, they are not the same. /var/tmp does not get emptied upon reboot and Gnome 3 seems to like it without the noexec attribute set in fstab.
/var/www
For the web server. I provide plenty of room to work on projects as well as run a server for clients to interact with.
/vars/*
The various /var partitions are split off to keep them from filling up the hard drive and shutting down the system due to DDOS or other activity.
Partition size choices are purely a result of two factors: I have no intention of filling up a laptop drive with anything other than temporary data, and experience of what is more than enough for each respective partition. xfs partitions can be grown, but at this time they can not be shrank. The only way to handle a shrink action is to backup the partition, remove it, and recreate it with the new size. ssm may need to be installed sudo yum install system-storage-manager

Centos 7 Partitions

After researching the theories and security considerations of partitioning a Linux file system I chose the following configuration for my Dell 15z Laptop and is similar to a server setup.

Disk Usage df -H

Filesystem                        Size  Used Avail Use% Mounted on
/dev/mapper/centos-root           8.4G   76M  8.4G   1% /
devtmpfs                          4.1G     0  4.1G   0% /dev
tmpfs                             4.1G  672k  4.1G   1% /dev/shm
tmpfs                             4.1G  9.5M  4.1G   1% /run
tmpfs                             4.1G     0  4.1G   0% /sys/fs/cgroup
/dev/mapper/centos-usr             13G  4.5G  8.2G  36% /usr
/dev/sdb2                         521M  124M  397M  24% /boot
/dev/sdb1                         210M   10M  200M   5% /boot/efi
/dev/mapper/centos-tmp            8.4G  101M  8.3G   2% /tmp
/dev/mapper/centos-opt            4.2G  222M  4.0G   6% /opt
/dev/mapper/centos-var            8.4G  650M  7.8G   8% /var
/dev/mapper/centos-usr_local      4.2G   34M  4.2G   1% /usr/local
/dev/mapper/centos-home           418G  728M  418G   1% /home
/dev/mapper/centos-var_log        8.4G   40M  8.4G   1% /var/log
/dev/mapper/centos-var_ftp         17G   34M   17G   1% /var/ftp
/dev/mapper/centos-var_tmp        8.4G  221M  8.2G   3% /var/tmp
/dev/mapper/centos-var_www         17G   34M   17G   1% /var/www
/dev/mapper/centos-var_log_audit  4.2G   41M  4.2G   1% /var/log/audit

Partitions ssm list

-------------------------------------------------------------
Device        Free       Used      Total  Pool    Mount point
-------------------------------------------------------------
/dev/sda                       465.76 GB          PARTITIONED
/dev/sda1  0.00 KB  465.76 GB  465.76 GB  centos             
/dev/sdb                        29.82 GB                     
/dev/sdb1                      200.00 MB          /boot/efi  
/dev/sdb2                      500.00 MB          /boot      
/dev/sdb3  0.00 KB   29.13 GB   29.13 GB  centos             
-------------------------------------------------------------
----------------------------------------------------
Pool    Type  Devices     Free       Used      Total  
----------------------------------------------------
centos  lvm   2        0.00 KB  494.89 GB  494.89 GB  
----------------------------------------------------
--------------------------------------------------------------------------------------------------
Volume                     Pool    Volume size  FS      FS size       Free  Type    Mount point   
--------------------------------------------------------------------------------------------------
/dev/sdb2                            500.00 MB  xfs   496.67 MB  403.61 MB          /boot 
/dev/sdb1                            200.00 MB  vfat                                /boot/efi     
/dev/centos/home           centos    389.42 GB  xfs   389.23 GB  389.18 GB  linear  /home         
/dev/centos/opt            centos      3.91 GB  xfs     3.90 GB    3.90 GB  linear  /opt 
/dev/centos/root           centos      7.81 GB  xfs     7.80 GB    7.77 GB  linear  / 
/dev/centos/swap           centos     11.72 GB                              linear                
/dev/centos/tmp            centos      7.81 GB  xfs     7.80 GB    7.80 GB  linear  /tmp
/dev/centos/usr            centos     11.72 GB  xfs    11.71 GB    8.46 GB  linear  /usr          
/dev/centos/usr_local      centos      3.91 GB  xfs     3.90 GB    3.90 GB  linear  /usr/local 
/dev/centos/var            centos      7.81 GB  xfs     7.80 GB    7.49 GB  linear  /var
/dev/centos/var_ftp        centos     15.62 GB  xfs    15.62 GB   15.62 GB  linear  /var/ftp  
/dev/centos/var_log        centos      7.81 GB  xfs     7.80 GB    7.80 GB  linear  /var/log      
/dev/centos/var_log_audit  centos      3.91 GB  xfs     3.90 GB    3.90 GB  linear  /var/log/audit
/dev/centos/var_tmp        centos      7.81 GB  xfs     7.80 GB    7.80 GB  linear  /var/tmp           
/dev/centos/var_www        centos     15.62 GB  xfs    15.62 GB   15.62 GB  linear  /var/www              
---------------------------------------------------------------------------------------------------

Physical Layout lsblk -f

Linux Tutorial

Commentary

This is the partitioning structure used on my Dell 15z Laptop. I also set up servers in a similar manner, though some of them may have six (or more) hard disk drives. Occasionally, I need to be able to access files without access to the Internet. This configuration facilitates the operation of local provision servers. I also find it convenient to serve those files via a local Git repository, web server, and/or ftp server - all running on the laptop.

The partitioning structure works well for servers also. There are plenty of web resources discussing the various methodologies as to creating Linux partitions, so I will keep things simple.

/boot
Boot from the on-board 32GB SSD and start the Centos LVM in the left over 29 GBs. Why? If the 500GB is removed from the laptop, recovery is going to be extremely difficult.
/opt
Google Chrome and other software will install to the opt directory. I prefer to keep these types of installations away from the operating system.
/tmp
Typically emptied upon reboot.
/var/ftp
Combined with PureFTP for secure FTP for anonymous transfers.
/var/tmp
I have read articles which suggest binding /var/tmp to /tmp. In short, they are not the same. /var/tmp does not get emptied upon reboot and Gnome 3 seems to like it without the noexec attribute set in fstab.
/var/www
For the web server. I provide plenty of room to work on projects as well as run a server for clients to interact with.
/vars/*
The various /var partitions are split off to keep them from filling up the hard drive and shutting down the system due to DDOS or other activity.
Partition size choices are purely a result of two factors: I have no intention of filling up a laptop drive with anything other than temporary data, and experience of what is more than enough for each respective partition. xfs partitions can be grown, but at this time they can not be shrank. The only way to handle a shrink action is to backup the partition, remove it, and recreate it with the new size. ssm may need to be installed sudo yum install system-storage-manager Centos 7 on a Inspiron 15z Centos 7 Fstab












The DevOps seminar will help you to learn DevOps from scracth to deep knowledge of various DevOps tools such as fallowing List.

Linux, Git, Jenkins, Maven, Apache Tomcat, Nexus, Ansible, Chef, Docker, Nagios,   Kubernetes.


                                                                                                                                    

Learn Latest Technologies