Mounting NTFS Partition on RHEL 5.x

irst Setup RPMForge Repository by running this command :- wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Install DAG’s GPG Key by executing following command:-
rpm – -import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

Verify the package you have downloaded:-
rpm -K rpmforge-release-0.3.6-1.el5.rf.*.rpm

Install the package :-

rpm -i rpmforge-release-0.3.6-1.el5.rf.*.rpm

or if you dont find packages here try some other repositories like rpmfusion, epel hope you will get it..

after this run yum list command if that runs completely
then Intall gcc packages from your RHEL CD/DVD or any other repository where gcc packages available.

GCC Packages is must for Mounting NTFS.

After GCC installed

run this command :-

yum -y install fuse fuse-ntfs-3g dkms dkms-fuse

if you are running xen kernel then only run this command

yum install kernel-xen-devel

if you are running PAE kernel then only run this command

yum install kernel-PAE-devel

Now Make Entry in your /etc/fstab file

make backup of your /etc/fstab by executing this command

cp /etc/fstab /etc/fstab.bkp

now open your /etc/fstab file in your favorite editor

vim /etc/fstab like below example

/dev/sda1          /mnt/ntfs      ntfs-3g      defaults       0  0


save & exit from file

Then execute this two commands in exact order

umount -a

mount -a

That’s it. Now You will able to see NTFS by executing df -kh or access your NTFS Volume from your mount point.

Grub & Single user mode password Protected

Hi Friends,

I am writing method that how to set up password for Grub & single user mode.

This Method will apply on RHEL 5 & Fedora 8/9/10

Open Terminal

Then login as a root. i.e.

[linuxuser@tejasbarot.com]$su – root
password :- ******

[root@tejasbarot.com ~]# grub-md5-crypt then press enter
That will ask you password
Password:- ******
Retype Password:- ******
$1$8fo8r$OZb9wjN2SsueIePblEzmt. (You will find this type of hash value)

First Backup your grub.conf because if any trouble then you can recover it. Backup your grub file by this way.

cp /boot/grub/grub.conf /boot/grub/grub.conf.bkp

To Make Grub Password Protected Copy that HASH value which was generated by grub-md5-crypt and paste it exact after title line look at below example.

vim /boot/grub/grub.conf

default=0
timeout=0
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.27.9-159.fc10.i686)
password – -md5 $1$8fo8r$OZb9wjN2SsueIePblEzmt. (This Entry will Protect Grub with Password)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27.9-159.fc10.i686 ro root=UUID=063976ce-f9ca-4ced-bb6f-e32290b0faf9 rhgb quiet vga=792
initrd /boot/initrd-2.6.27.9-159.fc10.i686.img

To Make Single User Mode Password Protected Copy that HASH value which was generated by grub-md5-crypt and paste it exact after splashimage line look at below example.

vim /boot/grub/grub.conf

default=0
timeout=0
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
password – –md5 $1$8fo8r$OZb9wjN2SsueIePblEzmt. (This Entry will Protect Single user mode with Password)
hiddenmenu
title Fedora (2.6.27.9-159.fc10.i686)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27.9-159.fc10.i686 ro root=UUID=063976ce-f9ca-4ced-bb6f-e32290b0faf9 rhgb quiet vga=792
initrd /boot/initrd-2.6.27.9-159.fc10.i686.img

Enjoy 🙂

Netmask Issue Solved In Fedora 10

In Fedora 10 there is problem in Netmask Changing. if you open system-
config-network and then you are entering STATIC IP SUBNET AND GATEWAY
that will show you all ok but after that when you click on OK then it
will not save your subnet mask. Again when you look at system-config-
network then your SUBNETMASK will replaced with your GATEWAY.

so if you want to save your SUBNET MASK permanently then follow this
procedure.

First take backup of your original /etc/sysconfig/network-scripts/
ifcfg-eth* file

then go to
cd /etc/sysconfig/network-scripts/

then
vim ifcfg-eth0

and search for NETMASK=

and then write your NETMASK right after equal to like 255.255.255.0

if any correction or mistake please let me know all your suggestions
are welcome.

Set User Quota

User Quota on Fedora 9/10, RHEL 5

Activate User Quota Temporarily:-

mount -o remount,usrquota <your-mounted-directory :-Remember By executing this command quota will activate temporarily.

Activate Quota Permanantly:-

 backup your fstab file by this way cp /etc/fstab /etc/fstab.bkp

 now open your fstab file in your favorite editor i am using vim as my editor

 vim /etc/fstab

 Make permanent entry of your mounted directory like this way

Add this line with your matching information.

<partition-number> <mounted-directory> ext3 defaults,usrquota 0 0

 save & exit

 Now execute this two command in correct order.

1. umount -a

2. mount -a

 quotacheck <your-mounted-directory> :- by Executing this command one file will create in your quota applied directory with file name aquota.user

 quotaon <your-mounted-directory> :- by executing this command quota will turn on on your mounted directory.

 edquota <username-on-which-you-want-to-apply-quota> :- By executing this command one file will open & in that file you need to make changes as per your requirement.

 Below Example will show you how that file look like.

 

Example of quota file :-

 Disk quotas for user <user-name> (uid 500):

Filesystem                 blocks soft hard inodes soft hard

<partition number> 36         0       0     9        0    0

 

 Change Blocks’s Soft & Hard as per your requirement.Do the same for inodes’s soft and hard as per your requirement.

 After made changes in that

Save & Exit.

That’s it. Quota Applied Successfully.

 What is blocks & inodes ? Read below for small description.

 Description of Blocks & Inodes:-

              blocks: 1k blocks

  • inodes: Number of entries in directory file

What is Soft & hard ? Read below for small description.

Description of Soft & Hard:-

                Soft: Max number of blocks/inodes user may have on partition before warning is issued and grace          period countdown begins.If set to “0” (zero) then no limit is enforced.

  • hard: Max number of blocks/inodes user may have on partition. 
    If set to “0” (zero) then no limit is enforced.

You can see quota report by using below command

repquota <your-mounted-directory>