AUTO MOUNT THE PARTITIONS IN LINUX

Hi Friends….

To Enter in to root usermode
Go to       => Terminal
Then Type => su
It asks for password.Give the root password.If u don’t set the root password set the root password first.
In ubuntu it is in
System => Administraton => Users and Groups
set the password and back to terminal

There is a file called /etc/fstab in your Linux filesystem.It’s config file that contains about all partitions and storage devices.
It’s a plain text file.In order to edit this file u must be login as root or login via terminal mode.

1)Overview
If u see the file in /etc/fstab it looks like

/dev/sda8 / ext3 defaults 1 1
/dev/scd0 /cdrom auto user,noexec,utf8 1 1
/dev/sda9 / swap defaults 0 0

There are six columns are there!Lets see wat’s that

2) 1′st & 2′nd Column ==>> Partion & Mount point

First column contains the partition name,Second column contains where to mount the partition that is Mount Point.
For above example

/dev/sda8 /media/DATA

DATA is directory u must created in the /media folder

What does it means
$mount /dev/sda8 /
It will mount the sda8′th partition on the / Mount Point.

3) 3′rd & 4′th Column ==>> FileSystem type & Mount Options

Third column consist of the file system type.

ext2 and ext3: Most Linux system have this type as defaults.

fat and ntfs: Your Windows partitions are fat and ntfs.Windows 9x series(95,98) are have the Vfat type and NT series use NTFS.

swap: This is used in the swap partitions.

Fourth have mount options.
This lists the mount options that all file system have..

auto and noauto: With the auto option the partition is mounted in the time of booting.If u don’t want to mount the booting give as noauto

user and nouser: With the user mode normal users allow to mount the partition.If u give as nouser only root can mount the partitions.

exec and noexec: exec mode executes the binaries in that partition.noexec doesn’t let u do that.
exec is the default option.Accidently If u give the noexec to the Linux root partition what happens!

ro: It mount the filesystem readonly.

rw: It mount the file system in read write mode

defaults: It uses the default options that are rw,exec,user and auto

4) 5′th & 6′th column ==>> Dump and fsck options

Dump is Back up utility.If it is 0 it ignore the filesystem to back up.
fsck is the filesystem check utility.If it is 0 fsck won’t check the file system.

MAKE THE AUTO MOUNT

1)Go to root user mode

2)Then type =>fdisk -l
This will shows up the partitions u have.According to the size and priority of disks u able to identify ur windows disks.

3)Create the folder ‘DATA” in /media to mount the windows D: drive (assume D: to mount and its filesystem as /dev/sda2)

3)Edit the /etc/fstab as follows

$gedit /etc/fstab

<file system> <mount point>   <type>  <options>       <dump>  <check>

/dev/sda2        /media/DATA        ntfs           defaults            1             1

4)Do it for all the partitions!

5)Save the fstab file and restart.

That’s it…