Archive for July, 2014


For reference:

On this notes i have used Red Hat Enterprise 7. This notes should be almost be like same procedure when you use other Red hat version may only differ at some points which i will try to determine.

i have already transferred some iso files on /images/iso directory.

[root@eSuareznotes01 html]# ls -l /images/iso/
total 11694384
-rw-r--r--. 1 root root 4378114048 Jul  4 17:48 rhel-server-5.10-x86_64-dvd.iso
-rw-r--r--. 1 root root 3853516800 May 23 17:22 rhel-server-6.5-x86_64-dvd.iso
-rw-r--r--. 1 root root 3743416320 Jul 13 04:32 rhel-server-7.0-x86_64-dvd.iso

Lets us begin and bear with my silly notes:

[root@eSuareznotes01 ~]# mkdir -p /images/linux_CD/rhel7_u0x64 #Create the directory where you will place the files.

[root@eSuareznotes01 ~]# mount -o loop /images/iso/rhel-server-7.0-x86_64-dvd.iso /mnt #Mount the Red Hat iso file
mount: /dev/loop0 is write-protected, mounting read-only

[root@eSuareznotes01 ~]# cp -arv /mnt/. /images/linux_CD/rhel7_u0x64/ #Copy the mounted file to the local directory
[root@eSuareznotes01 ~]# umount -l /mnt/ #unmount the mounted partition

Now Create the local repo file.

for local server: Note: don’t forget to use three slashes in the baseurl if your repointing it to a file location

[root@eSuareznotes01 ~]# vi /etc/yum.repos.d/rhel7_u0x64.repo #You can choose whatever filename, i named mine as rhel7_u0x64.repo

[rhel7_u0x64]
name=RHEL 7.0 64-bit on localhost
baseurl=file:///images/linux_CD/rhel7_u0x64
gpgcheck=1
gpgkey=file:///images/linux_CD/rhel7_u0x64/RPM-GPG-KEY-redhat-release
enabled=1

[root@eSuareznotes01 ~]# yum repolist #Do yum repo list
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel7_u0x64 | 4.1 kB 00:00:00
(1/2): rhel7_u0x64/group_gz | 134 kB 00:00:00
(2/2): rhel7_u0x64/primary_db | 3.4 MB 00:00:00
repo id repo name status
rhel7_u0x64 RHEL 7.0 64-bit on localhost 4,305
repolist: 4,305

On the installation guide I have made mentioned there that “the iso I used is based on April 2014 release so likely that is not the latest kernel that was out June 2014 release. Latest kernel should be kernel 3.10.0-123.”

h

For the purpose of this guide that came in handy since the iso I uploaded to my system is from June 2014 release we then can test if yum would work fine.

i will be doing system update on the system

[root@eSuareznotes01 ~]# yum update
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
rhel7_u0x64                                                                         | 4.1 kB  00:00:00
(1/2): rhel7_u0x64/group_gz                                                         | 134 kB  00:00:00
(2/2): rhel7_u0x64/primary_db                                                       | 3.4 MB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:0.9.9.1-12.git20140326.4dba720.el7 will be updated
---> Package NetworkManager.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7 will be an update
---> Package NetworkManager-config-server.x86_64 1:0.9.9.1-12.git20140326.4dba720.el7 will be updated
---> Package NetworkManager-config-server.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7 will be an update
---> Package NetworkManager-glib.x86_64 1:0.9.9.1-12.git20140326.4dba720.el7 will be updated
---> Package NetworkManager-glib.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7 will be an update
---> Package NetworkManager-tui.x86_64 1:0.9.9.1-12.git20140326.4dba720.el7 will be updated
---> Package NetworkManager-tui.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7 will be an update
---> Package dracut.x86_64 0:033-160.el7 will be updated
---> Package dracut.x86_64 0:033-161.el7 will be an update
---> Package dracut-config-rescue.x86_64 0:033-160.el7 will be updated
---> Package dracut-config-rescue.x86_64 0:033-161.el7 will be an update
---> Package dracut-network.x86_64 0:033-160.el7 will be updated
---> Package dracut-network.x86_64 0:033-161.el7 will be an update
---> Package kernel.x86_64 0:3.10.0-123.el7 will be installed
---> Package kernel-tools.x86_64 0:3.10.0-121.el7 will be updated
---> Package kernel-tools.x86_64 0:3.10.0-123.el7 will be an update
---> Package kernel-tools-libs.x86_64 0:3.10.0-121.el7 will be updated
---> Package kernel-tools-libs.x86_64 0:3.10.0-123.el7 will be an update
---> Package kexec-tools.x86_64 0:2.0.4-30.el7 will be updated
---> Package kexec-tools.x86_64 0:2.0.4-32.el7 will be an update
---> Package yum.noarch 0:3.4.3-117.el7 will be updated
---> Package yum.noarch 0:3.4.3-118.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================
 Package                         Arch      Version                                    Repository      Size
