LAMP How To – Open Source At Work

Only Passion Matters

Entries Tagged ‘lvm’

fsck on lvm partition

fsck on lvm can be a bit tricky. Like a the normal process, the partition needs to be umounted and we can boot up using the rescue cd or in emergency mode. Normally, you

fsck /dev/sda1

if the partition is lvm, you need to activate the lvm first like so

vgchange –ignorelockingfailure -ay
lvscan –ignorelockingfailure (this command should now [...]

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati
  • LinkedIn
  • MySpace
  • Slashdot
  • TwitThis
  • Yahoo! Buzz

Best Linux Partitioning Setup?

Over the years, there were many attempts to find the best way to partition the hard disk or even the virtual machine. Do you need to have /var, /tmp, /usr…etc as separate partitions? Some people say it depends on what applications your server is running. If it is a mail server, maybe the /var might [...]

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati
  • LinkedIn
  • MySpace
  • Slashdot
  • TwitThis
  • Yahoo! Buzz

Creating Xen Redundant Virtual Machines with Backup Procedures

It is a good idea to backup the whole virtual machine to a separate machine to achieve redundancy. 99% uptime and full redundancy can be achieved using on-the-fly mirroring, ie network raid 1. Hardware and network performance will determine if this method will work or not. There are a few software that can achieve this. [...]

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati
  • LinkedIn
  • MySpace
  • Slashdot
  • TwitThis
  • Yahoo! Buzz

How to resize LVM running Xen part 2 – decrease disk size

shrinking a lvm partition is straight forward if it doesn’t contain a partition table. Simply do a:

umount lvm_partition
resize2fs /dev/vg/lv newSize
lvresize -L disksize /dev/vg/lv
resize2fs /dev/vg/lv

execute the last command if nessary. Assuming you have a partition table in a 10G domU which uses the default partition table,

Disk /dev/xenvg/XenWeb: 10.5 GB, 10502537216 bytes
255 heads, 63 sectors/track, 1276 cylinders
Units [...]

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati
  • LinkedIn
  • MySpace
  • Slashdot
  • TwitThis
  • Yahoo! Buzz

How to resize LVM running Xen part 1 – increase disk size

Resizing a lvm partition is straight forward if it doesn’t contain a partition table. Simply do a:
lvresize -L disksize /dev/vg/lv
resize2fs /dev/vg/lv
If it is running a virtual machine like xen with a partition table, how to resize the domU, whether to shutdown domU or not depends largely on the partiton structure. In centos, if you do [...]

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati
  • LinkedIn
  • MySpace
  • Slashdot
  • TwitThis
  • Yahoo! Buzz