Storegrid troubleshooting tips

No Comments

partyly taken from

http://www.storegrid.com/forum/viewtopic.php?t=4608&sid=bcf279ac6a6d4e4f4687893715c60e3d

partly taken from

http://www.storegrid.com/forum/viewtopic.php?p=7516

to find out the problem with storegrid:

1) Stop StoreGrid if it is already running.
2) Open a command prompt and go to <STOREGRID_HOME> folder and start StoreGrid by executing the following command: “./bin/StoreGrid > sgoutput.txt”

to fix a corrupt database file
1. Stop StoreGrid
2. Open the terminal window and go to the location
“<StoreGrid_Installation_Dir>/lib/” and copy the ’sqlite.bin’ file to /home/storegrid/Vembu/StoreGrid/data folder.
3. Access the Database base file (sgserver.db) from command line, by  executing “./sqlite.bin  sgserver.db”.
4. Execute the command “pragma integrity_check;”
5. If the output is ‘ok’ then the database is not corrupted, if not then  the database gets corrupted.
6. Quit sqlite application using “.q” command.
7. If sgserver.db is corrupted rename the sgserver.db file available in  /home/storegrid/Vembu/StoreGrid/data/ folder to ’sgserver.db.corrupt’.
8. Access the Database base file (sgserver.db.bak) from command line, by  executing “./sqlite.bin  sgserver.db.bak”. If the output is ‘ok’ then  please proceed with step 9 and step 10.
9. Take a another copy of ’sgserver.db.bak’ file and save it as  ’sgserver.db.bak.ori’.
10. Copy the ’sgserver.db.bak’ file available in  /home/storegrid/Vembu/StoreGrid/data/ folder and save it as  ’sgserver.db’ in the same location.

the example I ran myself:

root@data]# ../lib/sqlite.bin sgclient.db
SQLite version 3.5.4
Enter “.help” for instructions
sqlite> pragma integrity_check;
SQL error: malformed database schema

replace database with backup
[root@data]# mv sgclient.db
sgclient.db      sgclient.db.bak
[root@data]# mv sgclient.db sgclient.db_bad
[root@data]# cp -p sgclient.db.bak sgclient.db

start database & verify its running
[root@data]# /etc/init.d/storegrid start
Starting StoreGrid!
[root@data]# /etc/init.d/storegrid status
StoreGrid is running as pid 28613 pts/0    00:00:01 StoreGrid

Resize partition without losing data

No Comments

find the device name
fdisk -l

unmount the partition
umount /dev/sde1

run a filesystem check
fsck -n /dev/sde1

remove the journal from the partition
tune2fs -O ^has_journal /dev/sde1

use the fdisk utility on the drive
fdisk /dev/sde

type P to view the paritions
type d to delete the current partition table, if there are more than one type the # of the partition you’re deleting.  this will not remove any data
type n to create a new paritional table
type p for primary partition then the number of the partition
for the first and last cylinder do the lowest/highest number if you’re using all of the space
type a to readd the bootable flag then the # of the partition
type w to write to the server and exit fdisk

check the partition
e2fsck -f /dev/sde1

resize the partition to include the new space
resize2fs /dev/sde1

check the files again
fsck -n /dev/sde1

create a new journal for the partition
tune2fs -j /dev/sda1

mount the drive
mount /dev/sde1

verify the space
df -h
or
fdisk -l

If you’re doing this to a doing this to a drive with system files on instead of unmounting and mounting you will reboot into a knopix recovery disk and perform the operations from there.