How to mount a NTFS hard drive in read write mode

Let's take a simple scenario where a user has two hard drives of 500GB each. First hard drive holds the Windows OS and second one our favour Linux distribution. Our example we assume that the Linux distribution is Debian but instructions are generic so wont be any problem using any other Linux distribution like Fedora, OpenSuSE, Mandriva, ubuntu etc.

First be sure that you indeed have two drives:

stelios@pappous:~$ sudo fdisk /dev/sda

The number of cylinders for this disk is set to 229504.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 500.1 GB, 500107862016 bytes
224 heads, 19 sectors/track, 229504 cylinders
Units = cylinders of 4256 * 512 = 2179072 bytes
Disk identifier: 0xda3fa674

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          49      102400    7  HPFS/NTFS
/dev/sda2              49      229504   488280557+   7  HPFS/NTFS

Command (m for help): q
 

stelios@pappous:~$ sudo fdisk /dev/sdb

The number of cylinders for this disk is set to 60801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000e8cc7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        4863    39062016   83  Linux
/dev/sdb2            4864       60801   449321985    5  Extended
/dev/sdb5            4864        5106     1951866   82  Linux swap / Solaris
/dev/sdb6            5107       60801   447370056   83  Linux

Command (m for help): q

stelios@pappous:~$ sudo fdisk /dev/sdc

Unable to open /dev/sdc

The above message means that no third drive exist into your desktop.
Next step is to install the required software, those are: libfuse2 and ntfs-3g. Install both simply using the apt:
apt-get install libfuse2 ntfs-3g

Next edit /etc/fstab and add an entry for your Windows hard drive (sda in our case):
stelios@pappous:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
#              
proc            /proc           proc    defaults        0       0
/dev/sdb1       /               reiserfs notail          0       1
/dev/sdb6       /home           reiserfs defaults        0       2
/dev/sdb5       none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
/dev/sda2       /media/windows  ntfs-3g defaults                0       0

In the example above, the last line shows the proper syntax of mounting a Microsoft Windows drive through Linux automatically uppon reboot.

Reboot your machine and done.

Posted on: 03/11/2010








0 Comments
If you want to leave a comment please Login or Register