Labels

hpunix (63) marathi kavita (52) linux (21) solaris11 (10) AWS (5) numerology (5)

Friday, February 16, 2018

Yum repo through NFS method

Yum repo through NFS method :

If we have Repository server (Where all the patches or RPMs (redhat package manager) are stored under some directories(filesystem) then we can  mount them from repo server to destination server through NFS.

In this example:
repohost = servername where all repositories are stored
/repo/rhel6/rhel7-base = RHEL base packages stored here
/repo/rhel6/latest-update = RHEL latest update packages stored here

Note : We can mount entire mount point as well, instead of mounting only above two directories of the mountpoint

/repo/yum & /repo/yum-update = repo mountpoint on client server

On repository server:

On client server:

1. Create mountpoint /repo/yum where we will store base packages

[root@cloud home]# mkdir -p /repo/yum

2. mount exported NFS remote filesystem /repo/rhel6/rhel7-base
[root@cloud home]# mount repohost:/repo/rhel6/rhel7-base /repo/yum

3. Create mount point /repo/yum-update
[root@cloud home]# mkdir -p /repo/yum-update

4. mount exported NFS remote filesystem /repo/rhel7/latest-update
[root@cloud home]# mount repohost:/repo/rhel7/latest-update /repo/yum-update


5. Edit /etc/auto.master file:
[root@cloud home]# vi /etc/auto.master
 /repo   /etc/auto.yum
 
6. Edit /etc/auto.yum file:

[root@cloud home]# vi /etc/auto.yum
yum   -fstype=nfs   repohost:/repo/rhel6/rhel7-base
yum-update   -fstype=nfs   repohost:/repo/rhel7/latest-update

 7. Edit /etc/yum.conf file:

[root@cloud home]# vi /etc/yum.conf
[yum]
name=yum
baseurl=file:///repo/yum
enabled=1
gpgcheck=0

[yum-update]
name=yum-update
baseurl=file:///repo/yum-update
enabled=1
gpgcheck=0

Tuesday, February 13, 2018

How to increase FS which is in LVM in AWS

How to extend EBS volume which is part of LVM:
And
How to increase FS which is in LVM in AWS :

As our day to day task, we may get request to increase filesystem size by some GB value. Suppose that filesystem is part of LVM and the instance is hosted on AWS then below steps you can follow.

1. Fist you have to identify the volume for server
2. Identify the volume from AWS and increase size
3. Make new size visible on server/instance.
4. Extend the mountpoint and hence filesystem to desired value.

Note: Here we are not adding new volume we are using existing volume only. The steps for new volume are different and quite simple too.

In this example, we are going to extend the existing volume /dev/xvdm (current size: 700GB) by 300GB which is part of LVM or belongs to volume group “VolGroup02”. Mount point name is /application.

From AWS End:
  1. Login to AWS console and search our instance with instance ID or instance name.
  2. Check devices attached to respective instance. Check for /dev/sdm (On server, we will see it as /dev/xvdm) volume which we are going to increase by 300GB
  3. Click on volume /dev/sdm and choose modify volume option and increase it by 300GB. New size will be 1000GB.
After modifying the volume from AWS end we have to check on server whether it is modified or not.

From Server End:

1. Check size of our volume on server.
    #pvs |grep -i xvdm


It will not show the new size.


2. Resize the PV so the total size of the volume will be visible
#pvresize /dev/xvdm


 3. Recheck the size of volume; it will show new value now. 




Now we want to extend the mountpoint /application

4. Extend the logical volume by lvextend
    
+100%FREE - It will use 100%  of the free space to extend the volume.



5. Resize the filesystem.

6. Check new size of filesystem.

[root@mycloud ~]# df -h /applicaiton


Regards,
Kiran Jadhaw

Thursday, February 1, 2018

How to increase EBS volume size + AWS

How to increase EBS volume size + AWS


There are two ways we can extend the EBS (Elastic Block Store) volume size:

1st method:

1.1 Identify the volume (Volume ID) (eg. /dev/sdm) of an Instance which you want to                  extend.                  
        Note down the size of the volume (eg.200GB)

1.2 Take snapshot of that volume (It may take 1-2 hrs depending on the size of the                       volume).

        Note down the snapshot ID and monitor the snapshot status. It should show 100%

1.3 Detach the volume from the instance (/dev/sdm)

1.4 Extend the snapshot to the new size (eg. extend it by 300GB) New Size will be 500GB.

1.5 Attach this volume as new volume to the instance (/dev/sdn) 

        New device name will be assigned to this volume. It will get assigned in alphabetical              order.


Volume is extended from AWS end.


Note : reboot may require if the extended volume size is not visible from OS end.


2nd Method : 


2.1 Identify the volume (Volume ID) (eg. /dev/xvdm) of an Instance which you want to                  extend. 
        Note down the size of the volume (eg.200GB)

2.2 use “modify volume” option from action menu and extend the volume size to 500GB. 

        Here volume optimization will happen, it may take 2-3 hours depending on the size of the volume. Once the optimization is 100% then we can be sure that the volume/disk is extended from AWS end.


Note: On the fly we are extending the volume size here.


Login to the instance and depending on the OS (Windows + Linux) make the extended disk size visible from OS end (I'll write a post on this soon).



Regards,
Kirann Jadhav