how to access NTFS partition on WIN XP from Debian linux?
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You have to mount drives before you can access them. If you only need read-only access for NTFS, then you can mount command with the option "-t ntfs". See "man mount" for more info on the command.
But because NTFS has not been fully reverse-engineered yet, write support for it is currently a rather dangerous option. You can easily corrupt the file system if you do.
There is another option though. There's something called Captive-NTFS, which takes the original Windows ntfs driver and puts a wrapper around it to make it work under Linux. But I believe you need to have get the driver yourself from a licensed Windows installation.
There may be other, newer options that I don't know about, but this is what I've heard works. I've never needed it myself, so I'm a little out of the loop. You can find a lot of info with a Google search or two.
I followed instructions above, but still does not work.
Problem is files are accessble by root, but permission is denied as user.
I tried to use chmod, but failed. following is what i did:
---------------------------------------
First, I login as root, and added one line in /etc/fstab:
Second, I created directory /mnt/c.
debian:/mnt# ls -al /mnt/
total 20
drwxr-xr-x 5 root root 4096 2006-05-05 12:36 .
drwxr-xr-x 21 root root 4096 2006-02-01 17:15 ..
drwxr-xr-x 2 root root 4096 2006-05-05 12:23 c
drwxr-xr-x 2 root root 4096 2006-02-19 17:55 cdrom
drwxr-xr-x 2 root root 4096 2006-05-05 12:36 d
After, I mounted /dev/hda1.
debian:/mnt# mount /dev/hda1
debian:/mnt# ls -al
total 16
drwxr-xr-x 5 root root 4096 2006-05-05 12:36 .
drwxr-xr-x 21 root root 4096 2006-02-01 17:15 ..
dr-x------ 1 root root 8192 2006-04-25 13:08 c
drwxr-xr-x 2 root root 4096 2006-02-19 17:55 cdrom
drwxr-xr-x 2 root root 4096 2006-05-05 12:36 d
Finally, we want to chmod for /mnt/c to be readable by users.
debian:/mnt# chmod 444 /mnt/c
chmod: changing permissions of `/mnt/c': Read-only file system
----------------------------
I found the problem also.
And I resolve it by changing the options to
Code:
'defaults,nls=utf8,umask=222,ro'
And I can access it as a user.
The 'uid' and 'gid' are also a resolution, but can only assign to one user or group at a time. (Am I right?)
I don't know whether 0007 is ok, since umasks I've seen are all 3 digits.
The umask is used to set the permissions.
And you'd better put the 'umask' before 'ro', I don't know whether the order matters.
Can anyone tell me how 'umask' really works?
Is it a mask as in programming to 'OR' the permission 777?
divukman,
Thanks a lot, I followed your instructions, and it works fine.
I have some more questions.
When I use fdisk -l, I get no mount infos, it is like following
Quote:
debian:/mnt# fdisk -l
debian:/mnt#
I found some errors for hda3.
I post /etc/fstab below, anybody can show me why?
As I understand it (and learned only recently myself), the umask numbers you use in the mount command are the inverse of the permissions you want to have. If you want permissions of 777, the mount command would be umask=000. Since write permission is superfluous for a read-only drive, umask=222, which translates to 555, is all you need here.
I don't know about the last digit in the example above though. Assuming it isn't a simple error, then it could be for the special permissions like the sticky bit.
And I may be wrong, but I don't think the order of the flags matters much. I've done it both ways and haven't seen any difference.
Define the behaviour when an error is encountered. (Either ignore errors and just mark the file system erroneous and continue, or remount the file system read-only, or panic and halt the system.) The default is set in the filesystem superblock, and can be changed using tune2fs(8).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.