Adding a disk to an EduCloud server


[root@websvr01 disk]# fdisk -l | more

Disk /dev/sda: 268 MB, 268435456 bytes, 524288 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: 0x0009fbcd

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      524287      261120   83  Linux

Disk /dev/sdb: 34.4 GB, 34359738368 bytes, 67108864 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/sdc: 274.9 GB, 274877906944 bytes, 536870912 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

...deleted the rest of the output showing logical vols...

[root@websvr01 disk]# fdisk /dev/sdc
Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First sector (2048-536870911, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-536870911, default 536870911):
Using default value 536870911
Partition 1 of type Linux and of size 256 GiB is set

Command (m for help): p

Disk /dev/sdc: 274.9 GB, 274877906944 bytes, 536870912 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: 0xf1d94ef7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   536870911   268434432   83  Linux

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): w
The partition table has been altered!

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

[root@websvr01 disk]# pvcreate /dev/sdc1
  Physical volume "/dev/sdc1" successfully created.

[root@websvr01 disk]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb
  VG Name               VGroot
  PV Size               32.00 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              8191
  Free PE               0
  Allocated PE          8191
  PV UUID               J4di0A-JqfY-lj0r-qKPS-o2G7-Pf2c-l6y0hF

  "/dev/sdc1" is a new physical volume of "256.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdc1
  VG Name
  PV Size               256.00 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               elDGQy-CxnX-UVn7-uWdl-yjql-f2PZ-9QP0v8

[root@websvr01 disk]# pvscan
  PV /dev/sdb    VG VGroot          lvm2 [32.00 GiB / 0    free]
  PV /dev/sdc1                      lvm2 [256.00 GiB]
  Total: 2 [288.00 GiB] / in use: 1 [32.00 GiB] / in no VG: 1 [256.00 GiB]

[root@websvr01 disk]# vgcreate VG_DATA01 /dev/sdc1
  Volume group "VG_DATA01" successfully created

[root@websvr01 disk]# lvcreate --name LV_DATA01 -l 100%FREE VG_DATA01
  Logical volume "LV_DATA01" created.

[root@websvr01 disk]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/VG_DATA01/LV_DATA01
  LV Name                LV_DATA01
  VG Name                VG_DATA01
  LV UUID                aaCmu0-qfpv-ljnl-0XO9-bDWp-Fs2r-XAlim7
  LV Write Access        read/write
  LV Creation host, time websvr01.phas.ubc.ca, 2016-11-25 14:07:09 -0800
  LV Status              available
 open 0
 LV Size 256.00 GiB
 Current LE 65535
 Segments 1
 Allocation inherit
 Read ahead sectors auto
 - currently set to 8192
 Block device 253:11

 --- other output deleted ---

 [root@websvr01 disk]# mkfs.xfs /dev/VG_DATA01/LV_DATA01
 meta-data=/dev/VG_DATA01/LV_DATA01 isize=512 agcount=4, agsize=16776960 blks
 = sectsz=512 attr=2, projid32bit=1
 = crc=1 finobt=0, sparse=0
 data = bsize=4096 blocks=67107840, imaxpct=25
 = sunit=0 swidth=0 blks
 naming =version 2 bsize=4096 ascii-ci=0 ftype=1
 log =internal log bsize=4096 blocks=32767, version=2
 = sectsz=512 sunit=0 blks, lazy-count=1
 realtime =none extsz=4096 blocks=0, rtextents=0

 [root@websvr01 /]# mkdir /www
 [root@websvr01 /]# vim /etc/fstab
# additions by rdp
/dev/mapper/VG_DATA01-LV_DATA01 /www          xfs     defaults        1 2


 [root@websvr01 /]# mount /www
 [root@websvr01 /]# df -h
 Filesystem Size Used Avail Use% Mounted on
 /dev/mapper/VGroot-LVroot 9.0G 1.3G 7.7G 15% /
 devtmpfs 482M 0 482M 0% /dev
 tmpfs 493M 8.0K 493M 1% /dev/shm
 tmpfs 493M 6.7M 486M 2% /run
 tmpfs 493M 0 493M 0% /sys/fs/cgroup
 none 493M 0 493M 0% /run/shm
 /dev/mapper/VGroot-LVhome 6.3G 33M 6.3G 1% /home
 /dev/mapper/VGroot-LVvar 3.9G 553M 3.4G 14% /var
 /dev/sda1 252M 140M 113M 56% /boot
 /dev/mapper/VGroot-LVtmp 3.0G 33M 2.9G 2% /tmp
 /dev/mapper/VGroot-LVlog 3.9G 36M 3.9G 1% /var/log
 /dev/mapper/VGroot-LVaudit 1021M 39M 983M 4% /var/log/audit
 tmpfs 99M 0 99M 0% /run/user/0
 /dev/mapper/VG_DATA01-LV_DATA01 256G 33M 256G 1% /www

