Life of student

All about Programming , C++ ,Fedora

Auto mount drives in linux

Posted by pankaj4u4m on November 28, 2009

I was just searching for how to enable the mounting the drives at start up because I didn’t find authorization menu in Fedora 12.

I found one solution and it is working for my system

open terminal and do following commands:

[codegambler@localhost /]$ su

[root@localhost /]#vi /etc/selinux/config'

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
#       targeted - Targeted processes are protected,
#       mls - Multi Level Security protection.
SELINUXTYPE=targeted

change the hi-lighted line as given;

[root@localhost /]# vi /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

now add following lines:
su -c 'mount -t ntfs-3g /dev/sda2 /media/windows -O uid=500,rw,fmask=0000,dmask=0000'
su -c 'mount -t ntfs-3g /dev/sda3 /media/srudy_fun -O uid=500,rw,fmask=0000,dmask=0000'

it is for my system


Now whenever you will restart your system you no need to mount again:
Happy fedora :)

About these ads

One Response to “Auto mount drives in linux”

  1. Can’t you add it to /etc/fstab?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: