Archive for August, 2008

31
Aug

Live Disk Migration with Softraid and LVM

As disk space on my homeserver became rare, and I wanted to start using apples timemachine on a network share I needed to upgrade diskspace.

However, three of four ports where on my sata controller where already occupied and so I couldn’t extend my lvm’s physical volume easily with a new raid1 or raid5 array. So i decided to remove two 250GB disks and replace them by two new 500GB once.

Old disk layout:
sda1 10GB / sda2 240GB
sdb1 10GB / sdb2 240GB
sdc1 260GB / sdc2 240GB
md0, raid1, 10GB sda1, sda2
md1 raid5 480GB sda2, sdb2, sdc2
md1 pv (480GB) for lvm2

Desired layout (with two new 500GB disks):
sda1 10GB / sda2 490GB
sdc1 10GB / sdc2 490GB
sdd1 10GB / sdd2 490GB
md0, raid1, 10Gb sda1, sdc1, sdd1(spare)
md1, raid5, 980GB sda2, sdc2, sdd2
md1 pv (980 GB) for lvm2

Howto accomplish data migration with all services staying online.

Create Backups ;-) (I did)

Remove sdc2 from raid5 array
mdadm /dev/md1 --fail /dev/sdc2 --remove /dev/sdc2

New partitioning for sdc (man fdisk)

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1         609     4891792   fd  Linux raid autodetect
/dev/sdc2             610       60801   483492240   83  Linux

Add sdc1 to md0 and remove sda1, sdb1
mdadm /dev/md0 --add /dev/sdc1
mdadm /dev/md0 --fail /dev/sda1 --remove /dev/sda1
mdadm /dev/md0 --fail /dev/sdb1 --remove /dev/sdb1

Create pv for sdc2 space and move all data temparary to it
pvcreate /dev/sdc2
vgextend VG00 /dev/sdc2
pvmove /dev/md1 /dev/sda1

Remove md1 from lvm and delte it
vgreduce VG00 /dev/md1
pvremove /dev/md1
mdadm -S /dev/md1

Shred old disks
shred -vfz /dev/sda
shred -vfz /dev/sdb

Prepare sdc as boot disk
grub-install --recheck /dev/sdc
grub
grub> root (hd3,0)
grub> setup (hd3)
grub> quit

shutdown -h now

Replace sda, sdb with new disks and power on

new partitioning sda,sda (man fdisk):

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1217     9775521   fd  Linux raid autodetect
/dev/sda2            1218       60801   478608480   fd  Linux raid autodetect

add sda1, sdb2 to md0
mdadm /dev/md0 --add /dev/sda1
mdadm /dev/md0 --add /dev/sda2 (spare)

Make each disk bootable
grub-install --recheck /dev/sda
grub-install --recheck /dev/sdb
grub
grub> root (hd1,0)
grub> setup (h10)
grub> root (hd2,0)
grub> setup (hd2)
grub> quit

Assembe new md1 (with one missing disk)
mdadm --create /dev/md1 --level=5 --raid-devices=3 /dev/sda2 /dev/sdb2 missing

Create pv of md1 and move data to it
pvcreate /dev/md1
vgextend VG00 /dev/md1
pvmove /dev/sdc2 /dev/md1

Remove temp pv and add sdc2 to raid md1
vgreduce VG00 /dev/sdc2
pvremove /dev/sdc2
mdadm /dev/md1 --add /dev/sdc2

Dump raid config
echo "DEVICE /dev/sda* /dev/sdb* /dev/sdc*" > /etc/mdadm/mdadm.conf
mdadm --detail --scan >> /etc/mdadm/mdadm.conf

That it, we are done!
cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4] 
md1 : active raid5 sdc2[3] sda2[0] sdb2[1]
      957216768 blocks level 5, 64k chunk, algorithm 2 [3/2] [UU_]
      [>....................]  recovery =  3.8% (18258160/478608384) finish=107.4min speed=71383K/sec

md0 : active raid1 sda1[0] sdb1[2](S) sdc1[1]
      4883648 blocks [2/2] [UU]

unused devices:

