Nov 132006
 

Sponsored Link

Some of ubuntu users are running their ubuntu machine as dual boot with windows and if you want to access your windows partition data using this guide in a simple manner.

This tutorial will show you how to mount NTFS and FAT partitions in ubuntu

For mounting TFS we are going to use one small tool called NTFS-3G this is very powerfull and simple tool.

The NTFS-3G driver is an open source, freely available NTFS driver for Linux with read and write support. It provides safe and fast handling of the Windows XP, Windows Server 2003 and Windows 2000 file systems. Most POSIX file system operations are supported, with the notable exception of file ownership and access right changes.

You need to edit the sources.list file using the following command

sudo gedit /etc/apt/sources.list

and add the following repositories which is suitable for you

If you are running Ubuntu Dapper enter the following lines save and exit the file

deb http://givre.cabspace.com/ubuntu/ dapper main main-all
deb http://ntfs-3g.sitesweetsite.info/ubuntu/ dapper main main-all
deb http://flomertens.keo.in/ubuntu/ dapper main main-all

If you are running Ubuntu Edgy enter the following lines save and exit the file

deb http://givre.cabspace.com/ubuntu/ edgy main
deb http://ntfs-3g.sitesweetsite.info/ubuntu/ edgy main
deb http://flomertens.keo.in/ubuntu/ edgy main

Now you need to import th GPG key for these repositories using the any one of the following command

wget http://flomertens.keo.in/ubuntu/givre_key.asc -O- | sudo apt-key add -

wget http://givre.cabspace.com/ubuntu/givre_key.asc -O- | sudo apt-key add -

Now you need to update the source list using the following command

sudo apt-get update

Install ntfs-3g in Ubuntu

If you want to install ntfs-3g run the following command from your terminal

sudo apt-get install ntfs-3g

Configuring ntfs-3g

Now you need to use the following command to determine all the available partitions

sudo fdisk -l

Now you need to configure your NTFS partitions in /etc/fstab file before doing any changes in /etc/fstab file we will take a backup of this file using the following command (Highly Recommended)

sudo cp /etc/fstab /etc/fstab.bak

Now you need to create a directory where do you mount your windows partitions in this example i ma creating windows directory

sudo mkdir /media/windows

If you want to mount /dev/hda1 is your windows partition you need to enter the following line in /etc/fstab file

/dev/ /media/ ntfs-3g defaults,locale=en_US.utf8 0 0

You need to replace your partition and mount point with your details

Example

/dev/hda3 /media/windows ntfs-3g defaults,locale=en_US.utf8 0 0

save and exit the file

If you want to mount as read only you need to enter the following line in /etc/fstabfile

/dev/hda3 /media/windows ntfs-3g ro,locale=en_US.utf8,uid=1000 0 0

If You want to change your locale option you need to run the following command in a terminal to know which one is supported by your system.

locale -a

Now if you want these new chnages to take effect there are two options one is you can simply reboot your machine and the second one is without rebooting you need to run the following commands

To unmount

sudo umount -a

To Mount

sudo mount -a

If you want to know more available options for ntfs-3g check man page

If you want to mount and unmount Windows partitions (FAT) manually, and allow all users to read and write

Follow the same procedure to get the list of your windows partitions,create a directory where do you want to mount and you do the following command from your teminal replace /dev/hda3,/media/windows/ to your environment

sudo mount /dev/hda3 /media/windows/ -t vfat -o iocharset=utf8,umask=000

If you want to mount FAT partitions on boot-up to allow users to read and write use the following command in your /etc/fstab file you can see the above procedure how to take backup of fstab file before you do any changes

/dev/hda3 /media/windows vfat iocharset=utf8,umask=000 0 0