===========================================================================================================
Installing:
 kernel                          x86_64    3.10.0-123.el7                             rhel7_u0x64     29 M
Updating:
 NetworkManager                  x86_64    1:0.9.9.1-13.git20140326.4dba720.el7       rhel7_u0x64    1.4 M
 NetworkManager-config-server    x86_64    1:0.9.9.1-13.git20140326.4dba720.el7       rhel7_u0x64    101 k
 NetworkManager-glib             x86_64    1:0.9.9.1-13.git20140326.4dba720.el7       rhel7_u0x64    368 k
 NetworkManager-tui              x86_64    1:0.9.9.1-13.git20140326.4dba720.el7       rhel7_u0x64    189 k
 dracut                          x86_64    033-161.el7                                rhel7_u0x64    296 k
 dracut-config-rescue            x86_64    033-161.el7                                rhel7_u0x64     42 k
 dracut-network                  x86_64    033-161.el7                                rhel7_u0x64     78 k
 kernel-tools                    x86_64    3.10.0-123.el7                             rhel7_u0x64    663 k
 kernel-tools-libs               x86_64    3.10.0-123.el7                             rhel7_u0x64    603 k
 kexec-tools                     x86_64    2.0.4-32.el7                               rhel7_u0x64    320 k
 yum                             noarch    3.4.3-118.el7                              rhel7_u0x64    1.2 M

Transaction Summary
===========================================================================================================
Install   1 Package
Upgrade  11 Packages

Total download size: 34 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /images/linux_CD/rhel7_u0x64/Packages/NetworkManager-0.9.9.1-13.git20140326.4dba720.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Public key for NetworkManager-0.9.9.1-13.git20140326.4dba720.el7.x86_64.rpm is not installed
-----------------------------------------------------------------------------------------------------------
Total                                                                       69 MB/s |  34 MB  00:00:00
Retrieving key from file:///images/linux_CD/rhel7_u0x64/RPM-GPG-KEY-redhat-release
Importing GPG key 0xFD431D51:
 Userid     : "Red Hat, Inc. (release key 2) "
 Fingerprint: 567e 347a d004 4ade 55ba 8a5f 199e 2f91 fd43 1d51
 From       : /images/linux_CD/rhel7_u0x64/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Importing GPG key 0x2FA658E0:
 Userid     : "Red Hat, Inc. (auxiliary key) "
 Fingerprint: 43a6 e49c 4a38 f4be 9abf 2a53 4568 9c88 2fa6 58e0
 From       : /images/linux_CD/rhel7_u0x64/RPM-GPG-KEY-redhat-release
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : dracut-033-161.el7.x86_64                                                              1/23
  Updating   : 1:NetworkManager-glib-0.9.9.1-13.git20140326.4dba720.el7.x86_64                        2/23
  Updating   : 1:NetworkManager-0.9.9.1-13.git20140326.4dba720.el7.x86_64                             3/23
  Updating   : dracut-network-033-161.el7.x86_64                                                      4/23
  Updating   : kernel-tools-libs-3.10.0-123.el7.x86_64                                                5/23
  Updating   : kernel-tools-3.10.0-123.el7.x86_64                                                     6/23
  Updating   : kexec-tools-2.0.4-32.el7.x86_64                                                        7/23
  Updating   : 1:NetworkManager-tui-0.9.9.1-13.git20140326.4dba720.el7.x86_64                         8/23
  Installing : kernel-3.10.0-123.el7.x86_64                                                           9/23
  Updating   : dracut-config-rescue-033-161.el7.x86_64                                               10/23
  Updating   : 1:NetworkManager-config-server-0.9.9.1-13.git20140326.4dba720.el7.x86_64              11/23
  Updating   : yum-3.4.3-118.el7.noarch                                                              12/23
  Cleanup    : 1:NetworkManager-tui-0.9.9.1-12.git20140326.4dba720.el7.x86_64                        13/23
  Cleanup    : kexec-tools-2.0.4-30.el7.x86_64                                                       14/23
  Cleanup    : dracut-network-033-160.el7.x86_64                                                     15/23
  Cleanup    : dracut-config-rescue-033-160.el7.x86_64                                               16/23
  Cleanup    : 1:NetworkManager-config-server-0.9.9.1-12.git20140326.4dba720.el7.x86_64              17/23
  Cleanup    : yum-3.4.3-117.el7.noarch                                                              18/23
  Cleanup    : 1:NetworkManager-0.9.9.1-12.git20140326.4dba720.el7.x86_64                            19/23
  Cleanup    : kernel-tools-3.10.0-121.el7.x86_64                                                    20/23
  Cleanup    : kernel-tools-libs-3.10.0-121.el7.x86_64                                               21/23
  Cleanup    : 1:NetworkManager-glib-0.9.9.1-12.git20140326.4dba720.el7.x86_64                       22/23
  Cleanup    : dracut-033-160.el7.x86_64                                                             23/23
