Tuesday, November 20, 2007

Debian: Writing to NTFS

  • Installation

On Debian Etch


First, download NTFS-3g. 2 packages are needed here: ntfs-3g and libntfs-3g. You can use wget to download them:

wget http://snapshot.debian.net/archive/2007/03/01/debian/pool/main/n/ntfs-3g/libntfs-3g0_0.0.0+20061031-6_i386.deb
wget http://snapshot.debian.net/archive/2007/03/01/debian/pool/main/n/ntfs-3g/ntfs-3g_0.0.0+20061031-6_i386.deb


Then install the dependencies:

sudo apt-get install fuse-utils libfuse2


Finally you can install ntfs-3g (using the 2 Debian packages you just downloaded):

sudo dpkg -i libntfs-3g0_0.0.0+20061031-6_i386.deb
sudo dpkg -i ntfs-3g_0.0.0+20061031-6_i386.deb




On Debian Sid, Ubuntu Edgy or Ubuntu Feisty


No need to download anything, nor to install any dependencies. Simply typing:

sudo apt-get install ntfs-3g


will do the trick.


  • Mounting partitions


Mounting partition is done quite simply. For example, this command (one line):

sudo mount -t ntfs-3g /dev/sdb1 /media/sdb1 -o umask=0,nls=utf8

(Note: might need to add 'force' option in /etc/fstab "/dev/sdb1 /media/sdb1 ntfs-3g umask=0,nls=utf8,force 0 0", if it doesn't get mounted in some cases. After that whenever we say `mount /media/sdb1` it gives following funny message "WARNING: Dirty volume mount was forced by the 'force' mount option." As if NTFS is seemed to be Dirty volume for Debian ;-) )

will mount a partition (/dev/sdb1 in that case, replace with your actual windows partition) on the /media/sdb1 directory (which must exist and be empty), using the utf8 character set (for maximum compatibility with foreign languages) and giving read/write/execute permissions to everyone.

Once you have established that this command work fine on your system, you can add an entry for it in /etc/fstab:

/dev/sdb1 /media/sdb1 ntfs-3g umask=0,nls=utf8 0 0


If you wish, you can unmount that partition in the standard way:

sudo umount /dev/sdb1


  • Tips


The output of

sudo fdisk -l | grep -i ntfs

will tell you the location of your windows partition.


Reference :
http://technowizah.com/2006/11/debian-how-to-writing-to-ntfs.html


  • Troubleshooting:

If in a case sdb1 device is suddenly removed from your /dev dir, that means the system has lost support for USB devices i.e kernel is not able to recognize it (USB storage devices), check out this;

$> lsmod | grep usb_storage

if nothing gets displayed do

$> modprobe usb_storage

$>
lsmod | grep usb_storage

usb_storage 72736 2
ide_core 112392 2 usb_storage,generic
usbcore 114372 5 usbhid,usb_storage,ehci_hcd,uhci_hcd
scsi_mod 125160 5 sg,sr_mod,usb_storage,sd_mod,libata

if the later command gives you o/p like this, u've got the USB support back :-)

Labels:

0 Comments:

Post a Comment

<< Home