Rexxer

Some tips for me and other

Ubuntu + Script to extend a disk

#!/bin/bash
fdisk /dev/sda << FDISK_CMDS
n
w
FDISK_CMDS
partprobe /dev/sda
a=$(vgs | awk ' NR==2 {print $1;}')
vgextend “$a” /dev/sda3
b=$(vgdisplay | awk ' NR==17 {print $3;}')
lvextend -L +"$b" /dev/$a/ubuntu-lv
resize2fs /dev/$a/ubuntu-lv

Comments are currently closed.