=========================================================
Install php7

# cd /tmp
# curl 'https://setup.ius.io/' -o setup-ius.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1913  100  1913    0     0   3749      0 --:--:-- --:--:-- --:--:--  3743
# bash ./setup-ius.sh 
detected RHEL 7.3
Loaded plugins: rhnplugin, search-disabled-repos
This system is receiving updates from RHN Classic or Red Hat Satellite.
epel-release-latest-7.noarch.rpm                                                                                |  14 kB  00:00:00
Examining /var/tmp/yum-root-WIXud5/epel-release-latest-7.noarch.rpm: epel-release-7-8.noarch
/var/tmp/yum-root-WIXud5/epel-release-latest-7.noarch.rpm: does not update installed package.
Error: Nothing to do
Loaded plugins: rhnplugin, search-disabled-repos
This system is receiving updates from RHN Classic or Red Hat Satellite.
ius-release.rpm                                                                                                 | 8.0 kB  00:00:00
Examining /var/tmp/yum-root-WIXud5/ius-release.rpm: ius-release-1.0-14.ius.el7.noarch
/var/tmp/yum-root-WIXud5/ius-release.rpm: does not update installed package.
Error: Nothing to do
# yum remove php-cli mod_php php-common
Removed:
  php.x86_64 0:5.4.16-42.el7               php-cli.x86_64 0:5.4.16-42.el7               php-common.x86_64 0:5.4.16-42.el7        

Dependency Removed:
  php-gd.x86_64 0:5.4.16-42.el7  php-mbstring.x86_64 0:5.4.16-42.el7  php-mysql.x86_64 0:5.4.16-42.el7  php-pdo.x86_64 0:5.4.16-42.el7

# yum install mod_php70u php70u-cli php70u-mysqlnd
Installed:
  mod_php70u.x86_64 0:7.0.13-1.ius.el7       php70u-cli.x86_64 0:7.0.13-1.ius.el7       php70u-mysqlnd.x86_64 0:7.0.13-1.ius.el7 

Dependency Installed:
  php70u-common.x86_64 0:7.0.13-1.ius.el7                             php70u-pdo.x86_64 0:7.0.13-1.ius.el7                       

[root@websvr01 tmp]# apachectl restart
[root@websvr01 tmp]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2016-12-13 15:56:16 PST; 4min 23s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 55439 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
  Process: 47657 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
 Main PID: 55443 (httpd)
   Status: "Total requests: 33; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─55443 /usr/sbin/httpd -DFOREGROUND
           ├─55444 /usr/sbin/httpd -DFOREGROUND
           ├─55445 /usr/sbin/httpd -DFOREGROUND
           ├─55446 /usr/sbin/httpd -DFOREGROUND
           ├─55447 /usr/sbin/httpd -DFOREGROUND
           ├─55448 /usr/sbin/httpd -DFOREGROUND
           ├─55451 /usr/sbin/httpd -DFOREGROUND
           └─55465 /usr/sbin/httpd -DFOREGROUND

Dec 13 15:56:15 websvr01.phas.ubc.ca systemd[1]: Starting The Apache HTTP Server...
Dec 13 15:56:16 websvr01.phas.ubc.ca systemd[1]: Started The Apache HTTP Server.

# rpm -qa | grep -i ius
ius-release-1.0-14.ius.el7.noarch
php70u-pdo-7.0.13-1.ius.el7.x86_64
php70u-mysqlnd-7.0.13-1.ius.el7.x86_64
php70u-cli-7.0.13-1.ius.el7.x86_64
php70u-common-7.0.13-1.ius.el7.x86_64
mod_php70u-7.0.13-1.ius.el7.x86_64

=========================================================