Adding new hard drives on an installed Linux Server
September 16, 2009Here’s another good tutorials in adding HD in Linux
Ref: http://www.freelinuxtutorials.com/
—————————————————————————————————————
These are the steps on adding additional hard drives on a pre-installed Linux server.
Drives will be detected and can be checked thru the “dmesg” command.
[root@localhost ~]#fdisk /dev/cciss/c0d1
press n to create partition, just use the default settings for it
press w to write exit
3. Create ext3 filesystem
[root@localhost ~]# mkfs.ext3 /dev/cciss/c0d1p1
4. Mount that drive to test but first create a directory where to mount it.
[root@localhost ~]#mkdir /data
[root@localhost ~]#mount -t auto /dev/cciss/c0d1p1 /data
Here’s the continuation of the full post above
Quick tip: Adding new hard drives on an installed Linux Server
Posted in Quick Tips & Tricks by tux No Comments
These are the steps on adding additional hard drives on a pre-installed Linux server.
Drives will be detected and can be checked thru the “dmesg” command.
[root@localhost ~]#fdisk /dev/cciss/c0d1
press n to create partition, just use the default settings for it
press w to write exit
3. Create ext3 filesystem
[root@localhost ~]# mkfs.ext3 /dev/cciss/c0d1p1
4. Mount that drive to test but first create a directory where to mount it.
[root@localhost ~]#mkdir /data
[root@localhost ~]#mount -t auto /dev/cciss/c0d1p1 /data
5. Verify if its mounted already.
[root@localhost cciss]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
65G 2.2G 59G 4% /
/dev/cciss/c0d0p1 99M 12M 83M 12% /boot
tmpfs 1005M 0 1005M 0% /dev/shm
/dev/cciss/c0d1p1 135G 188M 128G 1% /data
6. We need to put the mount function on startup so in case of shutdown or reboot, the new HDD is still be recognized by the system
#vi /etc/fstab
Add this line:
/dev/cciss/c0d1p1 /data ext3 defaults 1 3
wherein:
/dev/cciss/c0d1p1 – device to be mounted
/data – mount point
ext3 – type of filesystem
defaults – mount options, Uses the default options that are rw, suid, dev, exec, auto, nouser, and async.
1 3 – dump and fsck options (5th column is dump options, checks and uses the number to decide if a filesystem should be backed up; 6th column is the order the filesystems should be checked by fsck.
Save and exit
7. Verify if the config is correct on /etc/fstab after changes
[root@localhost cciss]#mount –av
[root@localhost cciss]#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
65G 2.2G 59G 4% /
/dev/cciss/c0d0p1 99M 12M 83M 12% /boot
tmpfs 1005M 0 1005M 0% /dev/shm
/dev/cciss/c0d1p1 135G 188M 128G 1% /data
As you can see c0d1p1 already recognized on the system.
8. Reboot the server and check for errors, then issue again the “df” command to see if the new partition/drive is already there.
quick tip: rotating tomcat logs via cronolog
Posted in Quick Tips & Tricks by tux | No Comments
1.compile cronolog (http://cronolog.org) and install it on /usr/local/sbin
2. backup orig /usr/local/apache-tomcat-5.5.20/bin/catalina.sh on /root
3. edit lines on catalina.sh from
org.apache.catalina.startup.Bootstrap “$@” start \
>> “$CATALINA_BASE”/logs/catalina.out 2>&1 &
to
org.apache.catalina.startup.Bootstrap “$@” start 2>&1 \
| /usr/local/sbin/cronolog “$CATALINA_BASE”/logs/catalina.out.%Y-%m-%d >> /dev/null &
4. Removed the line
touch “$CATALINA_BASE”/logs/catalina.out
5. Restart web service
#/usr/local/tomcat/bin/shutdown.sh
# service httpd stop
# /usr/local/tomcat/bin/startup.sh
#service httpd start
TESTING
1. Check tomcat logs to see generated Catalina.out per day
# ls -la /usr/local/tomcat/logs
-rw-r–r– 1 root root 65607 Nov 6 14:55 catalina.out.2007-11-06
2. browse ww2.freelinuxtutorials.com and login using test account to see if tomcat is working
Installation of GeoIP Information for AWStats
Posted in Working with Servers by tux | No Comments
This is a continuation procedure for AWStats installation.
PROCEDURES:
GeoIP Information will show country information in AWStats.
1. Download the current GeoLite Country from the internet
1. #wget http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz
2. Create GeoIP directory
# mkdir /usr/local/share/GeoIP
3. Move data files to directory and unzip.
#mv GeoIP.dat.gz /usr/local/share/GeoIP/
#gunzip /usr/local/share/GeoIP/GeoIP.dat.gz
4. Install the GeoIP program
#wget http://www.maxmind.com/download/geoip/api/c/GeoIP-1.4.3.tar.gz
#cd /usr/local/src
#tar zxvf GeoIP-1.4.3.tar.gz
#cd /usr/local/src/GeoIP-1.4.3
#./configure
#make
#make check
#make install
#vi /etc/ld.so.conf
add the line:
/usr/local/lib
#ldconfig
5. Install Geo::IP Perl Module
#wget http://www.maxmind.com/download/geoip/api/perl/Geo-IP-1.27.tar.gz


