FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Fri May 07, 2021 02:49



Post new topic Reply to topic  [ 7 posts ] 
Create Volume junctions under Linux 
Author Message

Joined: Tue Mar 04, 2014 05:54
Posts: 4
Post Create Volume junctions under Linux
I am doing a research on how to create NTFS volume mount point under Linux. The NTFS volume mount points (volume junctions) created by Linux are required to be able to automatically mount under Windows 7 system.

Can anybody help to clarify if NTFS-3G can do it or not?

Thanks a lot!


Tue Mar 04, 2014 09:42
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Create Volume junctions under Linux
Hi,


Quote:
Can anybody help to clarify if NTFS-3G can do it or not?

It can, see http://www.tuxera.com/community/ntfs-3g ... ljunctions

Regards

Jean-Pierre


Tue Mar 04, 2014 13:54
Profile

Joined: Tue Mar 04, 2014 05:54
Posts: 4
Post Re: Create Volume junctions under Linux
Hi,

Thanks for your response!

I did a quick try but could not make it, I don't know what I might be missing.

Here is the details I did on Linux side:

The requirements:

[*]I have 2 partitions (both NTFS file system) in a hard drive: /dev/sda1, /dev/sda2
[*]On /dev/sda1, I need to implement a NTFS mount point, we say \DATA\, on which /dev/sda2 should be persistently mounted.

What I did under Linux (I am working on TinyCore) was:

[*]Under Linux, I made the partitions and formatted the file systems by NTFS-3G;
[*]Retrieve the UUID of the second partition by
Code:
#blkid /dev/sda2
/dev/sda2: LABEL="DATA" UUID="445E508E781319C7" TYPE="ntfs"

[*]Create a symbolic link <DATA> in /dev/sda1 file system and let it target to the volume /dev/sda2, like:
Code:
/mnt/sda3# ln -s ../../.NTFS-3G/Volume{445E508E781319C7} DATA


However, after I was done with above procedure, and plugged this hard drive into a Windows7 system, the volume junction DATA appears not a volume mount.

Did I miss something?


Wed Mar 05, 2014 04:05
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Create Volume junctions under Linux
Hi,
Quote:
[*]Retrieve the UUID of the second partition by
Code:
#blkid /dev/sda2
/dev/sda2: LABEL="DATA" UUID="445E508E781319C7" TYPE="ntfs"

blkid returns the "serial number" of the ntfs file system. To get its volume uuid, you have to use ntfsinfo :
Code:
ntfsinfo -fvi 3 /dev/sda2

Dumping Inode 3 (0x3)
[...]
Dumping attribute $OBJECT_ID (0x40) from mft record 3 (0x3)
[...]
Object ID:       9db948be-debc-4ccc-a1b9-8510a1482d12
[...]

This uuid is optional, so Linux uses the serial number instead. More on this below.
Quote:
[*]Create a symbolic link <DATA> in /dev/sda1 file system and let it target to the volume /dev/sda2, like:
Code:
/mnt/sda3# ln -s ../../.NTFS-3G/Volume{445E508E781319C7} DATA

This creates a Linux symbolic link to a file named "Volume{445E508E781319C7}", it does not create a Windows volume junction (which is a concept unknown to Linux, relying on reparse data). You have to create a void directory (say DATA) and define reparse data on it. Forget about the .NTFS-3G directory which aims at the opposite of what you want to achieve.

With ntfs-3g, reparse data are mapped to system extended attributes, and you can get or set reparse data as shown in http://www.tuxera.com/community/ntfs-3g ... eparsedata However I do not know whether extended attributes are implemented in TinyCore. You should first try duplicating existing volume junctions.

Moreover, AFAIK the uuid mentioned in a volume junction is not the uuid of the file system, but the uuid of a physical device. For instance an uuid is associated to a drive letter, not to the usb key you plugged in.

Please report your findings.

Regards

Jean-Pierre


Wed Mar 05, 2014 10:08
Profile

Joined: Tue Mar 04, 2014 05:54
Posts: 4
Post Re: Create Volume junctions under Linux
Really appreciate!

I tried the get and set reparse data and it is working for the same hard drive, that is to say, if I at first created a volume mount point under Windows7, then I can clone any copies of the same volume joint under TinyCore linux.

But if I changed another hard drive and tried to re-use the same reparse data above, it is not working.

Is there any way to from scratch build up such kind of reparse data in specific to the hard drive under Linux, rather than cloning it from Windows' made? Since my project is based on Linux.


Wed Mar 05, 2014 11:17
Profile

Joined: Tue Mar 04, 2014 05:54
Posts: 4
Post Re: Create Volume junctions under Linux
And BTW, by using the command <ntfsinfo -fvi 3 /dev/sda2>, it outputs a bunch of info, but I didn't see any <Object ID> or similar kind of UUID data. I was using <mkntfs -Q /dev/sda2> for making the file system.

Is there any way NTFS-3G provides to modify the UUID of the volume?


Wed Mar 05, 2014 12:17
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: Create Volume junctions under Linux
Hi,

Quote:
And BTW, by using the command <ntfsinfo -fvi 3 /dev/sda2>, it outputs a bunch of info, but I didn't see any <Object ID> or similar kind of UUID data. I was using <mkntfs -Q /dev/sda2> for making the file system.

Is there any way NTFS-3G provides to modify the UUID of the volume?

This means the uuid of the volume was not set (it is optional). There is a protection preventing from setting the metadata of a volume mounted on Linux, you can only set the uuid while formatting the volume (option -U of mkntfs). Anyway AFAIK the uuid mentioned in a volume junction is not the uuid of the volume, so you probably do not need to set the uuid of the volume.
Quote:
Is there any way to from scratch build up such kind of reparse data in specific to the hard drive under Linux, rather than cloning it from Windows' made? Since my project is based on Linux.

You first have to determine what the uuid mentioned in a volume junction is about. Try on Windows plugging different usb keys so that they are seen with the same drive letter, try plugging the same usb key on different Windows systems, try plugging again a usb key so that it appears with the same drive letter or another one, etc.

This might be a Windows configuration issue, and you may have to dig in the Windows registry. You may get better help in a Windows oriented forum.

Regards

Jean-Pierre


Wed Mar 05, 2014 12:54
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 4 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.