Saturday, June 18, 2011

Chunk delimiter was invalid

You may experience this error with subversion (SVN).
- this is a server error
- this happens when SVN is running over http (Apache)

If your SVN/Apache servers are working on Linux, you may try the following:
1) change the MTU of you ethernet board from 1500 to 1492
- in the file /etc/sysconfig/network-scripts/ifcfg-
e.g. -> vi /etc/sysconfig/network-scripts/ifcfg-eth0
- add the line:
MTU=1500

2) change the Apache Timeout from 120 to 1200
- edit the file : /etc/httpd/conf/httpd.conf
- change the value of the Timeout

It should solve you chunk problems!

Wednesday, February 02, 2011

Create a bootable USB key with Windows using Barte PE / PE Builder

How to boot ISO image from USB device NTFS formatted.

# The situation:
- You have an USB drive (HDD or Stick) containing only one NTFS partition.
- You already have data on this USB drive and you don't want to format it or repartition it.
- You have a computer or several computers that can boot on USB devices
- You want to dump the partitions of these computers into files on the USB device and use that USB device as a recovery medium in case of computer crash or hard drive failure.

# What you need:
- computer with a BIOS allowing to boot on USB devices
- a USB device
- a windows XP SP2 installation CD or DVD
this is the system we want to boot
- when XP SP2 installation CD comes from DELL we need subinacl tool from Microsoft (download here: http://www.microsoft.com/downloads/details.aspx?FamilyID=E8BA3E56-D8FE-4A91-93CF-ED6985E3927B&displaylang=en)
- the windows XP server 2003 SP1 (here to download from microsoft: http://download.microsoft.com/download/1/2/7/127c5938-d36a-4405-9df1-f00d57495652/WindowsServer2003-KB889101-SP1-x86-ENU.exe)
Some of the files from this release are needed to update the XP SP2 boot files.
- BartPE (here to download: http://www.nu2.nu/pebuilder/)
BartPE is the free software that you will be using to create the bootable "live" Windows rescue disk
- Sherpya's XPE (here to download: http://sourceforge.net/project/showfiles.php?group_id=126922&package_id=140740)
XPE is an addition to BartPE (that is, a "BartPE plugin") that allows you to have a Windows-like desktop, Windows Explorer and other Windows tools (like the disk defragmenter) when you boot to the rescue environment


# Important notices
In the following, we assume that USB_DRIVE: is the drive letter of you USB device
Do not use any space in directory and file names as it may not always be supported by the tools we are using here.

# Make the USB drive bootable
1 -> Install windows XP on the USB drive from the installation CP
The easiest way to do so, is to install XP on the USB drive from the installation CD. For this purpose you may use any XP installation CD.
To do so, I changed the boot devices in order to boot from CD.
When you are asked about disk preparation, you may choose to install directly on the drive without formatting it.
This will modify the MBR of the disk so that it can boot windows XP.
When the files are copied you will be asked to reboot the PC.
You must do it, but don't try to reboot on the USB hard drive, windows XP would not boot and would show a blue screen!
This is because windows XP resets the USB ports and looses the USB device during boot...
You must then boot the PC on the internal hard drive of your PC.

2 -> Remove installed files form the USB drive.
Since we just wanted windows to make it bootable and need to used the server 2003 files, we must remove the XP SP2 installed files from the USB drive.
Remove the windows directory, as well as the NTDETECT.COM, ntldr, and any other file that was created by the windows installation. (you must check that you removed all hiden files like AUTOEXEC.BAT, boot.ini, CONFIG.SYS, IO.SYS, MSDOS.SYS, ...)

3 -> Copy USB boot files from XP server 2003 SP1
To solve this boot problem from XP, we use WP server 2003 SP1.
Extract the downloaded WindowsServer2003-KB889101-SP1-x86-ENU.exe file into a temporary directory.

> WindowsServer2003-KB889101-SP1-x86-ENU.exe -x

You will get a I386 folder.
From this folder:
copy setupldr.bin to USB_DRIVE:\ntldr
copy ramdisk.sy_ to USB_DRIVE:\ramdisk.sy_
copy NTDETECT.COM to USB_DRIVE:\
USB_DRIVE:
cd \
expand -r ramdisk.sy_

create a text file named winnt.sif with the following lines:
[SetupData]
BootDevice = "ramdisk(0)"
BootPath = "\I386\SYSTEM32\"
OsLoadOptions = "/noguiboot /fastdetect /minint /rdexportascd /rdpath=boot.iso"

This file will tell windows to copy the boot.iso image into a ramdisk and boot from it.
The RAMDISK is limited to 512MB, the ISO image has to fit this maximum size.

note: be careful, these files must not be compressed on the NTFS of your USB drive.

# create a ISO bootable windows XP Preinstalled Environment (PE) with BartPE

0 - Install Tools
a) install bartPE
let say you have installed it in c:\pebuilder3110a
b) install Macrium Reflect
let say you have installed it in c:\reflect


1 - Prepare the I386 folder
In order to create such an environment, BartPE requires you to have a windows installation CD.

a) copy the I386 folder from the CD to the harddrive
Some of the files must be modified with the server 2003 files, so the I386 folder must be copied onto an harddrive and updated.
Let say we copy the I386 folder into c:\pebuilder3110a\i386