rhel7_u0x64/productid                                                               | 1.6 kB  00:00:00
  Verifying  : 1:NetworkManager-glib-0.9.9.1-13.git20140326.4dba720.el7.x86_64                        1/23
  Verifying  : kexec-tools-2.0.4-32.el7.x86_64                                                        2/23
  Verifying  : kernel-3.10.0-123.el7.x86_64                                                           3/23
  Verifying  : dracut-config-rescue-033-161.el7.x86_64                                                4/23
  Verifying  : yum-3.4.3-118.el7.noarch                                                               5/23
  Verifying  : 1:NetworkManager-config-server-0.9.9.1-13.git20140326.4dba720.el7.x86_64               6/23
  Verifying  : kernel-tools-3.10.0-123.el7.x86_64                                                     7/23
  Verifying  : dracut-network-033-161.el7.x86_64                                                      8/23
  Verifying  : dracut-033-161.el7.x86_64                                                              9/23
  Verifying  : 1:NetworkManager-0.9.9.1-13.git20140326.4dba720.el7.x86_64                            10/23
  Verifying  : 1:NetworkManager-tui-0.9.9.1-13.git20140326.4dba720.el7.x86_64                        11/23
  Verifying  : kernel-tools-libs-3.10.0-123.el7.x86_64                                               12/23
  Verifying  : 1:NetworkManager-0.9.9.1-12.git20140326.4dba720.el7.x86_64                            13/23
  Verifying  : 1:NetworkManager-tui-0.9.9.1-12.git20140326.4dba720.el7.x86_64                        14/23
  Verifying  : kexec-tools-2.0.4-30.el7.x86_64                                                       15/23
  Verifying  : 1:NetworkManager-glib-0.9.9.1-12.git20140326.4dba720.el7.x86_64                       16/23
  Verifying  : dracut-033-160.el7.x86_64                                                             17/23
  Verifying  : kernel-tools-3.10.0-121.el7.x86_64                                                    18/23
  Verifying  : dracut-network-033-160.el7.x86_64                                                     19/23
  Verifying  : 1:NetworkManager-config-server-0.9.9.1-12.git20140326.4dba720.el7.x86_64              20/23
  Verifying  : dracut-config-rescue-033-160.el7.x86_64                                               21/23
  Verifying  : kernel-tools-libs-3.10.0-121.el7.x86_64                                               22/23
  Verifying  : yum-3.4.3-117.el7.noarch                                                              23/23

