Question: User access to NTFS partition?
Posted by schwarzemann on Sun 18 Sep 2005 at 12:25
I have recently installed Sarge on my PC with the intent on moving to Linux as my primary desktop OS. Since most of my Linux experience is with Red Hat 6.2 (as in I haven't really touched Linux since 1999), I am a little rusty and needless to say a few things have changed in the world of computers since then.
I have not been living without a computer all this time; just have not been using Linux. That being the case I have a decent amount of data stored on a second hard disk in my primary box.
When I installed the second drive I decided to format it w/NTFS, since I was using Windows2000 and making the move to XP. Unfortunately now I have some 100+ gigs worth of data that I cannot access from Linux, that is w/out logging in as root.
My question is this: What are the options/permissions required in "fstab" to allow a non-root user to mount, and more importantly read, an NTFS partition?
/dev/hda5 /mnt/bgates ntfs user,noauto,uid=me,gid=me,umask=000 0 0
The user and noauto options let ordinary users to mount/unmount the system, and the noauto option prevents it from being mounted at system startup.
[ Parent | Reply to this comment ]
[ Send Message | View calibration's Scratchpad | View Weblogs ]
[ Parent | Reply to this comment ]
For example :
/dev/hda1 /mnt/hda1 ntfs rw,users,umask=022 0 0
It works fine ;-)
Take a look on :
http://www.dclug.org.uk/archive/2005/01/msg00459.html
[ Parent | Reply to this comment ]
The guide is for Ubuntu but the same principle applies as Ubuntu is just Debian Sid + extras:
[ Parent | Reply to this comment ]
ubuntuguide.org seems to be down.
[ Parent | Reply to this comment ]
Not sure why it's down but somebody raised this on the mailing lists, and there's a mirror at:
[ Parent | Reply to this comment ]
/dev/sda1 /mnt/windows ntfs ro,user,noauto,gid=6,umask=0227 0 0
[ Parent | Reply to this comment ]
/dev/hda1 /mnt/c ntfs user,uid=1000,nosuid,gid=1000,noexec,nodev 0 0this is for a single-user desktop system where "1000" is the uid of the one non-privileged user allowed to read this partition.
if my memory serves me right, i believe i had to install the libntfs5 package to enable NTFS functionality (please correct me if i'm wrong, everyone).
also note that this only allows read access to the given partition.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
As far as I am aware, NTFS write support does exist in Linux though it is very experimental and prone to corruption.
What I have found to be the best soloution is to have a third partition that both OS's can read and write to. This used to involve FAT32 (Which I hate), but recently I've formatted it as ext3 and used this driver:
...to enable full read/write access under XP.
It's been working solidly for several months now with me dual booting between Ubuntu/XP.
[ Parent | Reply to this comment ]
This is probably out of topic, but i've choosen to go the other way around (each work for ext3 too):
- Ext2 Installable File System For Windows: It provides Windows NT4.0/2000/XP with full access to Linux Ext2 volumes (read access and write access). This may be useful if you have installed both Windows and Linux as a dual boot environment on your computer.
- [Ext2Fsd] -- Ext2 File System Driver: This project is an ext2 file system driver for winnt/win2k/winxp.
- Explore2fs: the WIN32 explorer for Linux ex2fs partitions. Be sure to also have also a look at EXT2 IFS.
Even more out of the subject (works with cryptoloop on linux):
- CrossCrypt: Open Source AES and TwoFish Linux compatible on the fly encryption for Windows XP and Windows 2000.
- FreeOTFE: FreeOTFE: Free On-The-Fly Encryption for MS Windows XP/2000/2003.
Sorry if it doesnt help a lot for your question, i just hope that someone migth find it helpfull. I choosed that way of doing things because linux doesnt allow you to write/create new files on ntfs and because fat32 have filesize limitations. I'm using those mostly for video editing and dont get any problems due to access time while recording (Athlon 64 3000+/SATA discs). I felt the the crypto options where somehow related... (?)
Freddo.
[ Parent | Reply to this comment ]
enter root password
mkdir /mnt/ntfs
/mount /dev/hdXX -t ntfs /mnt/ntfs
exit
I don't have any fstab entries relating to my ntfs drives(dual booting) but the above works for me and gives my users read-only access (the ntfs driver will do read only, not write)
then open /mnt/ntfs in your favorite file manager
Works fine for me using Debian 3.1 (sarge)
[ Parent | Reply to this comment ]
open shell, do su
enter root password
mkdir /mnt/ntfs (this step necessary only once)
chmod 644 /mnt/ntfs (this step necessary only once)
/mount /dev/hdXX -t ntfs /mnt/ntfs
exit
open /mnt/ntfs in favorite file manager
I assume you know how to get your hard drive?
drive one= hda
drive 2=hdb
partition one on drive one = hda1 (or hda2 depending on certain things;-)
partition one on drive 2 = hdb
for me I actually type mount -t ntfs /dev/hdb1 /mnt/ntfs
you could put all that in a script and make the script accessible by root only, using gksu or whatever to prompt for root password...I just open a shell whenever I need access to winbloz drives (necessary evil), place the script on the users desktop for quick access...
[ Parent | Reply to this comment ]
Ich also would recommend the captive-ntfs driver, because then you also have write-support for the ntfs-partition. Get it here: http://www.jankratochvil.net/project/captive/
For this to work you need the orginal M$-NTFS-driver (ntoskrnl.exe, ntfs.sys) (not newer than WinXP SP1). If you install the captive-package you have several tools to integrate it in your system. For your fstab-needs, there is the program: captive-install-fstab which does the work automatically.
But be warned: For captive you need gcc and perl installed.
If you need further help, feel free to contact me.
regards PP
[ Parent | Reply to this comment ]
It is NTFS generation 3. ;)
Read and Write. And workey too..
mount /dev/hda1 -t ntfs-g3 /folder
edit fstab and put in the user,umask=022
Also explore2fs, and the other ext drivers stuff for win is extremely useful at times :)
[ Parent | Reply to this comment ]