b) update the I386 folder
create a srsp1 folder in c:\pebuilder3110a
From the previously extracted I386 XP server 2003 folder
copy setupldr.bin to c:\pebuilder3110a\i386\ntldr
copy ramdisk.sy_ to c:\pebuilder3110a\i386\ramdisk.sy_
copy NTDETECT.COM to c:\pebuilder3110a\i386\NTDETECT.COM

c) When the XP SP2 CD comes from DELL, the following steps must be done:
Dell delivery CD bring some issues to BartPE with file permission.
Using the DELL installation CD will lead BartPE to be unable to delete some file during the environment creation, so that it will not create the ISO file.
I found the solution on 911cd's forum (here: http://www.911cd.net/forums//index.php?showtopic=15138&st=0) and copy it here for convenience.

c.1) In c:\pebuilder3110a\i386, create a text file named fixdell.cmd with the following lines:
REM Version 1.4
reg query HKU | find /i "pebuilder" > fixdell.txt
for /f %%a in (fixdell.txt) do reg unload %%a
reg load HKLM\DELL setupreg.hiv
subinacl /subkeyreg hkey_local_machine\dell\controlset001\services\*\ /objectcopysecurity=hkey_local_machine\dell\controlset001\services
reg unload HKLM\DELL
del fixdell.txt
del /ah setupreg.hiv.log
echo Check output to see if there is any error.
pause

c.2) copy the previously downloaded subinacl.exe into c:\pebuilder3110a\i386.

c.3) run the fixdell.cmd script.

c.4) Create a folder fixdell in c:\pebuilder3110a\plugin
In c:\pebuilder3110a\plugin\fixdell create a text file named fixdell.inf with the following lines:
; Original file from Bart
; Updated 2009-12-01

[Version]
Signature= "$Windows NT$"

[PEBuilder]
Name="Fix Dell Windows XP OEM boot problems"
Enable=1

[SourceDisksFiles]
a320raid.sys=4,,4
aac.sys=4,,4
aarich.sys=4,,4
afamgt.sys=4,,4
ahcix86.sys=4,,4;required at least by Latitude D620 and D630
cercsr6.sys=4,,4
iastor.sys=4,,4
megasas.sys=4,,4
NvAtaBus.sys=4,,4
nvgts.sys=4,,4;required at least by Latitude D620 and D630
nvraid.sys=4,,4
nvrd32.sys=4,,4;required at least by Latitude D620 and D630
sisraid4.sys=4,,4;required at least by Latitude D620 and D630
symmpi.sys=4,,4

d) copy Macrim plugin
copy the Macrium folder from c:\reflect\PEBuilder to c:\pebuilder3110a\plugin

