Posts

Showing posts with the label Maintenance

Add new hard drive in Debian

Its unfortunely that my disk array (RAID 5 with 4 hard drive) degraded because of a hard drive failed. For data safty issue, I have to back up all data and rebuild it again! After rebuilt, I have to re-mount it again as new hard drive into my system. Here is the procedure for notes. At first, make sure the disk is the one I want to re-mount. $ sudo fdisk -l /dev/sdc Disk /dev/sdc: 1500.0 GB, 1499999502336 bytes 64 heads, 32 sectors/track, 1430511 cylinders, total 2929686528 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000  Disk /dev/sdc doesn't contain a valid partition table Its lucky I found it! And I'll create a new partition on it. $sudo cfdisk /dev/sdc Just follow those steps below... New -> Primary -> specify size in MB Write Quit After that, I can see following message when success! Disk has been changed.  WARNING: If you have created o...

Batch for System backup

花了半天做的系統備份 for windows。雖然沒有很 solid,但,堪用! 環境為 Windows 2003 server + AppServ (Apache 2 + PHP + MySQL)。另,呼叫 winrar 做壓縮備份的動作。 @echo off rem echo %time% echo Initialize... rem rem Variables rem set DB_HOST=127.0.0.1 set DB_USER=root set DB_PASS=e1!!n set RAR_PATH=c:\progra~1\winrar\rar rem rem Get date rem FOR /F "tokens=1-4 delims=/ " %%a IN ("%date%") DO ( SET _MyDate=%%a%%b%%c ) rem rem Create directory rem echo Create directory for backup using... md %_MyDate% cd %_MyDate% rem rem Pages compress rem echo Compressing all pages... %RAR_PATH% a -r -inul eliin.rar e:\appserv\www\eliin echo . rem rem Database dump rem echo Database dumping... mysqldump --host=%DB_HOST% --user=%DB_USER% --password=%DB_PASS% project_mgmt \ > .\project_mgmt.sql mysqldump --host=%DB_HOST% --user=%DB_USER% --password=%DB_PASS% eliin \ > .\eliin.sql echo . rem rem configurations backup rem echo System configuration backup... copy E:\AppServ\Apache2.2\conf\httpd.conf . copy c:\winnt\php.in...