Monthly Archives: July 2014

create LVM volumes for KVM servers

You need describe your LVM volume group in XML format:

vgs
vi /etc/libvirt/storage/vg_server1.xml

vg1
/dev/vg_server1

virsh pool-define /etc/libvirt/storage/vg_server1.xml
virsh pool-start vg1
virsh pool-autostart vg1
virsh pool-info vg1

now use virt-instal:

virt-install -d --hvm --vnc --name=server1 --ram 5000 --disk pool=vg1,size=100,bus=virtio,cache=none --network network=default,model=virtio \
--location=http://mirror.duomenucentras.lt/centos/7/os/x86_64/ \
--os-type=linux

improve ext4 file system

tune2fs -o journal_data_writeback /dev/partinio_name

vi /etc/fstab
/dev/partinio_name /home ext4 noatime,data=writeback,barrier=0,nobh,errors=remount-ro

Where data=writeback means that metadata for files can be written lazily after the file is written. That not cause file system corruption, but it may cause the most recent changes to be lost in the event of a crash.