e) launch BartPE
Click on Plugin and use the button Activer to activate and unactivate a given plugin.
As it will reduce the ISO we will only activate the following:
[Sherpya] Windows XPE
[Sherpya] Windows XPE: Crypto
[Sherpya] Windows XPE: Defaults
[Sherpya] Windows XPE: DirectX
[Sherpya] Windows XPE: Help System
[Sherpya] Windows XPE: MMC
[Sherpya] Windows XPE: PnP & Multimedia
[Sherpya] Windows XPE: WMI
Check Disk (chkdsk.exe)
Customize
Fix Dell Windows XP OEM boot problems
Keyboard Layout (read PluginHelp)
Macrium Reflext
Nu2Menu
RAMDisk [Nu2 Productions]
Serial Mouse

Unactivate the other ones.

Then configure :
- the Source directory to point to your c:\pebuilder3110a folder
- the output directory where the environment will be generated (this is a temporary directory)
- select "create an ISO image" (or créer une Image ISO)

Saturday, September 11, 2010

TS101: gcc compiler

TS101 is a powerpc based architecture.
There is a mini-native-powerpc compiler that one can find at uClibc that will work for the TS101.
I tested the 0.9.30 (click here to get it), at the time of this post there is also a 0.9.30.1.
Note that this post uses information and directory structure from previous posts.
When you have the tar ball on your NAS, log as administrator and do the following commands:
mkdir /mnt/HDA_ROOT/mini-native-powerpc
cd /mnt/HDA_ROOT/mini-native-powerpc
tar -xjf mini-native-powerpc.tar.bz2

edit /share/HDA_DATA/adminfiles/addprofile.sh2 and add the following lines:
/bin/echo "export PATH=$PATH:/mnt/HDA_ROOT/mini-native-powerpc/bin" >> /etc/profile

This sh2 file will be automatically called at next startup of the TS (see previous post).
So restarting the TS will give you a gcc compiler.

Friday, September 10, 2010

TS101: improve ethernet performances

This post is using information from the SpeedGuide.net that should improve the performance of the ethernet link of the TS.
This configuration was tested and is working but I have not done any bench to check if I really get improvement. Anyway, it should not be worth. ;-)
Assuming you are using the previous post method for having .sh2 files called at startup,
create a file named /share/HDA_DATA/adminfiles/config_ethernet.sh2
add the following lines in it:
ifconfig eth0 txqueuelen 50000
echo 1 > /proc/sys/net/ipv4/tcp_rfc1337
echo 2 > /proc/sys/net/ipv4/tcp_frto
echo 1 > /proc/sys/net/ipv4/tcp_window_scaling
echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse
echo 0 > /proc/sys/net/ipv4/tcp_tw_recycle
echo 1 > /proc/sys/net/ipv4/tcp_low_latency
echo 1 > /proc/sys/net/ipv4/tcp_ecn
echo 0 > /proc/sys/net/ipv4/tcp_timestamps
echo 1 > /proc/sys/net/ipv4/tcp_sack
echo 1 > /proc/sys/net/ipv4/tcp_window_scaling

TS101:setup an autorun.sh on your harddrive

The autorun.sh is a script used by the TS to initialise and launch application at startup.
This file is unfortunatly located in an ext2 filesystem in the flash memory of the TS.
This filesystem is unmounted after bootup. Modifying this file can then endanger the system if you forget to unmount it after modification.
To overcome this issue, I propose to setup a file on your harddrive that will be called by autorun.sh at startup.


1. create the file on your harddrive
mkdir /share/HDA_DATA/adminfiles
cd /share/HDA_DATA/adminfiles
touch myautorun.sh
chmod +x myautorun.sh


2. call myautorun.sh from autorun.sh
(see previous post for editing autorun.sh)
add the following lines:

#call user script located on harddrive
[ -f /share/HDA_DATA/adminfiles/myautorun.sh ] && /share/HDA_DATA/adminfiles/myautorun.sh


Don't forget to unmount /tmp/config after modifications