Installed:
  kernel.x86_64 0:3.10.0-123.el7

Updated:
  NetworkManager.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7
  NetworkManager-config-server.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7
  NetworkManager-glib.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7
  NetworkManager-tui.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7
  dracut.x86_64 0:033-161.el7
  dracut-config-rescue.x86_64 0:033-161.el7
  dracut-network.x86_64 0:033-161.el7
  kernel-tools.x86_64 0:3.10.0-123.el7
  kernel-tools-libs.x86_64 0:3.10.0-123.el7
  kexec-tools.x86_64 0:2.0.4-32.el7
  yum.noarch 0:3.4.3-118.el7

Check new kernel version after update:
[root@eSuareznotes01 ~]# uname -a
Linux eSuareznotes01 3.10.0-123.el7.x86_64 #1 SMP Mon May 5 11:16:57 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

Now i will be using http as protocol for my local repo so it can push files to the network.

[root@eSuareznotes01 ~]# yum -y install httpd perl perl-CGI php php-pear #perl perl-CGI php php-pear is not necessary I installed it for future use

For Red Hat Enteprise 7 only
[root@eSuareznotes01 ~]# systemctl start httpd.service #Start httpd service process
[root@eSuareznotes01 ~]# systemctl enable httpd.service #Enable system service to start every boot time
ln -s ‘/usr/lib/systemd/system/httpd.service’ ‘/etc/systemd/system/multi-user.target.wants/httpd.service’

For other Red Hat version
[root@rhel6~]# /etc/rc.d/init.d/httpd start #Start httpd service
Starting httpd: [ OK ]
[root@rhel6 ~]# chkconfig httpd on #Enable service to start at reboot

Since i am using the file hosted on other partition i have repoint it to show contents on the httpd directory which is located at /var/www/html

[root@eSuareznotes01 ~]# ln -s /images/iso/ /var/www/html/iso
[root@eSuareznotes01 ~]# ln -s /images/linux_CD/ /var/www/html/linux_CD

Configuring firewalld to allow http connection #For Red Hat Enteprise 7.0 only as other version uses iptables instead

This should serve as sample on how to configure firewalld and some sets of commands:

Check which zone are you running:
[root@eSuareznotes01 zones]# firewall-cmd –get-active-zone
public
interfaces: eth0

[root@eSuareznotes01 zones]# firewall-cmd –zone=external –change-interface=eth0
success
[root@eSuareznotes01 zones]# firewall-cmd –get-active-zone
external
interfaces: eth0

[root@eSuareznotes01 zones]# firewall-cmd –zone=external –list-services
ssh

[root@eSuareznotes01 system]# firewall-cmd –zone=external –add-service=http
success
[root@eSuareznotes01 system]# firewall-cmd –zone=external –list-all
external (active)
interfaces: eth0
sources:
services: ssh
ports: 300/tcp
masquerade: yes
forward-ports:
icmp-blocks:
rich rules:

Configure Iptables to allow http connection #For other Red hat version that uses iptable by default

vi /etc/sysconfig/iptables

Add this lines under INPUT sections
-A INPUT -p tcp -m tcp –dport 80 -j ACCEPT

Save the file and restart iptables.
/etc/init.d/iptables restart

Selinux

[root@eSuareznotes01 /]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28

Check SELinux security context

[root@eSuareznotes01 /]# ls -Z /var/www/html/
-rw-r–r–. root root unconfined_u:object_r:httpd_sys_content_t:s0 index.html
lrwxrwxrwx. root root unconfined_u:object_r:httpd_sys_content_t:s0 iso -> /images/iso/
lrwxrwxrwx. root root unconfined_u:object_r:httpd_sys_content_t:s0 linux_CD -> /images/linux_CD/
-rw-r–r–. root root unconfined_u:object_r:httpd_sys_content_t:s0 phpinfo.php

[root@eSuareznotes01 /]# chcon -Rv –type=httpd_sys_content_t /images

After allowing on the firewalld and SELinux you should be able to see over the network the contents

You should be able to reach the contents http://xxx.xxx.xxx.xxx/linux_CD/

On remote machine configuration

