FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Sun Jun 13, 2021 04:55



Post new topic Reply to topic  [ 7 posts ] 
streams_interface usage 
Author Message

Joined: Thu Jun 24, 2010 12:33
Posts: 14
Post streams_interface usage
Hi,

I need to extract the attributes of windows files in linux.
I have disk on windows which has some mp3 files.
Now, i want to access those files attributes under linux.

I created usermapping file also, and mounted using streams_interface=windows and using streams_interface=xattr also.

As per man page,
cat file.mp3:Artist ....will give the Artist associated with the file.

In my case, if get below error:
cat: file.mp3:artist: No such file or directory

Can you please share the correct way to use this feature.


Mon Jul 12, 2010 10:06
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: streams_interface usage
Hi,

Quote:
I need to extract the attributes of windows files in linux.

Windows has "named data streams" whereas Linux has "extended attributes in the user name space". Both are stored the same way, which means they are different modes to access the same data.

Quote:
As per man page,
cat file.mp3:Artist ....will give the Artist associated with the file.


This is, of course, assuming file "file.mp3" exists and contains a named data stream whose name is "Artist" and whose contents points to the artist. Otherwise you have to replace "file.mp3" by your actual file name, and "Artist" by the actual name of the existing named data stream defined in your actual file.

Quote:
Can you please share the correct way to use this feature.

See examples below :
Code:
# mount in xattr mode (default)
[cmd] mount -t ntfs -o streams_interface=xattr /dev/sda10 disk
# create a directory and a file
[cmd] mkdir disk/try
[cmd] echo file > disk/try/file
# define an extended attribute
[cmd] setfattr -v green -n user.color disk/try/file
# get the list of extended attributes
[cmd] getfattr -d disk/try/file
# file: disk/try/file
user.color="green"
# unmount
[cmd] umount disk

# remount in windows mode
[cmd] mount -t ntfs -o streams_interface=windows /dev/sda10 disk
# check the created file is present
[cmd] ls -l disk/try/file
-rw-r--r-- 1 root root 5 Jul 12 11:23 disk/try/file
# get the list of named data streams
[cmd] getfattr -n ntfs.streams.list disk/try/file
# file: disk/try/file
ntfs.streams.list="color"
# get the contents of named data streams
[cmd] cat disk/try/file:color
green
# unmount
[cmd] umount disk


Regards

Jean-Pierre


Mon Jul 12, 2010 11:48
Profile

Joined: Mon Jul 12, 2010 12:48
Posts: 2
Post Re: streams_interface usage
Thanks for an elaborate example.
I tried your given steps on two machines.
Machine 1 )
Machine configuration: Fedora 9 machine with Linux 2.6.34.1 kernel example is working fine.

Machine 2 )
Machine configuration: Ubuntu 9.10 machine with Linux 2.6.31-16 kernel .

I get following problem:

The mount in xattr mode worked. But, when I remounted in windows mode, it is not working
# remount in windows mode
[cmd] mount -t ntfs -o streams_interface=windows /dev/sda10 disk
# check the created file is present
[cmd] ls -l disk/try/file
-rw-r--r-- 1 root root 5 Jul 12 11:23 disk/try/file (Till here its working and I can see the file but permissions I see are: )
-rwxrwxrwx 1 root root 2010-07-12 15:55 /mnt/sonal/try/file


# get the list of named data streams
[cmd] getfattr -n ntfs.streams.list disk/try/file
I get "Operation not supported"

If I try to execute cat command on the 'file' in the try directory
[cmd]cat file:color
I get "cat:file:color:No such file or directory"


Can you please elaborate why I get two different results?

Regards
Sonal


Mon Jul 12, 2010 13:19
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: streams_interface usage
Hi,

Quote:
Machine 1 )
Machine configuration: Fedora 9 machine with Linux 2.6.34.1 kernel example is working fine.

Machine 2 )
Machine configuration: Ubuntu 9.10 machine with Linux 2.6.31-16 kernel .

The ntfs-3g versions might be significant.

Quote:
but permissions I see are: )
-rwxrwxrwx 1 root root 2010-07-12 15:55 /mnt/sonal/try/file

Please detail how you configured ownership and permissions (check against the manual or http://www.tuxera.com/community/ntfs-3g ... rmissions/)

Quote:
[cmd]cat file:color
I get "cat:file:color:No such file or directory"


Please post a significant set of commands, how is the reader supposed to know how the file and the named data stream were created (and please paste your own commands, not mine).

Regards

Jean-Pierre


Mon Jul 12, 2010 21:05
Profile

Joined: Mon Jul 12, 2010 12:48
Posts: 2
Post Re: streams_interface usage
Thanks Jean for pointing towards configuring ownership & permissions .
Its working now. :-)

Regards
Sonal


Thu Jul 15, 2010 10:34
Profile

Joined: Mon Jul 19, 2010 21:54
Posts: 1
Post Re: streams_interface usage
By default, files and directories are owned by the user and group of the mounting process and everybody has full read, write, execution and directory browsing permissions. If you want to use permissions handling then use the did and the gid options together.


Tue Jul 20, 2010 19:29
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: streams_interface usage
Hi,

Quote:
If you want to use permissions handling then use the did and the gid options together.

And get some degenerated permissions handling.

Regards

Jean-Pierre


Tue Jul 20, 2010 20:57
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.