Tuesday, April 2, 2013

Automount NTFS Partition

According to wikipedia, Disk partitioning is the act of dividing a hard disk drive into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks, so that different filesystems can be used on each partition.

A partition editor software program can be used to create, resize, delete, and manipulate these partitions on the hard disk. A partition consists of a range of cylinders of a hard drive -- i.e. each partition is defined by both a start and end cylinder (the size of cylinders varying from disk to disk).

People usually got their hard disk partitioned because of these reasons :
1. Having multiple operating system deployed.
2. Separate the operating system with data for backup purpose.
3. Used as a shared partition between multiple operating system.

In Linux OS, the partition usually not mounted until the user manually mount them by command using terminal or clicking it at explorer program.

It is become a problem if for example, the dropbox folder or maybe the thunderbird email saved folder is placed on separated partition so the software will not synchronize their folders until the user mounts the partition.

To solve that, we need to automount it so the partition will be mounted each time the computer is turned on.

Okay here is what i did :
Open the terminal and type sudo fdisk -l to get information of the partition.

The list of partition available. At the picture, the data partition is /dev/sda6.

If you are not sure which partition you want to automount (i.e. so many partitions with almost the same size), just mount it from the explorer by clicking it and then type sudo gparted to open the gparted software.

Mounting a partition needs root password.

From gparted we get the information that the partition is mounted at /media/data and the partition is /dev/sda6.

Next step, we have to edit fstab file located in /etc.

note : fstab, file system table is a system configuration file.

open the terminal console and type sudo nano /etc/fstab or if you're running SolydX you can type sudo mousepad /etc/fstab. 

nano editor.










mousepad editor at SolydX.

add this line at the bottom of the window :

/dev/sda6     /home/tuktuk22/data    ntfs     default,uid=1000    0    0




note :
/dev/sda6 - is the hard disk partition.
/home/tuktuk22/data - is the destination folder where the partition will be mounted into.
ntfs - specifies the file system type of the partition.
default,uid=1000 - use the default option, with user id=1000 (has sudo access).
0 0 - dump and fsck option.

save the fstab file, and reboot the machine.


The partition automatically mounted on data folder.


No comments:

Post a Comment