Category Archives: Linux

Adding a New Disk using LVM

Published / by MasonCloud / Leave a Comment
# echo "- - -" > /sys/class/scsi_host/host2/scan
# fdisk -l
# fdisk /dev/sdb
# fdisk -l
# vgdisplay
# vgcreate -h
# vgcreate vg_aspera /dev/sdb1
# vgdisplay
# lvdisplay
# lvcreate lv_aspera vg_aspera
# lvcreate -l 100%FREE -n lv_aspera vg_aspera
# lvdisplay
# cat /etc/fstab
# mkfs.ext4 /dev/vg_aspera/lv_aspera
# mkdir /aspera
# ls -lh
# lsfs.ext4
# vim /etc/fstab
Add ==> /dev/mapper/vg_aspera-lv_aspera /aspera ext4 defaults 1 2

# ls /dev/mapper/
# mount /dev/mapper/vg_aspera-lv_aspera /aspera

VMware – Increase the Hard Disk Space

Published / by MasonCloud / Leave a Comment
###########################################
## VMware - Increase the Hard Disk Space ##
###########################################

Take snapshots before any changes in the OS

Vmware -> edit Settings -> HD to 60G
Take snapshots now

Login to the System

Check fdisk to verify it see the hard disk new size

fdisk -l
Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders

# Create new partition from free space
fdisk /dev/sda

Initial Partition table
Device Boot Start End Blocks Id System
/dev/sda1 * 1 33 262144 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 33 2611 20708352 8e Linux LVM

Final Partition table
Device Boot Start End Blocks Id System
/dev/sda1 * 1 33 262144 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 33 2611 20708352 8e Linux LVM
/dev/sda3 2611 7832 41939020 8e Linux LVM

reboot - for refreshing the partition table in online system

lvm pvcreate /dev/sda3
lvm vgdisplay
lvm vgextend vg_os /dev/sda3
lvm lvextend -L 30G /dev/vg_os/lv_root
lvm lvextend -L 10G /dev/vg_os/lv_home
lvm lvextend -L 10G /dev/vg_os/lv_var
lvm lvextend -l+100%FREE /dev/vg_os/lv_tmp

lvm vgscan
lvm vgchange -ay

resize2fs /dev/mapper/vg_os-lv_root
resize2fs /dev/mapper/vg_os-lv_home
resize2fs /dev/mapper/vg_os-lv_tmp
resize2fs /dev/mapper/vg_os-lv_var