Wednesday, August 14, 2019

Introduction to Linux Part 1


Introduction to Linux
Linux is an operating system that works just like Windows and Mac OS X. As an operating system, Linux is a very hands-on operating system. If running Windows is like driving an automatic, then running Linux is like driving a stick. It can take some work, but once you know your way around Linux, you’ll be using the command line and installing packages like a pro.

Note
Everything on a Linux system is case-sensitive. That means that photo.jpgphoto.JPG, and Photo.jpg are all different files. Usernames and passwords are also case-sensitive.

 We’ll mostly be using the terms terminalshell, and SSH to refer to the interface you use to send text commands to your Linux system. These are different tools that layer on top of each other to let you interact with your server. To learn more, read these simplified definitions:

  • Terminal: A device that enters data into and displays data from a computer. The terminal has the most direct access to the operating system. Technically, most terminals these days are actually terminal emulators that run as software on Mac OS X, Linux, or Windows computers.
  • Shell: A program that provides a user interface for interacting with an operating system. There are different types of shells, but the one we’re using here is called Bash and provides a command-line interface that accepts and outputs text.
  • SSH: A protocol that lets you send shell commands to your Linode securely over the Internet.


Linux Directory Structure:-


The Shell

In a Linux system, the shell is a command-line interface that interprets a user's commands and script files, and tells the server's operating system what to do with them. There are several shells that are widely used, such as Bourne shell (sh) and C shell (csh). Each shell has its own feature set and intricacies, regarding how commands are interpreted, but they all feature input and output redirection, variables, and condition-testing, among other things.
This tutorial was written using the Bourne-Again shell, usually referred to as bash, which is the default shell for most Linux distributions, including Ubuntu, CentOS, and RedHat.

/etc/passwd file in Linux Explained with Examples

Learning the /etc/passwd file is the essential requirement of Linux user management. Learn why /etc/passwd file is used, what is stored in it and how it is formatted in detail with examples.
The /etc/passwd file is stored in /etc directory. To view it, we can use any regular file viewer command such as cat, less, more, etc.

Each line in /etc/passwd file represents an individual user account and contains following seven fields separated by colons (:).
  1. Username or login name
  2. Encrypted password
  3. User ID
  4. Group ID
  5. User description
  6. User’s home directory
  7. User’s login shell

/etc/shadow file in Linux Explained with Examples

Historically, the /etc/passwd file used to store all login information in a standalone Linux system. Later, due to following reasons password information was moved in /etc/shadow file.
·         The /etc/passwd file has only one field for password information. Since there is only one field, besides encrypted password other password related information cannot be stored in this file.
·         For password encryption, the /etc/passwd file supports basic algorithm such as DES. A hacker can easily reveal a password encrypted with DES algorithm.
·         The /etc/passwd file is world readable. It means any local user can view the passwords stored in this file.
·         The /etc/shadow file addresses all above issues.
·         The /etc/shadow file has nine fields to store encrypted password and other password related information.
·         The /etc/shadow file supports all advanced algorithms and has plenty of room for further updates.
·         The /etc/shadow file is readable only by root user.



Each line in /etc/shadow file represents an individual user account and contains following nine fields separated by colons (:).
  1. Username
  2. Encrypted password
  3. Date of last password change
  4. Minimum required days between password changes
  5. Maximum allowed days between password changes
  6. Number of days in advance to display password expiration message
  7. Number of days after password expiration to disable the account
  8. Account expiration date
  9. Reserve field



What is Swap Space?

Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. Swap space is located on hard drives, which have a slower access time than physical memory.
Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files.

Recommended System Swap Space

Amount of RAM in the systemRecommended swap spaceRecommended swap space if allowing for hibernation
⩽ 2 GB2 times the amount of RAM3 times the amount of RAM
> 2 GB – 8 GBEqual to the amount of RAM2 times the amount of RAM
> 8 GB – 64 GBAt least 4 GB1.5 times the amount of RAM
> 64 GBAt least 4 GBHibernation not recommended
-----------------------------------------------------------------------------------------------------------------------------

What is LDAP?

The Lightweight Directory Access Protocol  is a set of open protocols used to access centrally stored information over a network. It is based on the X.500 standard for directory sharing, but is less complex and resource-intensive. For this reason, LDAP is sometimes referred to as "X.500 Lite." The X.500 standard is a directory that contains hierarchical and categorized information, which could include information such as names, addresses, and phone numbers.

Why use LDAP?

The main benefit of using LDAP is that information for an entire organization can be consolidated into a central repository. For example, rather than managing user lists for each group within an organization, LDAP can be used as a central directory accessible from anywhere on the network. And because LDAP supports Transport Layer Security (TLS), sensitive data can be protected from prying eyes.

Monday, August 5, 2019

SAN Storage


