Friday, November 26, 2010

How to automount in linux

We use /etc/fstab to automount directories in linux.
The default format of /etc/fstab is as follows:

1st column : Device (example /dev/sda1)
2nd column : Mount point (example /home)
3rd column : Filesystem type (example ext3)
4th column : Mount options (example defaults)
5th column : Dump (usually 0)
6th column : fsck (usually 0)

Since this is a short tutorial, we will not be discussing things in detail

Example:

1. Edit the /etc/fstab file

2. Add the directory that you want to automount
/dev/sda1 /home/test ext3 defaults 0 0

3. mount -a (if you want to mount the filesystems specified in /etc/fstab without restarting linux)

Read More !

Wednesday, November 24, 2010

How to mount ntfs filesystem in Linux

Mounting NTFS file system on Linux (read only mode)

1. First check for ntfs kernel support
cd /lib/modules/2.6.18-92.el5/kernel/fs/ | grep ntfs

2. List the partitions
fdisk -l
to list only ntfs partitions
fdisk -l | grep NTFS

3. Mount ntfs parition

mount -t ntfs /dev/sda1 /mnt/windows
replace /dev/sda1 with the respective parition on your harddisk
replace /mnt/windows with the respective mount on your harddisk


Read More !