pvscan 
  PV /dev/md1   VG VG00   lvm2 [912,87 GB / 480,50 GB free]
  Total: 1 [912,87 GB] / in use: 1 [912,87 GB] / in no VG: 0 [0   ]

28
Aug

Spacegallery Implementation in ExtJS

Yesterday I had a short discussion with a colleague of our front-end/website team. We had a look a gallery implementation made in JQuery.  He wanted to have a similar animation like the rezise/move/fadeout animation when an image gets clicked in this gallery.

The question was how hard it would be to implement such an animation. My short answer was: “I guess this is about 5 lines of code”. Well, I have never worked with JQuery and animation in general, and after looking into the code I realized, that JQuery seems to differ conceptually a lot from ExtJS.

However a few weeks ago I roughly scanned the docs of Ext.Fx. This is a small but very powerful Effect class in ExtJS. Many people think, ExtJS is ‘just’ suited for Web-Apps with a look similar to the Tine 2.0 look. But this is not the whole truth. ExtJS is also a general purpose JS Library with also comes with great animation and effects support.

As you can see bellow, I couldn’t resist to implement a spacegallery using ExtJS. The code for all animations, not only the animation of the top Image, is just 4 Lines of code:

onImageClick: function(e, dom) {
this.imageEls[0].shift(this.fadeOutPerspectiveData);
for(var n=1; n this.imageEls[n].shift(this.perspectiveData[n-1]);
}
this.cycleStack();
},

Ok, it's a matter of interpretation if you count the single "}" line :-) .

26
Aug

First Translations for Tine 2.0

After the german translations of Tine, which are provided by the core developers team, now the first contributed translations are integrated.

We are quite glad that we already have translators for russian, bulgarian, french, italian, polish and simplified chinese even before we started to ask actively for translations.

Specially I’d like to thank Ilya Yurkovetskiy, for the russian translation and the help to locate areas where the plural forms in the templates needed to be improved.

Unlike English and German, the Russian language has 3 plural forms. The first for e.g. 1, the second for e.g. 2 and the third for e.g. 5 items of a thing.

Also the cyrillic letters help to identify strings not in the translation system yet.

I set up a language statistics page here, to track the state of each translation. After Release of the next milestone we will start a call for translations.

22
Aug

Version 0.4 of jsdoc-tk-ext

Finally, after Tine 2.0′s Milestone 2 is released, I found some time to upgrade the jsdoc-tk-ext package which now comes in version 0.4.

Thanks to contributions from the ExtJS-Forums documentation of Ext.ux classes is greatly improved. Moreover I spend some time to ease invocation of the toolkit.

The Tine 2.0 JS API Documentation got generated with a simple:
~/jsdoc$ java -jar jsrun.jar app/main.js -H='Tine 2.0 JS API Documentation' -r  ../tine20

Changes in Detail:

  • make it running with windows (thanks Sierk)
  • include return comments (thanks Sierk)
  • allow to use shortcuts for @cfg in ExtJS doc style (thanks duralabh)
  • allow to specify config options for undefined properties (thanks duralabh)
  • allow to use new config format for properties and config (thanks duralabh)
  • use exjs logo (requested by jack slocum)
  • allow to document classes which are defined into global namespace (thanks SamuraiJack1)
  • set ext template as default 
  • include a copy of extjs
  • remove dumper dependencies
  • make headline configurable
  • some code cleanup
14
Aug

Will DateTime abstraction come to Zend_Db?

In my view, the lack of proper date-time abstraction in the Zend_Db component is the most missing core feature in Zend Framework as any Database Brand expects date-time informations in a different representation.

However in Zend Framework date-time data are greatly abstracted via the Zend_Date component with full Time-zone support!

But when it comes to Zend_Db, this abstraction is of no use, as the component expects data for date-time fields in the db’s native representation.

There is a open issue in the Zend Tracker about this topic. The scheduled fix war for 0.8.0 release :-) .

Well, never give up Hope is the credo. The issue got updated 3 days ago, setting the target version again to next minor release. 

Lets all keep finger crossed, as the inclusion of this feature would greatly help to finish the Oracle Back-end of Tine 2.0.