We will learn how to mount a Windows NTFS partition as
writable (and readable) under Debian Linux. As you must have noticed that
under GNOME, Debian mounts your Windows NTFS partition as only
readable
using gnome-volume-manager
package. However this is not very useful if you want to copy some data to
your Windows partition in Linux. Let’s get started...
First you need to find out what is the partition number of your NTFS partition. You can use any tool like fdisk or cfdisk.
Using fdisk:
~ # fdisk -l | grep -i ntfs /dev/sda1 * 1 3315 26627706 7 HPFS/NTFS ~ #
or using cfdisk:
~ # cfdisk /dev/sda
In this example, the NTFS partition is /dev/sda1
. You can
substitute your own.
Note: If you are using the default Debian Lenny kernel (2.6.26) that gets installed then you can skip this step and go to Step 3.
In case if you are like me using a custom compiled kernel then you need to check first if FUSE support is there in your kernel or not. Give the following command:
# cat /boot/config-2.6.26-custom | grep FUSE
You should either get:
CONFIG_FUSE_FS=m
CONFIG_FUSE_FS=y
If you do not see any one of the above output then you will need to re-compile your kernel with FUSE support.
To mount NTFS as read-write you will need the ntfs-3g utility from the Linux-NTFS project.
~ # apt-get update ~ # apt-get install ntfs-3g
~ # mkdir /mnt/windows ~ # mount -t ntfs-3g /dev/sda1 /mnt/windows
Note: You can see if the partition mounted correctly or not by giving following command:
~ # ls /mnt/windows AUTOEXEC.BAT pagefile.sys setup.log Shortcut to Desktop.lnk boot.ini Garmin PDOXUSRS.NET System Volume Information Config.Msi IO.SYS Program Files TEMP CONFIG.SYS MSDOS.SYS Quarantine WINDOWS Demo Album NTDETECT.COM RECYCLER YServer.txt Documents and Settings ntldr SETUP ~ #
Instead of giving mount command (like above) every time we boot into
Linux, we can make this mount permanent so that the NTFS partition will mount
automatically every time you boot into your Linux system. Just add the
following line to your /etc/fstab
file:
/dev/sda1 /mnt/windows ntfs-3g defaults 0 0
Save the file and next boot the NTFS partition will be mounted automatically.
You can un-mount the partition by giving the standard command:
~ # umount /dev/sda1
Happy writing to your NTFS partition.
Note: There might be other solutions/ways to mount NTFS as writable but I have not tried those...