3. I propose that you give your myautorun.sh the following lines:
#!/bin/sh
echo "Starting myautorun script:"
for file in /share/HDA_DATA/adminfiles/*.sh2;
do
echo $file;
[ -f $file ] && $file;
done

Then any file you may add in this directory with extension .sh2 will be executed at startup

Thursday, September 09, 2010

Install SVN client to TS 101

1. Update the list of available packages
/opt/bin/ipkg update

2. Install svn
/opt/bin/ipkg install svn

This actually also install some svn server stuff, but there is some more configuration to be done to have an svn server up and running. Have to check if this is possible over apache...

optware Installation on TS-101

With optware installed on the turbostation you can manage additional packages easily.
This post follows the post from glomde but add some corrections while doing it at the same time.

1. Change /opt location

a. create a /mnt/HDA_ROOT/opt directory
mkdir /mnt/HDA_ROOT/opt

b. edit your autorun.sh (see previous post for that) and add the following lines
if [ -d /opt ]; then rmdir /opt; fi
if [ -e /opt ]; then true; else ln -sf /mnt/HDA_ROOT/opt /opt

c. reboot your TS

2. Get and install latest ipkg. Currently the below is latest
a. find the name of the lattest version

cd /tmp
wget http://ipkg.nslu2-linux.org/feeds/optware/ts101/cross/unstable
grep "ipkg-opt" index.html | grep "powerpc\.ipk"

at the time of this post, the result was ipkg-opt_0.99.163-10_powerpc.ipk

b. download it
wget http://ipkg.nslu2-linux.org/feeds/optware/ts101/cross/unstable/ipkg-opt_0.99.163-10_powerpc.ipk
tar -zxOf ipkg-opt_0.99.163-10_powerpc.ipk ./data.tar.gz | tar -zx -C /

c. Configure it

echo src ts101a http://sources.nslu2-linux.org/feeds/optware/ts101/cross/stable/ >> /opt/etc/ipkg.conf
echo src ts101b http://ipkg.nslu2-linux.org/feeds/optware/ts101/cross/unstable >> /opt/etc/ipkg.conf

3. Backitup
cd /share/Public
tar -cf backup.tar /opt

Wednesday, July 22, 2009

MySQL on TS101

There is a pre-compiled MySQL that can be downloaded from site1 or from site2.
I Guess both are the same, I personally tested the one from site2.

The installation procedure is well described in a README included in the delivery, but when you reboot your TS station, MySQL will not be launched.

This is due to some symbolic links not kept at restart, because written in a filesystem placed in the RAM.

Edit the autostart.sh file and add the following lines before the line added by MySQL installation script :
  • cd /share
  • ln -s /share/HDA_DATA/MySQL
  • export PATH=$PATH:/share/MySQL/bin
This will allow MySQL to work correctly after reboot, and thus to be launched automatically after reboot.

Blog list and links about TS101

Launch application at TS-101 startup : autostart.sh

On Turbo Station TS101, there is a hidden partition that one can mount to access a file (autorun.sh) that is launched and executed at each startup.

To mount this hidden partition :
1- Log to you TS station with administrator login
Note : To be able to do that you must have a updated firmware from QNAP.
The one you have when you receive the TS does not allow telnet services.
When the firmware is flashed, then telnet service is connected to port 13131.
When it is installed you access your QNAP with the following command (on windows console):
telnet ip_of_your_qnap 13131

2- execute the following to mount the hidden partition
mount -t ext2 /dev/mtdblock4 /tmp/config

3- Then edit the autorun.sh file :
vi /tmp/config/autorun.sh

4- If you are as paranoid as me, then sync and unmount your file system after modification:
sync
umount /dev/mtdblock4

Be careful, this file system is in the flash, so :
- do not put big files in it
- do not erase files in it
- use as much care as possible to not destroying it

Information on other TS can be found here

Sunday, October 26, 2008

Internet Time with NTP protocol on windows XP

To be able to use NTP on windows few actions has to be made :
1 - open a command prompt and type :
regsvr32 w32time.dll

2 - activate the service :
windows time

3 - open the Adjust date and time properties and select the tab "Internet Time"
There, check the box "Automatically synchronize with an Internet time server"
In the server list you may use the Windows server :
time.windows.com

4 - press the "Update Now" button to check that the configuration is working.