vi /etc/yum.repos.d/whatevername.repo

[rhel7_u0x64]
name=RHEL 7.0 64-bit on localhost
baseurl=http://xxx.xxx.xxx.xxx/linux_CD/rhel7_u0x64
gpgcheck=1
gpgkey=http://xxx.xxx.xxx.xxx/linux_CD/rhel7_u0x64/RPM-GPG-KEY-redhat-release
enabled=1

Where xxx.xxx.xxx.xxx is the ip of your local repo server

Will Update…


Adding Hard disk to Red Hat Enterprise Linux using LVM

note: the actual installation are performed from VMware Red Hat Enterprise 7.0

Scenario: 

I have created another 100 GB virtual disk and i want to add this to my linux installation.
the 100 GB are to be used used for /images partition. 

The installation are likely the same accross other version Red Hat Enterprise version and likely to differ in some commands which i will try my best to share

Lets us begin…

[root@eSuareznotes01 ~]# fdisk /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 0xd5f31fd6.

Command (m for help): m # for HELP information to display
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition’s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): n # To create a new partition

Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p # To make it a primary partition

Partition number (1-4, default 1): 1 # To make the first partition
First sector (2048-209715199, default 2048): #default
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199): #default
Using default value 209715199
Partition 1 of type Linux and of size 100 GiB is set

Command (m for help): t # To make it a linux LVM type partition
Selected partition 1
Hex code (type L to list all codes): L # to list the Hex codes

0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
14 Hidden FAT16 ❤ 61 SpeedStor ab Darwin boot f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
1e Hidden W95 FAT1 80 Old Minix
Hex code (type L to list all codes): 8e # To select Linux LVM
Changed type of partition ‘Linux’ to ‘Linux LVM’

Command (m for help): w # To write the partition table
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

[root@eSuareznotes01 ~]# ls -l /dev/sdb1
brw-rw—-. 1 root disk 8, 17 Jul 13 10:20 /dev/sdb1

[root@eSuareznotes01 ~]# pvcreate /dev/sdb1 # Create Physical volume
Physical volume “/dev/sdb1” successfully created
[root@eSuareznotes01 ~]# vgcreate datavg01 /dev/sdb1 # Create Volume group
Volume group “datavg01” successfully created
[root@eSuareznotes01 ~]# pvdisplay # display the physical volume information
— Physical volume —
PV Name /dev/sda2
VG Name rootvg
PV Size 25.01 GiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 6401
Free PE 1
Allocated PE 6400
PV UUID 150o7e-DP2W-afYR-bAXM-RgBJ-S9UO-Ql91Wd

— Physical volume —
PV Name /dev/sdb1
VG Name datavg01
PV Size 100.00 GiB / not usable 3.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 25599
Free PE 25599
Allocated PE 0
PV UUID tKjaH4-3STt-tttO-2Aqe-25Vb-vIfu-VssId8

 
when extending the disk space it is very important that you run this command this give you the "Free PE's"
to get the the available PE that you can use to extend Free PE x PE size (PE size sometime comes with KB or MB output)

[root@eSuareznotes01 ~]# lvcreate -n imagelv -L 50G /dev/datavg01
Logical volume “imagelv” created

To create logical volume then named as imagelv with 50GB size under /dev/datavg volume group
note: I only 50 GB here instead of 100 GB which i can use the other half on different things 

[root@eSuareznotes01 ~]# mkfs.xfs /dev/datavg01/imagelv # here is where you format the logical volume using XFS
meta-data=/dev/datavg01/imagelv isize=256 agcount=4, agsize=3276800 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0
data = bsize=4096 blocks=13107200, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal log bsize=4096 blocks=6400, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0

on this mkfs.X where X is the type of partition so on this section it will be likely different based on what partition your Red Hat system use for example if you use ext3 see the example below:

[root@nightops ~]# mkfs.ext3 /dev/datavg01/imageslv
nightops ~ -> mkfs.ext3 /dev/datavg01/imageslv
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1048576 inodes, 2097152 blocks
104857 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2147483648
64 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@eSuareznotes01 ~]# fdisk -l # list information

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000a490d

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 309247 153600 83 Linux
/dev/sda2 309248 52754431 26222592 8e Linux LVM

Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xd5f31fd6

