Archive for April, 2006

Seeking the badblocks

Thursday, April 27th, 2006

One always learns about neat utilities when you are faced with some real problems. This is how I discovered badblocks. badblocks is a Linux command for the ext2 and ext3 file systems, maybe others. badblocks will basically scan you hard drive for any bad blocks on the drive and will mark them bad, so that the file system does not use them. The Seagate drive that made me use this utility had groups of 4 bad blocks.

The command is simply:
badblocks </dev/to/test>

Plesk 7.5.4 Restore

Thursday, April 27th, 2006

Finally I had to do a Plesk restore. I think I may have developed an ulcer trying to prepare for this event, but I have survived it.

I had a full Plesk dump following the backup method mentioned here.

The restore was quite straight forward:
1. I had to create an ip map file. My file contained the following information, since I was restoring Plesk to the same server:
10.0.0.24 -> eth0 : 10.0.0.24 255.255.255.255 (Only this single line). The file was called: ipmap
2. The restore required a shells map file. My file contained the following information, since I was restoring Plesk to the same server:
/bin/sh => /bin/sh
/usr/local/bin/rbash => /usr/local/bin/rbash
/usr/bin/false => /usr/bin/false
/bin/csh => /bin/csh
/bin/bash => /bin/bash

The file was called: shellsmap

I then ran a test restore, using the following command:
cat <backup_file_base>.* | /usr/local/psa/bin/psarestore -t --force --restore-admin --restore-server -m ipmap -s shellsmap -f -

Finally I ran a full restore, using the following command:
cat <backup_file_base>.* | /usr/local/psa/bin/psarestore --force --restore-admin --restore-server -m ipmap -s
shellsmap -f -

During the restore I had a large number of errors, about:

sh: – : invalid option
Usage: sh [GNU long option] [option] …
sh [GNU long option] [option] script-file …

It would however appear as if these errors had very little impact on the over all restore.

The biggest problem I had after the restore was that no FTP account was working any more. Luckily I wrote a little script to extract the FTP usernames and passwords from the database and then used the information to reset the password on the system account. This fixed the problem.