Archive for May, 2012

May 25 2012

LVM on RAID 10

mdadm -v –create /dev/md1 –level=raid10 –raid-devices=4 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2
pvcreate /dev/md1
vgcreate vg-server1 /dev/md1
lvcreate -L4g -nlv-home vg-server1
lvcreate -L2g -nlv-var vg-server1
lvcreate -L1g -nlv-tmp vg-server1

The -L option specifies the size of the volume

lvcreate -l 100%FREE -nlv-home vg (creates all of the unallocated space in the volume group)

reducing volume  to 100GB (not for XFS filesystem!)

  1. umount /dev/vg-server1/lv-zapas
  2. e2fsck -f /dev/vg-server1/lv-zapas
  3. resize2fs -p  /dev/vg-server1/lv-zapas 100G
  4. lvreduce -L 100G /dev/vg-server1/lv-zapas
  5. e2fsck -f /dev/vg-server1/lv-zapas
  6. resize2fs -p  /dev/vg-server1/lv-zapas 
  7. e2fsck -f /dev/vg-server1/lv-zapas
  8. mount /dev/vg-server1/lv-zapas

extending volume up to 100GB  (not for XFS filesystem !)

  1. umount /dev/vg-server1/lv-home
  2. lvextend -L 100G /dev/vg-server1/lv-home or  lvextend -l +100%FREE /dev/vg-server1/lv-home)
  3. e2fsck -f /dev/vg-server1/lv-home
  4. resize2fs -p  /dev/vg-server1/lv-home
  5. e2fsck -f /dev/vg-server1/lv-home
  6. mount /dev/vg-server1/lv-home

 

extending volume + 1GB

lvextend -L+1G /dev/vg-server1/lv-var



					
May 25 2012

reinstaling lilo

Boot from any Live CD

mkdir /myraid
mount /dev/md0 /myraid
mount /dev/sda1 /myraid/boot
mount –bind /dev /myraid/dev
mount -t devpts devpts /myraid/dev/pts
mount -t proc proc /myraid/proc
mount -t sysfs sysfs /myraid/sys
chroot /myraid
lilo
exit

 

May 25 2012

umounting and deleteing array

umount /dev/md0
mdadm –stop /dev/md0
mdadm –zero-superblock /dev/sda1
mdadm –zero-superblock /dev/sdb1
mdadm –zero-superblock /dev/sdc1
mdadm –zero-superblock /dev/sdd1

May 9 2012

rsync on Windows – example

rsync -av –delete –delete-excluded –exclude-from=/cygdrive/c/docume~1/rafrom/putty/rsync_exclude –chmod u+rwx -e “ssh -p 22 -i /cygdrive/c/docume~1/rafrom/putty/id_rsa_rsync” “/cygdrive/c/Fox” rafrom@192.168.100.199:backup/