Device Boot Start End Blocks Id System
/dev/sdb1 2048 209715199 104856576 8e Linux LVM

Disk /dev/mapper/rootvg-usrlv: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/rootvg-swaplv: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/rootvg-rootlv: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/rootvg-homelv: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/rootvg-loglv: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/rootvg-optlv: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/rootvg-locallv: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/rootvg-varlv: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/rootvg-tmplv: 4294 MB, 4294967296 bytes, 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/datavg01-imagelv: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@eSuareznotes01 ~]# vi /etc/fstab # add the entry to your fstab to make the filesystem always available
#
# /etc/fstab
# Created by anaconda on Thu Jul 10 18:13:58 2014
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk’
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rootvg-rootlv / xfs defaults 1 1
UUID=ce3544c5-a456-4473-af44-a569a8dec4fd /boot xfs defaults 1 2
/dev/mapper/rootvg-homelv /home xfs defaults 1 2
/dev/mapper/rootvg-optlv /opt xfs defaults 1 2
/dev/mapper/rootvg-tmplv /tmp xfs defaults 1 2
/dev/mapper/rootvg-usrlv /usr xfs defaults 1 2
/dev/mapper/rootvg-locallv /usr/local xfs defaults 1 2
/dev/mapper/rootvg-varlv /var xfs defaults 1 2
/dev/mapper/rootvg-loglv /var/log xfs defaults 1 2
/dev/mapper/datavg01-imagelv /images xfs defaults 1 2
/dev/mapper/rootvg-swaplv swap swap defaults 0 0 xfs defaults 1 2

[root@eSuareznotes01 ~]# mkdir /images # Create where the partition will be mounted
[root@eSuareznotes01 ~]# mount -a # refresh mount based on fstab configurations
[root@eSuareznotes01 ~]# df -h # List disk information
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv 1014M 52M 963M 6% /
devtmpfs 236M 0 236M 0% /dev
tmpfs 242M 0 242M 0% /dev/shm
tmpfs 242M 4.6M 237M 2% /run
tmpfs 242M 0 242M 0% /sys/fs/cgroup
/dev/mapper/rootvg-usrlv 4.0G 767M 3.3G 19% /usr
/dev/mapper/rootvg-homelv 4.0G 33M 4.0G 1% /home
/dev/mapper/rootvg-optlv 2.0G 33M 2.0G 2% /opt
/dev/mapper/rootvg-locallv 2.0G 33M 2.0G 2% /usr/local
/dev/mapper/rootvg-tmplv 4.0G 33M 4.0G 1% /tmp
/dev/mapper/rootvg-varlv 4.0G 57M 4.0G 2% /var
/dev/mapper/rootvg-loglv 2.0G 35M 2.0G 2% /var/log
/dev/sda1 147M 68M 80M 46% /boot
/dev/mapper/datavg01-imagelv 50G 33M 50G 1% /images


Red Hat Enterprise 7 is based on fedora 19 and upstream of kernel 3.10

Ever wanted to change back to the default network device name like "ethX"

This is based on VMware installation i have the default nic name as"en01677736"

[root@eSuareznotes01 ~]# ip addr show
1: lo: mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:92:78:40 brd ff:ff:ff:ff:ff:ff
inet XX.X.XX.XX/24 brd 10.0.10.255 scope global dynamic eno16777736
valid_lft 85931sec preferred_lft 85931sec
inet6 fe80::20c:29ff:fe92:7840/64 scope link
valid_lft forever preferred_lft forever

[root@eSuareznotes01 ~]# vi /etc/default/grub

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=”$(sed ‘s, release .*$,,g’ /etc/system-release)”
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=”console”
GRUB_CMDLINE_LINUX=”rd.lvm.lv=rootvg/usrlv rd.lvm.lv=rootvg/swaplv crashkernel=auto vconsole.keymap=us rd.lvm.lv=rootvg/rootlv vconsole.font=latarcyrheb-sun16 rhgb quiet”
GRUB_DISABLE_RECOVERY=”true”