LEARNING 3PAR – PART 1 – CHUNKLETS, LOGICAL DISK, CPGS, AND VIRTUAL VOLUMES
Posted by AMITESHJSK | Learning 3PAR     
First of all we have to know that what SAN storage is. So I’m telling here in easy words:-
What is SAN storage?
A Storage Area Network (SAN) is a specialized, high-speed network that provides block-level network access to storage. SANs are typically composed of hosts, switches, storage elements, and storage devices that are interconnected using a variety of technologies, topologies, and protocols. SANs may also span multiple sites.
A SAN presents storage devices to a host such that the storage appears to be locally attached. This simplified presentation of storage to a host is accomplished through the use of different types of virtualization.

Why we use it?
SANs are often used to:
  • Improve application availability (e.g., multiple data paths)
  • Enhance application performance (e.g., off-load storage functions, segregate networks, etc.)
  • Increase storage utilization and effectiveness (e.g., consolidate storage resources, provide tiered storage, etc.), and improve data protection and security.
  • SANs also typically play an important role in an organization's Business Continuity Management (BCM) activities.
SANs are commonly based on Fibre Channel (FC) technology that utilizes the Fibre Channel Protocol (FCP) for open systems and proprietary variants for mainframes. In addition, the use of Fibre Channel over Ethernet (FCoE) makes it possible to move FC traffic across existing high speed Ethernet infrastructures and converge storage and IP protocols onto a single cable. Other technologies like Internet Small Computing System Interface (iSCSI), commonly used in small and medium sized organizations as a less expensive alternative to FC, and InfiniBand, commonly used in high performance computing environments, can also be used. In addition, it is possible to use gateways to move data between different SAN technologies.

Now Introduction to HPE 3PAR Device-

5 Layers to the hosts
As with any array the path that data takes to get from our hosts to its’ final destination on disk is a complex one – but thankfully we don’t have to worry about all of the bumps in the road along the way.  That said it’s always nice to understand the road as best we can in order to determine how best practices and configuration changes will apply to our environment.  With the 3PAR that path contains 5 essential layers; Virtual Volumes, Common Provisioning Groups, Logical Disks, Chunklets, and Physical Disks.

 Figure: - 1. HPE 3PAR StoreServ system data layers
We can somewhat see by the diagram the relationship between each layer but before taking a holistic view let’s first discuss each layer…
Physical Disks
This is an easy one right?  A physical disk is just that, a physical disk located inside of your 3PAR array, encompassing all types of disk within the array.
Chunklets
The first thing a 3PAR does when it is discovering its’ storage is break down all of the capacity on your physical disks into chunklets.  Each chunklet is 1GB in size and occupies contiguous space on a physical disk.  Chunklets are local to that physical disk only and cannot span to others.
Logical Disks
Logical disks are essentially a grouping of chunklets which are arranged as rows of like RAID sets. LD’s will ensure that each chunklet which resides in a RAID set is physically located on different physical disks.  We don’t directly create LD’s on the 3PAR – they are generated during the creation of a CPG (explained next), more-so, when a Virtual Volume is created on a CPG.   All of the metadata however, RAID type, allocation, growth of an LD is defined when creating the CPG itself.
Common Provisioning Groups (CPG)
A CPG is simply a pool of Logical Disks that provide the means for a Virtual Volume (explained next) to consume space.  When we deploy a CPG we do not actually use any of the space in our pooled logical disks until a virtual volume is created – meaning a 2TB CPG with no virtual volumes consumes no space at all.  We can think of a CPG similar to that of an EVA’s disk group, but feeding on logical disks instead of physical disks.
Virtual Volumes (VVs)
No, these aren’t the VVOLs you’re looking for – this is simply a terminology that 3PAR uses to define the LUNs that are presented to the hosts – they are not the VVOLs which we have all seen come supported in vSphere 6.  Either way a Virtual Volume is a LUN that draws its capacity from a CPG – one CPG can provide space to many virtual volumes.  A virtual volume is the LUN that is exported out to your ESXi hosts, and eventually hosts datastores.  Just like most arrays Virtual Volumes can be provisioned either thick or thin – with a thin provisioned Virtual Volume only instructing its associated CPG to draw space from the logical disks as space is needed.  CPGs have the ability to create logical disks as needed to handle the increased demand for capacity up until the user-defined size limit of the CPG is reached.
So working backwards we can come to somewhat of the following
·         A datastore is located on a Virtual Volume
·         A Virtual Volume draws its’ space from a Common Provisioning Group (CPG).
·         A Common Provisioning Group is any given number of Logical Disks joined together to form some sort of contiguous space.
·         A Logical Disk is simply a collection of chunklets which are joined together in rows in order to produce a certain RAID set (0,1,5 etc).
·         A Chunklet is a 1GB piece (chunk) of any given physical disk within the array.  It’s also a very funny word.
·         A physical disk is…well, a physical disk.

Figure: - 2 Configuration of an HPE 3PAR StoreServ Storage system
So there we have it – it being the very basic understanding of some of the terminology within the HP 3PAR.  Certainly we can dive deeper into some of these terms here and we will in later posts – I mean, there are many different types of Chunklets, some reserved, some spare, but we will save those and some other terms such as Adaptive Optimization for another post.




Introduction to Linux Part 1

Introduction to Linux Part 1

Introduction to Linux Linux is an operating system that works just like Windows and Mac OS X. As an operating system, Linux is a very h...