2018-03-29 Add Extra Disk Drive

Overview

Finallly ran out of space on the root disk. Had to add extra disk space.

References

Ubuntu Documentation

XEN Documentation

Procedure

Shutdown AUBURN

On AUBURN, ran the following command:

sudo systemctl poweroff

Create New Disk Drive

On VICTORIA, ran the following commands:

cd /OVS/running_pool/AUBURN
dd if=/dev/zero of=user.dsk bs=1G count=10

The output was:

10+0 records in
10+0 records out
10737418240 bytes (11 GB) copied, 1111.49 s, 9.7 MB/s

Update Configuration File

On VICTORIA, changes were made to /OVS/running_pool/AUBURN/auburn.cfg as discovered by the following command:

diff auburn.cfg auburn.cfg_20180329

The output was:

44,45c44
< #   ,'/OVS/iso_pool/ubuntu-16.04.3-server-amd64.iso,raw,xvdc,ro,cdrom'
<     ,'/OVS/running_pool/AUBURN/user.dsk,raw,xvdd,rw'
---
>     ,'/OVS/iso_pool/ubuntu-16.04.3-server-amd64.iso,raw,xvdc,ro,cdrom'

Start AUBURN

On VICTORIA, ran the following commands:

cd /OVS/running_pool/AUBURN
xl create auburn.cfg

The output was:

Parsing config from auburn.cfg
got a tsc mode string: "default"

Detect LVM Volumes

Followed the procedure at 05 Add Extra Disk Space.

On AUBURN, ran the following command to detect existing LVM volumes:

The output was:

[sudo] password for douglas: 
  --- Logical volume ---
  LV Path                /dev/auburn-vg/root
  LV Name                root
  VG Name                auburn-vg
  LV UUID                m2hs2W-Xkmu-oFwp-nKEp-5YWP-Z6u5-XqdLNl
  LV Write Access        read/write
  LV Creation host, time auburn, 2018-03-05 18:43:18 +1100
  LV Status              available
  # open                 1
  LV Size                2.40 GiB
  Current LE             614
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0
   
  --- Logical volume ---
  LV Path                /dev/auburn-vg/swap_1
  LV Name                swap_1
  VG Name                auburn-vg
  LV UUID                V8Y2Gz-q0Bw-v8vv-05rH-K335-A04J-H9M6KX
  LV Write Access        read/write
  LV Creation host, time auburn, 2018-03-05 18:43:18 +1100
  LV Status              available
  # open                 2
  LV Size                2.12 GiB
  Current LE             543
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

There is a logical volume group, auburn-vg, and two (2) logical volumes:

    1. /dev/auburn-vg/root
    2. /dev/auburn-vg/swap_1

It is the first logical volume, /dev/auburn-vg/root, that needs to be increased in size.

Create Physical Volume

Followed the procedure at 05 Add Extra Disk Space.

On AUBURN, ran the following command to create a physical volume on /dev/xvdd:

sudo pvcreate /dev/xvdd 

The output was:

[sudo] password for douglas: 
  Physical volume "/dev/xvdd" successfully created

Extend Logical Volume to New Physical Volume

Followed the procedure at 05 Add Extra Disk Space.

On AUBURN, ran the following command to extend the logical volume group, auburn-vg, to include the new physical volume on /dev/xvdd:

sudo vgextend auburn-vg /dev/xvdd 

The output was:

Volume group "auburn-vg" successfully extended

First Attempt to Resize Root Logical Volume

Followed the procedure at 05 Add Extra Disk Space.

On AUBURN, ran the following command to resize the root logical volume, auburn-vg/root, by 10GB:

sudo lvresize --size +10G auburn-vg/root 

The command failed with the following output:

  Insufficient free space: 2560 extents needed, but only 2559 available 

Second Attempt to Resize Root Logical Volume

Followed the procedure at 05 Add Extra Disk Space.

On AUBURN, ran the following command to resize the root logical volume, auburn-vg/root, by 9GB:

sudo lvresize --size +9G auburn-vg/root 

The output was:

  Size of logical volume auburn-vg/root changed from 2.40 GiB (614 extents) to 11.40 GiB (2918 extents).
  Logical volume root successfully resized.

Determine Device Name for Root Logical Volume

Followed the procedure at 05 Add Extra Disk Space.

On AUBURN, ran the following command to determine the device name for the root logical volume, auburn-vg/root:

ls /dev/mapper 

The output was:

auburn--vg-root  auburn--vg-swap_1  control 

The obvious candidate is /dev/mapper/auburn--vg-root.

Resize Root File System

Followed the procedure at 05 Add Extra Disk Space.

On AUBURN, ran the following command to resize the root file system on the root logical volume, auburn-vg/root:

sudo fsadm resize /dev/mapper/auburn--vg-root 

The output was:

resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mapper/auburn--vg-root is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mapper/auburn--vg-root is now 2988032 (4k) blocks long.

Verify Size of Root File System

Followed the procedure at 05 Add Extra Disk Space.

On AUBURN, ran the following command to verify the new size the root file system:

df -hlP / 

The output was:

Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/auburn--vg-root   12G  2.2G  8.6G  21% /