Look for this line “GRUB_CMDLINE_LINUX” and add the following: “net.ifnames=0 biosdevname=0”

Should look like this:
GRUB_CMDLINE_LINUX=”rd.lvm.lv=rootvg/usrlv rd.lvm.lv=rootvg/swaplv crashkernel=auto vconsole.keymap=us rd.lvm.lv=rootvg/rootlv vconsole.font=latarcyrheb-sun16 rhgb quiet net.ifnames=0 biosdevname=0

[root@eSuareznotes01 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file …
Found linux image: /boot/vmlinuz-3.10.0-121.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-121.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-df30d92ad3eb414583d85bb471003eb4
Found initrd image: /boot/initramfs-0-rescue-df30d92ad3eb414583d85bb471003eb4.img
done

If you didn’t put any names during the installation, you will need to rename the interface files by renaming the file /etc/sysconfig/network-scripts/ifcfg-*.

[root@eSuareznotes01 ~]# mv /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eth0
[root@eSuareznotes01 ~]# shutdown -r now

After system reboot

[root@eSuareznotes01 ~]# ip addr show
1: lo: mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:92:78:40 brd ff:ff:ff:ff:ff:ff
inet 10.0.10.77/24 brd 10.0.10.255 scope global dynamic eth0
valid_lft 86141sec preferred_lft 86141sec
inet6 fe80::20c:29ff:fe92:7840/64 scope link
valid_lft forever preferred_lft forever


Red Hat Enterprise 7.0 Installation using LVM partitioning

On this installation I used VMWARE to do the install on Red Hat Enterprise Linux 7.0

Note: i have used the iso on April 2014 release so likely this is not the latest kernel that was out June 2014 release. Latest kernel should be kernel 3.10.0-123.

Then again nothing differs from the installation procedure.

Boot the installation media and you will be redirected to RHEL 7 Splash Screen

Choose to “Install Red Hat Enterprise Linux 7.0”

redhat-install01

On the next page: you need to select appropriate language for your preference

redhat-install02

Then select “Continue” you will get into the Installation summary:

redhat-install03

Select “Date and Time” under Installation Summary to customize your server timezone and then Network time enables you to configure an NTP server using the gear icon. Select “Done” when completed.

redhat-install04

Select “Keyboard Layout” under Installation Summary to customize your keyboard profile and make changes based on your keyboard layout preference. Select “Done” when completed.

redhat-install05

Select “Software Selection” to customize the base environment you wanted to install then select “Done”

I always set things to Minimal Install and get to install those things I would need on later part.

Note: on Minimal Install please note that net-tools package is not included in the installation causing ifconfig command not to work.

redhat-install06

Select “Network & Hostname” Tick the “ON” button to make sure that the Ethernet activate during system boot up. Then just below enter your desired hostname.

Note: hostname can be change anytime and network link can be set to Onboot anytime.

redhat-install07

Customize the network setting by selecting “Configure” then set everything based on your network preference:

redhat-install08

Select done and you will get back to the “Installation Summary” then select the “Installation destination”

Select your hard disk under local standard disk then under other storage option choose “I will configure partitioning”

redhat-install09

After clicking done you will be redirected to manual partitioning and use volume group for the rest partition except for boot

When partitioning disk I do suggest to use the LVM as it offers flexibility in terms of dynamic volume resizing, spanning volume on multiple disk, shrinking volume sizes and disaster recovery.

detail explanation:
http://smallbusiness.chron.com/pro-cons-creating-logical-volumes-linux-78311.html

First splash screen when doing manual partitioning.

redhat-install10

My Sample partition:

redhat-install11

redhat-install12

Select “Done” then screen pop out click accept changes

redhat-install13

Click “Begin installation”

redhat-install14

You will be redirected to this screen: now you can customize your root password and create your initial user.

redhat-install15

Change root password

redhat-install16

User account creation

I actually prefer creating accounts after installation but for sake of this installation guide here how it would look like.

redhat-install17

Complete installation by choosing reboot

redhat-install18

Install complete:

redhat-install19