Monitoring, Management & Location Tracking

How to move space from one volume to other in Airwave(VM)

Aruba Employee
Requirement:

With Airwave deployed on VM it is critical to know the commands to move space from any logical volume to /. "/" is the volume primarily used for Airwave.



Solution:

****Please collect the latest backup from the server before proceeding ****

 

Follow the steps below to accomplish this:

 



Configuration:

Execute the df -h command to find out the current logical volumes:

 

# df -h
Filesystem                                              Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root            50G   43G   7G  92% /
tmpfs                                                       127G     0  127G   0% /dev/shm
/dev/mapper/VolGroup-lv_home        242G  188M  230G   1% /home

 

/home has 242G, From /home we want to move 150G to / and at the same time reduce it to 20G

   

It is essential to unmount the logical volume to ensure no data loss occurs or data corruption:

  umount /home   

The first step is to reduce the space to 20G and then mount that partition back:

  # e2fsck -f /dev/VolGroup/lv_home
  # resize2fs /dev/VolGroup/lv_home 20G
  # lvreduce -L 20G /dev/VolGroup/lv_home
  # mount /home
 

Finally extend the / partition by 150G to have a total of 200G:
  # lvextend -L 150G /dev/VolGroup/lv_root 
  # resize2fs /dev/VolGroup/lv_root
   

Finally issue a reboot command to have the space applied:

# reboot

After reboot check the df -h command and it should show the space extended:

# df -h
Filesystem                                          Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root        200G 43G 157G  11%  /
 tmpfs                                                   127G     0  127G   0% /dev/shm
/dev/mapper/VolGroup-lv_home     92G   188M   80G   1% /home
                       



Verification

T0 verify the logical volume see output of lvdisplay.

[root@testsyst ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/VolGroup-lv_root
  LV Name                lv_root
  LV UUID                VzQzcz-NssK-8BIT-qtjz-XJho-0Mwd-fEbph1
  LV Write Access        read/write
  LV Creation host, time testsyst, 2014-05-01 23:51:39 +0530
  LV Status              available
  # open                 1
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:3

  --- Logical volume ---
  LV Path                /dev/VolGroup-lv_home
  LV Name                lv_home
  LV UUID                zNUKiG-QouE-q71z-ohNQ-0cFR-lggG-jNksZd
  LV Write Access        read/write
  LV Creation host, time testsyst, 2014-05-01 23:51:41 +0530
  LV Status              available
  # open                 1
  LV Size                245.50 GiB
  Current LE             62847
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:5

 

You can use the same command after moving the space to verify the contents are as required.

Version history
Revision #:
2 of 2
Last update:
‎03-18-2017 11:39 AM
Updated by:
 
Labels (1)
Contributors
Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: