Mounting windows partitons FAT and NTFS

Mounting NTFS filesystems in Linux

FAT filesystems are defined in Linux as VFAT and accessing them is very easy. But sometimes we need to access files in windows(with ntfs system running) while running Linux. So it becomes hassle and time consuming to switch back to windows and transfer the file in a zip drive and access in linux. Still we may encounter problem in reading that particualr file in Linux since the thumb drive is in windows file system. We feel sad again if we dont know how to mount such windows partition or filesystem in Linux system. Dont worry, thats very simple to mount windows partitions or NTFS file system in Linux. Here is a short steps in accessing them in linux. Lets go through them step wise.

STEPS: To mount NTFS filesystem
AFter we download the required package named ntfs-3g_ntfsprogs-20XX.X.XX, Example:  ntfs-3g_ntfsprogs-2014.2.15, follow the following procedure.

// Switch to root user
# su - root

// Move to the location where we have downloaded the file
[root@server ~]# cd /root/Downloads

// Uncompress the package
[root@server ~]# tar -zxvf  ntfs-3g_ntfsprogs-2014.2.15.tgz
[root@server Downloads]# cd ntfs-3g_ntfsprogs-2014.2.15
[root@server ntfs-3g_ntfsprogs-2014.2.15]#./configure
[root@server ntfs-3g_ntfsprogs-2014.2.15]# make
[root@server ntfs-3g_ntfsprogs-2014.2.15]# make install

This way we finished installing the package successfully. Now lets mount the partitions and lists the partitons at first

[root@server ~]# fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
222 heads, 30 sectors/track, 23468 cylinders
Units = cylinders of 6660 * 512 = 3409920 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003558c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        9225    30719235    7  HPFS/NTFS
/dev/sda2            9226        9287      204800   83  Linux
/dev/sda3            9287       13900    15360000   83  Linux
/dev/sda4           13900       23469    31865944    5  Extended
/dev/sda5           13900       16975    10240000   83  Linux
/dev/sda6           16976       20051    10240000   83  Linux
/dev/sda7           20051       23126    10240000   83  Linux
/dev/sda8           23126       23469     1141760   82  Linux swap / Solaris

Disk /dev/sdb: 63.9 GB, 63947145216 bytes
25 heads, 25 sectors/track, 199834 cylinders
Units = cylinders of 625 * 512 = 320000 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x66e838de

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              13      199835    62444352    7  HPFS/NTFS
[root@server ~]#

Here /dev/sdb1 is the windows partition to be mounted and accessed. Here 't' denotes the type of file system
[root@server ~]# mount -t ntfs-3g /dev/sdb1 /mnt
[root@server ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda5       9.7G  527M  8.7G   6% /
tmpfs           625M   80K  625M   1% /dev/shm
/dev/sda2       194M   49M  136M  27% /boot
/dev/sda6       9.7G  150M  9.0G   2% /home
/dev/sda7       9.7G  3.0G  6.3G  33% /usr
/dev/sda3        15G  475M   14G   4% /var
/dev/sdb1       932G  233G  700G  25% /mnt    --------> this is mounted now

Now you can access the partition and perform your work.
To perform permanent mount, edit the entry in fstab as:
[root@server ~]# vi /etc/fstab

/dev/sdb1       /mnt   ntfs-3g  ro,umask=0222,defaults 0 0


And reboot. To mount the FAT filesystem, perform like the following

[root@server ~]# mount -t vfat /dev/sdb1 /mnt
For permanent mounting FAT system, add the fstab entry as:
/dev/sdb1       /mnt   vfat  ro,umask=0222,defaults 0 0

Thats all. We appreciate for comments.

Thank you.

Install, Configure and Test PHP on linux machines

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. It is a fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

Installing PHP
# yum install php

1. Increasing PHP script memory limit</span>
# vi /etc/php.ini
replace memory_limit = 16M to memory_limit = 128M

2. Increasing PHP script max execution time
# vi /etc/php.ini
replace max_execution_time = 30 to max_execution_time = 120

3. Increasing PHP script max upload size
# vi /etc/php.ini
replace max_upload_size = 2M to max_upload_size = 50M

4. # vi /etc/php.ini
replace post_max_size = 8M to post_max_size = 50M

Additional steps
# mkdir /usr/share/phpinfo
# vi /usr/share/phpinfo/index.php
<?php
phpinfo();
?>

Change permissions on the index.php
# chmod 0755 /usr/share/phpinfo/index.php
# vi /etc/httpd/conf.d/phpinfo.conf
# phpinfo - PHP utility function for displaying php configuration
#
# Allows only localhost by default

Alias /phpinfo /usr/share/phpinfo
<Directory /usr/share/phpinfo/>
order deny,allow
deny from all
allow from 127.0.0.1
</Directory>

Restart Apache Server
# /etc/init.d/httpd restart
# service httpd restart
Testing

On any browser you have installed, point the URL as http://localhost/phpinfo

linux log files, location and description

Linux stores logs of almost everything from user accounting to system halts. These logs are always useful to debug problems or track the loophole of any configurations. Logs are the records of system activity to assure the faults, traffic activities, configuration logs, user activity logs. Main Linux log files are situated at /var/logs by default. While it is also possible to define the log file in a custom path in the configuration files and this is usually not recommended. Major log files in Linux are described below.

/var/log/messages -------->contains standard I/O logs, DNS logs, DHCP, NFS, NIS
/var/log/boot.log  -------->contains boot time logs about system shutdown, reboot
/var/log/dmesg     -------->hardware specific logs
/var/log/xferlog     -------->logs of FTP actities includes uploads, downloads, user processes
/var/log/samba      -------->logs of samba services(windows)
/var/log/httpd/*     -------->logs of all web activities, apache web server
/var/log/secure      -------->logs of SSH, telnet and authentication services
/var/log/cups/*      -------->logs of print activities
/var/log/cron         -------->logs of system activities from cron jobs
/var/log/xorg/*      -------->GUI related logs
/var/log/auth.log    -------->Authentication related logs
/var/log/kern.log   -------->Kernel logs
/var/log/maillog      -------->mail server logs
/var/log/mysqld.log -------->logs from mysql activities
var/log/yum.log      -------->logs of yum activities includes packages downloads

Besides these, log files are created automatically after each package configurations.