Archive for the 'rootStuff' Category

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   ]

10
Jul

New Subversion Server for Tine 2.0

Yesterday we moved the Tine 2.0 subversion repository to a brand new Sun Xfire 2100 located in one of the Metaways data centers.

With a connection bandwidth of 1000 Mbit/s, NAS, Automatic Tape Backups and all the other blessings of professional data center, it’s quite a neat home for our soucecode ;-)

Commit times of the old sourceforge repository where about 15 seconds. On bad days we had to wait up to a minute for a single commit.

With the new Server it is now done in about a second!.

01
Jan

change suffix of a ldap database

There are these days in life of an admin, when there is no way around touching the ldap setup. There is this stupid database suffix I gave my very first ldap setup.

As today is a public holiday, and there’s also a respectable rest of sparkling wine in the fridge, I took the chance to transform this suffix to one, fitting in the rest of my infrastructure.

As I haven’t found an adequate tool for changing the suffix in an ldif file, I post my script here. Hopefully there is someone out, I can help with it.

All you need to do, is to change the $to varibale in the top of the script. Than a
slapcat | changesuffix > my.ldif
should do the job.

19
Nov

Safari 3 solves AltName issue

Today Nils Toedtmann published a grave security issue. In Firefox, Konqueror and Opera an attacker could fake SSL secured sites.Thus, its possible that your browser shows a faked site https://mybank.com without a certificate warning.

The good news for Mac users is, that in Leopard and the latest updates to Tiger ( I just checked this), this problem is resolved. However, with my old notebook (not updated, safari 2.0.0.9) this kind of attackers is possible.

Use this site to check if your Bother is vulnerable.

18
Nov

eGroupWare WebDAV on Mac OSX

eGroupWare’s filemanager content could be accessed by WebDAV for quite a while now by the URL

http(s)://myegroupware/filemanager/webdav.php/home

While this works quite OK for Linux and Windows, the build in WebDAV client of Mac OS X doesn’t talk with the eGroupWare server. The reason behind this is the fact, that the eGroupWare server only supports a rather simple version of WebDAV without locking. Locking prevents the so called “lose update” problem, when two clients try to work on the same file.

Today I found the time to resolve this problem and add locking support for the eGroupWare WebDAV client. This is a quick hack for me which only works with MySql as DBRM. Also locking is only implemented for the WebDAV server and not for the filemanager web-frontend.

To get it working you need to add a table to your database and patch your phpgwapi/inc/class.webdav_server.inc.php with the attached patch.There is still a charset problem (as always) to be resolved which seems to lay deeper in the the WebDAV code. This will get resolved in eGroupWare 2.0.

01
Nov

MAMP and Xdebug

MAMP is an extremely easy to install and use web-server with php and mysql for mac.

Once, your projects become bigger, you’ll definitely feel the need for a php debugger. Xdebug is a powerful open-source php debugger i prefer over the other mostly closed source once. There is a powerful KDE tool for analysing Xdebug output, see this example.

But as for now, i had no Xdebug extension for my mac development system, cause i didn’t want to recompile the web-server stuff. Today i found, that Komodo has a dynamic Xdebug extension bundled with there commercial IDE.

As i use Eclipse, i don’t need this IDE, but i downloaded the IDE trial and extracted the xdebug.so for me.

If you have this xdebug.so, all you need to do is to place this into
/Applications/MAMP/Library/share/php/xdebug.so
and then edit your /Applications/MAMP/conf/php5/php.ini like this:

; xdebug config Mac OS X
zend_extension=/Applications/MAMP/Library/share/php/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey=

24
Aug

FSC ServerView on Debian

I really like FSC Servers, and i really like Debian. Unfortunally this two doesn’t like each other to much. So FSC does not offer the ServerView agents for Debian, but for SuSe and RedHat.

Based on packages from Bytec for sarge and with the help of Nethanja here are the packages of the latest ServerView (4.40-09) for etch.

Install mods-src first, than eecd and at last the agents.
srvmagt-mods-src_4.40-9_i386.deb
srvmagt-eecd_4.40-9_i386.deb
srvmagt-agents_4.40-9_i386.deb