21st Feb2013

Restore large mysql databases with nginx 504 Gateway Timeout

by Gyro

I had to restore a 36MB sql database today and kept getting a "504 Gateway Time-out".

After playing around with the config files, adding fastcgi_read_timeout to the settings for php5-fpm, and fiddling with the php.ini, I realized that this can be accomplished with one single line using ssh:

Assuming that you have packed the .sql file into a zip file, and you are currently in that folder:
# gunzip < databasebackup.sql.gz | mysql -DDATABASENAME -uUSERNAME -pPASSWORD

DATABASENAME = name of the database
USERNAME = mysql username
PASSWORD = mysql password

I hope this helps when trying to restore large mysql databases with nginx 504 Gateway Timeout

2338

27th Jul2012

EXT4-fs: group descriptors corrupted! Cannot mount disk using Ubuntu

by Gyro

Whaaa, Datageddon! My 2TB external just decided to stop working. "dmesg | tail" gave me the worst of the worst messages: "EXT4-fs (sda1): group descriptors corrupted!", which translates to me as "kiss your data bye bye"…

After some searching I came across the magic terminal commands to solve the problem:

(more…)

26919

19th Jul2012

Fix problem with broken package that cannot be uninstalled in Ubuntu

by Gyro

During an update some package broke and caused apt-get to throw a fit. I could't remove the package, nor could I update it. It was really annoying, as no update would work, as long as this broken package was there.

(more…)

887

17th Jul2012

Resize/Shrink Software RAID1 FileSystem/Volume/Partition and setup a LVM on the free disk space created

by Gyro
This is a guide on how to shrink a Software RAID1 filesysten, volume, and partition on a dedicated/remote server. I added the sources that helped me complete this task at the bottom of this post. It took about 2 days to get this sorted out, mainly because I am a Jack of all traits, and a master of none. :crazy:

This guide on how to resize a software raid1 should work on most Linux Distributions. I used a dedicated server located in Strassburg running Ubuntu Server 12.04, and I connected to it via ssh from Asia. :wooty:

Here my setup prior to doing this:

Two 2 TB hard disks (sda/sdb) with 3 partitions each
sda1/sdb1 -- md0 -- /boot
sda2/sdb2 -- md1 -- swap
sda3/sdb3 -- md2 -- /
md2 uses pretty much all the space.

Here the setup after completing the steps below:
Two 2 TB hard disks (sda/sdb) with 4 partitions each
sda1/sdb1 -- md0 -- /boot
sda2/sdb2 -- md1 -- swap
sda3/sdb3 -- md2 -- / (~320GB)
sda4/sdb4 -- md3 -- LVM "nova-volumes" (~1650GB)

(more…)

16213