Sponsored Link

 Posted by at 11:10 am

  45 Responses to “Mount your widows Partitions and make it read/writable in ubuntu”

  1. how come knoppix seems to do this right out of the box (so to speak)? This was one of the reasons I was turned off of ubuntu, couldn’t access my windows partition. thanks for the info, I may reinstall.

  2. I use ntfs-3g with Ubuntu edgy for about a month and I have any problem at all.
    ntfs-3g does not work if you have Windows in hibernation mode and so it is very secure and… very fast, even must faster than… in windows!
    Using linux and our “old” windows ntfs partition very practical and I have no problems even with accented Portuguese characters using the iocharset=utf8 option.
    I highly recommend ntfs-3g, been even better than a commertial alternative I tried before.

  3. One option worth thinking about would be to run Windows or ubuntu virtualy.

  4. Does not work from the live cd, only from a hd install

  5. Very good howto! I’ve been looking for a way to do this for a long time. This is simple and to the point. Works great!

  6. To get mine to work I had to comment out this line in /etc/fstab…
    # UUID=7A9C29D19C298929 /media/hdb5 ntfs defaults,nls=utf8,umask=007,gid=46 0 1

    Also, I am unable to edit the root directory my drives. I tried “sudo chmod 777 /media/documents/” and “ls -l” shows I have read/write access to that folder.
    drwxrwxrwx 1 root root 36864 2006-11-13 22:31 documents

    Thanks for the tutorial!

  7. After entering the last command, it says:
    bash: /dev/hda1: Permission denied

    What to do?

  8. could you give me the exact command you are trying and which partition you are trying to mount FAT or NTFS

  9. @Lucky

    If you are trying to mount FAT partition try this

    /dev/hda1 /media/windows vfat noauto,users,rw,exec 1 0

    and one more suggestion you can check your partition in correct like /dev/hda1 or /dev/hda5 using the following command

    sudo fdisk -l

  10. I too have the permission denied problem, what can I do?

  11. From the command sudo fdisk -l you get the name of the xp partition and nothing more, right?

  12. As you indicated ntfs-3g can read and write partitions. Therefore is there any exploit that might abuse this facility related to security issues (such as trojans transpassing between ext3 ,fat and ntfs file systems.)Thanks

  13. im using ubuntu edgy. the ntfs-3g is available from ubuntu synaptic package manager universe repo. thanks for this howto. works just fine.

  14. Excellent tutorial. I checked two other tutorials that did not work for me and I the instructions on rebooting into Windows twice is what made it work. Thanks again Debian Admin!

    I’m new to Ubuntu and have heard Debian users despise Ubuntu users since Ubuntu is more friendly/easier to use. Whats that about?

  15. Thanks for a complete step-by-step. Coming from Solaris 8, I’m still learning the debian style package manager – It was great to have the path laid out for me to follow.

  16. why i got these error?
    i’m new here…pliss tell me in details…

    W: GPG error: http://easyubuntu.cafuego.net main Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 580E2519969F3F57

  17. this error is related to PUBKEY for easyubuntu program run the following command from your terminal and press enter

    wget http://easyubuntu.cafuego.net/969F3F57.gpg -O- | sudo apt-key add -

  18. hi, how can i recover fstab?
    i’m losing my sda1..
    how can i load back fstab.bak?

  19. hi, it’s ok now.i just mount it back.

  20. i’ve mounted it on /media/windows but still can’t read & write.i’m using edgy amd64.

  21. suranjit,

    If you used the “sudo cp /etc/fstab /etc/fstab.bak” command to backup your fstab, just type “sudo cp /etc/fstab.bak /etc/fstab” and type in your password to restore it.

    After that you can just restart your system or “umount -a” then “mount -a” to remount your drives.

  22. hi, thanks for reply.i already did that but still can’t write over it.huh.it’s a pain..waurgggggghh

  23. root@ubu:~# ntfs-3g /dev/hdb1 /mnt/windows
    just followed the tutorial, and i keep getting this error, changed fstab verbatim from tutorial -> unmount -a -> mount -a. and ran ntfs-3g /dev/hdb1 /mnt/windows directly. what gives? suggests using ntfsfix, but isn’t available on my machine or in any repository i have.

    Failed to mount ‘/dev/hdb1′: Operation not supported
    Mount is denied because the NTFS journal file is unclean. Choices are:
    A) Shutdown Windows properly.
    B) Click the ‘Safely Remove Hardware’ icon in the Windows taskbar
    notification area before disconnecting the device.
    C) Use ‘Eject’ from Windows Explorer to safely remove the device.
    D) If you ran chkdsk previously then boot Windows again which will
    automatically initialize the journal.
    E) Run ‘ntfsfix’ on Linux which will reset the NTFS journal.
    F) Mount the volume read-only by using the ‘ro’ mount option.

  24. Thanks This work great and the first time

    I spent a day trying to get this to work in Fedora

    Dan

  25. I’ve made all the step correctly but after rebooting (or with the mount -a command) I get an error:

    The device ‘/dev/hda1′ doesn’t have a valid NTFS.
    Maybe you selected the wrong device? Or the whole disk instead of a
    partition (e.g. /dev/hda, not /dev/hda1)? Or the other way around?

    I think I selected properly because when I run fdisk -l I get:

    Device Boot Start End Blocks Id System
    /dev/hda1 * 1 510 4096543+ 7 HPFS/NTFS
    /dev/hda2 511 1020 4096575 83 Linux
    /dev/hda3 1021 4865 30884962+ f W95 Ext’d (LBA)
    /dev/hda5 1021 4335 26627706 b W95 FAT32
    /dev/hda6 4336 4801 3743113+ 83 Linux
    /dev/hda7 4802 4865 514048+ 82 Linux swap / Solaris

    What can it be?
    please help,

    thank you

  26. This guide worked perfectly on my Ubuntu 6.10.

    Thank you!

  27. Hi guys,

    I can’t get this bit to work:

    “Now you need to import th GPG key for these repositories using the any one of the following command

    wget http://flomertens.keo.in/ubuntu/givre_key.asc -O- | sudo apt-key add -

    wget http://givre.cabspace.com/ubuntu/givre_key.asc -O- | sudo apt-key add -”

    I just get timeouts, any other way to get the keys?

    Cheers

  28. Hi, I got it to work, thanks for the guide.

  29. Just like to add the thanks of an ubunta noob. Great article!

  30. I keep getting an error about an old FUSE kernel,
    WARNING: Old FUSE kernel module detected. This means, some driver features
    are not available (swap file on NTFS, boot from NTFS by LILO),
    and unmount is not safe unless you make sure the ntfs-3g process
    naturally terminates after calling ‘umount’. The safe FUSE kernel
    driver is included in the official Linux kernels since version
    2.6.20-rc1, or in the FUSE 2.6 software package. Please see the
    next page for more help: http://www.ntfs-3g.org/support.html#fuse26
    I went to the website and I’m unsure about what they’re telling me to install, it doesn’t seem like it was compiled for ubuntu…

  31. modprobe -l fuse
    apt-get install ntfsprogs
    /etc/fstab
    /dev/hda1 /mnt/windows ntfs-3g defaults,locale=en_US.utf8 0 0
    ntfsfix /dev/hda1
    if erorr
    /etc/fstab
    /dev/hda1 /media/windows ntfs-3g defaults,ro,locale=en_US.utf8 0 0
    mount -a
    if working

  32. Thanks for excellent info re. “If you want to mount FAT partitions on boot-up to allow users to read and write…”

    I had struggled with this for at least an hour before finding your instructions. It worked perfectly for me using Dapper.

  33. so, i got problems with this….i cannot even instal this driver, somehow i got an error in console that it “Couldn’t find package ntfs-3g”, where could i make mistake?
    i get an error when updating source list: “rr http://lt.archive.ubuntu.com edgy/main Sources
    Sub-process gzip returned an error code (1)
    Fetched 4B in 6s (1B/s)
    Failed to fetch http://lt.archive.ubuntu.com/ubuntu/dists/edgy/main/source/Sources.gz Sub-process gzip returned an error code (1) ”
    maybe its just some problem with some server that I am updating from….or something…my knowledge about this is really minimal….sorry about that ;]
    still hoping for help ;]

  34. How do I edit the fstab file? I can’t save the changes since it is read only.

  35. Nevermind figured it out

  36. # kevin Says:
    December 16th, 2006 at 9:33 pm

    root@ubu:~# ntfs-3g /dev/hdb1 /mnt/windows
    just followed the tutorial, and i keep getting this error, changed fstab verbatim from tutorial -> unmount -a -> mount -a. and ran ntfs-3g /dev/hdb1 /mnt/windows directly. what gives? suggests using ntfsfix, but isn’t available on my machine or in any repository i have.

    Failed to mount ‘/dev/hdb1?: Operation not supported
    Mount is denied because the NTFS journal file is unclean. Choices are:
    A) Shutdown Windows properly.
    B) Click the ‘Safely Remove Hardware’ icon in the Windows taskbar
    notification area before disconnecting the device.
    C) Use ‘Eject’ from Windows Explorer to safely remove the device.
    D) If you ran chkdsk previously then boot Windows again which will
    automatically initialize the journal.
    E) Run ‘ntfsfix’ on Linux which will reset the NTFS journal.
    F) Mount the volume read-only by using the ‘ro’ mount option.
    ===============

    You cannot mount a “dirty” partition. Booting windows, then doing a nice clean shutdown will likely fix things. Next time you boot to ubuntu your win partition will be mounted.

  37. Dear all,

    How to change permission ntfs file to read/write with linux command?

    Thank you.
    Rgds,

  38. Thanks for this tut, reminded me how sensitive different sytems are to fstab. Other distros allowed mount w/out entry in fstab. Ubuntu 6.10 needs the entries, I just put ‘noauto’ option on.

  39. Works like a charm.
    I am using it on Ubuntu Edgy and its working perfecly.

    Just one thing, when I did a mount, I got this msg:
    WARNING: Deficient FUSE kernel module detected. Some driver features are
    not available (swap file on NTFS, boot from NTFS by LILO), and
    unmount is not safe unless it’s made sure the ntfs-3g process
    naturally terminates after calling ‘umount’. The safe FUSE kernel
    driver is included in the official Linux kernels since version
    2.6.20-rc1, or in the FUSE 2.6.0 or later software packages,
    except the faulty FUSE version 2.6.2. For more help, please
    have a look at /usr/share/doc/ntfs-3g/README.Debian. Thanks

    I have libfuse version 2.6.3 installed.

    Any ideas? Is it still safe to use this?

  40. Thanks a lot.

    This worked very well.

  41. Thanks for the HOWTO.

    It works with Ubuntu Feisty as well.

  42. Great tutorial. It doesn`t work till I read the @Corey`s comment.

    Thanks!

  43. Just apt-get install ntfs-config

  44. Thanks buddy it helps…
    Now I can Mount NTFS at Our Ubuntu-eBox Flatform File Server.

  45. can u please suggest how to mount the windows partition (c drive) in linux after hibernating windows.
    its showing error14: the windows system is hibernated.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>