Skip to content

Instantly share code, notes, and snippets.

@ilivessevili
Created April 30, 2016 10:53
Show Gist options
  • Save ilivessevili/73d27f667ed98a674e378208c3495ebf to your computer and use it in GitHub Desktop.
Save ilivessevili/73d27f667ed98a674e378208c3495ebf to your computer and use it in GitHub Desktop.
Add a new harddisk
/dev/sdb
Create partition
Sudo fdisk /dev/sdb
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): p
Disk /dev/sdb: 107.4 GB, 107374182400 bytes
43 heads, 44 sectors/track, 110843 cylinders, total 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xab3ad034
Device Boot Start End Blocks Id System
/dev/sdb1 2048 209715199 104856576 8e Linux LVM
Install lvm package
Sudo apt-get -y install lvm2
Create PV
pvcreate /dev/sdb1 -ff
Create VG
vgcreate openstack-vg /dev/sdb1
Create LV
lvcreate -L60G -nlv-images openstack-vg
Check and verify
Vgs
Pvdisplay
Lvdisplay
Format to expected file system
mkfs.ext3 /dev/openstack-vg/lv-images
Mount LV
mount /dev/openstack-vg/lv-images os-images/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment