Check and repair mysql database tables with myisamchk (and mysqlcheck)

Useful after systemcrash:

When Mysql is not running:

 myisamchk –silent –force –fast –update-state /var/lib/mysql/bugs/*.MYI

myisamchk –safe-recover –force –sort_buffer_size=2G –key_buffer_size=2G /var/lib/mysql/*/*.MYI

-s, –silent option: Prints only errors. You can use two -s to make myisamchk very silent.
-f, –force option: Restart myisamchk automatically with repair option -r, if there are any errors in the table.
-F, –fast option: Check only tables that haven’t been closed properly.
-U –update-state option: Marks tables as crashed, when it finds any error.

When Mysql is running (which is kind of slow)

mysqlcheck –repair –all-databases

 

 

 

3ware Raid Controller Switch of autoverify

To switch of the autoverify feature on a 3ware controller which can be a real performance killer do the following:

From the console, enter the 3ware cli and first check the current status

tw_cli /c0/u0 show autoverify

/c0/u0 Auto Verify Policy = on

As you can see the autoverify feature is on Auto Verify Policy = on. If your raid controller is also c0 and you unit is u0 you may use the following command. Please check this first with the command:

tw_cli /c0 show

Do not just copy and paste. If c0 doesn’t work try a higher number it depends on which pci slot your controller is in.

tw_cli /c0/u0 set autoverify=off

Setting Auto-Verify Policy on /c0/u0 to [off] … Done.

Check the autoverify settings:

tw_cli /c0/u0 show autoverify

/c0/u0 Auto Verify Policy = off

That’s it no more autoverify. Please make sure to check you raid status regularly to detect problems.

Windows bootloader damaged?

Using dualboot after the re-install of Debian Microsoft Vista could not be loaded anymore. It left me with a black screen stating that: c:\Windows\system32\winloader could not be found.

– For this I used a vista 64 installcd. (use x86 version if applicable) booted into recovery-mode which did not help me very much. At least it gave me terminal, which was all I needed. After reading through Microsoft technet I found a possible solution for this:
– From the prompt I entered the following command to check the BCD-file:
C:\Windows\System32\bcdedit /store c:BootBCD /enum
(It found my Vista install on C:)

It showed that something had corrupted the BCD-file setting some parameters to “unknown”
After entering these commands it worked again:

c:\Windows\System32\bcdedit /store c:BootBCD /set {bootmgr} device boot
The operation completed successfully.

c:\Windows\System32\bcdedit /store c:BootBCD /set {default} device boot
The operation completed successfully.

c:\windows\system32\bcdedit /store c:BootBCD /set {default} osdevice boot
The operation completed successfully.

Check with:
C:Windows\System32\bcdedit /store c:BootBCD /enum

Reboot!

source: http://technet.microsoft.com/en-us/library/cc709667%28v=ws.10%29.aspx

Debian booting from GPT disk using grub2

Booting debian Linux on GPT disk
I tried to boot from newly installed 6 TB raidvolume. It showed me the grub2 prompt.
No big deal. I used some grub-commands to boot into the system and executed update-grub. Still after a reboot even a grub-rescue prompt appeared.
After booting into the system using grub-commands I ran: grub-install, which showed me this error:

/usr/sbin/grub-setup: warn: This GPT partition label has no BIOS Boot Partition; embedding won’t be possible!.
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use –force.

Using parted I created a small partition (100 MB) at the end of the raid-volume, in my case partition 3. After this I executed in parted the command: set 3 bios_grub on. This enables the partition as a BIOS Boot partition.

Finally grub-install reported no errors. After rebooting the grub boot menu appeared again.

Howto install Tweepy for python3.2 using debian Wheezy

Setuptools itself doesn’t work on Python 3.X. But you can use Distribute, a fork and a drop in replacement for setuptools in python3

curl -O http://python-distribute.org/distribute_setup.py
sudo python3.2 distribute_setup.py
sudo python3.2 setup.py install

First I used tweepy from: https://code.google.com/p/tweepy/downloads/detail?name=tweepy-1.4-py3.tar.gz

Continue reading

How to download Windows 8.1 ISO with 8.0 retail key

Go here.
Download both the 8.0 and 8.1 installers
Launch the 8.0 installer [Windows8-Setup.exe]
Enter your key for 8.0 and begin downloading
Immediately pause your download at 1% (don’t quit at the estimating time screen), then exit
Launch your 8.1 installer [WindowsSetupBox.exe]
You’ll get an error saying element can’t be found or something like that, you’re ok – just close out
Re-launch WindowsSetupBox.exe
You’re downloading 8.1

Create a Notepad text file and copy the following lines:

[EditionID]
Professional
[Channel]
Retail
[VL]
0

In this case because my installation is for Windows 8.1 Pro edition, I’m specifying “Professional” in the EditionID, for the core edition use the EdtionID Core.
Finally, save the text file as ei.cfg inside the SOURCES folder from the bootable drive you just created with the Windows 8.1 installation files.

This method will basically allow you to install Windows 8.1 Pro or Core edition as a trial for about 30 days without entering a Windows 8 product key during the installation — because, once again, it won’t work –.
But of course you have a valid retail key, so after everything is installed and configured, you can go to PC settings, PC & Devices, PC info, and here you can change and activate your product key.

I used This source.

Zalman ZM-ve300 probs

Message: 1e partition EE

According to Zalman FAQ of the product the previous message should indicate that the legacy MBR is followed by an EFI header and that it could be solved with: In “Disk Manager”, please delete current volume and make a new volume.

Unfortunately it didn’t work.
I was still left with a EFI partition at the beginning of my disk which I could not remove. I don’t know how it got there, I think by mistake connecting it to my MAC and adjusting partitions.
I decided to try diskpart from the commandline:

– Start an elevated CMD prompt
– To list all disks type:

list disk

– determine the disknumber
– select the disk with

select disk x

(where x is the correct disknumber)
– Delete all partitions:

clean

– I discovered that the disk was for some reason a GPT disk. It shouldn’t, so I converted it to MBR with:

convert mbr

Then I created an NTFS partition on the disk using diskmanager.
On that disk I created a directory: _iso en put in all the iso-files I needed
After disconnect en reconnect the drivedisplay no longer showed the error-message and the drive was functional again.