Grow LVM (Ubuntu) KVM

Firstly, the VM should be shut down and we should increase the disk size. Then start the VM and go to the console.

# fdisk -u /dev/xvda
(-u shows sectors instead of cylinders. This is important)

(Make a note of the start sector of the LVM partition)
Command (m for help): p

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *        2048      499711      248832   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2          501758    16775167     8136705    5  Extended
/dev/xvda5          501760    16775167     8136704   8e  Linux LVM

(delete the LVM and/or Extended partition)
Command (m for help): d
Partition number (1-5): 2

(Create a new partition)
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)5
e (I choose extended but you may choose extended)
Partition number (1-4): 2 (choose one that's available)


(Create a new extended partition)
Command (m for help): n
Command action
 e extended
 p primary partition (1-4)
e (I choose extended but you may choose extended)
Partition number (5-8): 5 (choose one that's available)

(Fill in the start sector of the LVM partition we deleted above)
First sector (63-16777215, default 63): 501760
Last sector, +sectors or +size{K,M,G} (501760-16777215, default 16777215): (Enter)

(change created partition to Linux LVM)
Command (m for help): t 
Partition number (1-7): 5
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)

Command (m for help): p

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *        2048      499711      248832   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2          501758    16775167     8137727    5  Extended
/dev/xvda5          501760    16777215     8137728   8e  Linux LVM

Command (m for help): w (write)

# reboot

(Resize physical volume)
# pvresize /dev/xvda5

(make a note of the VG "Free PE")
# vgdisplay

(make a note of the "LV Name" of the LV you want to resize)
# lvdisplay 

(Resize LV. Fill in the found "Free PE" and "LV Name" (without the brackets))
# lvresize -l +[Free PE] [LV Name]

(resize the file system)
# resize2fs [LV Name] 
# reboot

FTOS Dell LLDP System Name

After working with LLDP information to and from some of the Force10s in our DCs, I noticed a problem or “limitation” with the way that it was sending LLDP information to some of our other gear. I found that the system information was not being sent by default which is a security feature but I needed the name and further detail.

Here is the simple answer, as I could not find it anywhere else online:

ftos-lab-1(conf)
 protocol lldp
  advertise management-tlv 
      management-address 
      system-capabilities 
      system-description 
      system-name

 

Change Linux (Cumulus) IP address without losing connectivity

I was having some problems with cumulus, I needed to change an IP address of an interface without loosing connectivity, so I had to do the following:

First you have to add a secondary IP address to the interface,  and confirm like so:

ip addr add 192.168.1.10/24 dev eth0
ip addr show eth0
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
link/ether 44:38:39:00:11:aa brd ff:ff:ff:ff:ff:ff 
inet 192.168.1.5/24 scope global eth0 
inet 192.168.1.10/24 scope global secondary eth0

 

Now we have to setup the interface to where it will promote the secondary IP address when we remove the first like so:

echo 1 > /proc/sys/net/ipv4/conf/eth0/promote_secondaries

or

sysctl net.ipv4.conf.eth0.promote_secondaries=1

** PRO-TIP: Change eth0 to all to have it work on all interfaces.

Lastly we need to remove the original IP address and confirm like so:

ip addr del 192.168.1.5/24 dev eth0
ip addr show dev eth0
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
link/ether 44:38:39:00:11:aa brd ff:ff:ff:ff:ff:ff
inet 192.168.1.10/24 scope global eth0

 

And we’re done, yay!!!