3

Is it even possible to do so? I mean, can I create a link on Linux and than make this link valid also on Windows?

Use-case

I have the folder /media/Data/DownloadedMusic on a NTFS partition. I also have the folder /media/Data/Music on the same partition. How can I create a link to DownloadedMusic inside Music so that the link can be accessible both from a Linux system and a Windows system?

  • This is dependent on the filesystem, but yes this can be done with hardlinks if you use ntfs as filesystem. – Anthon Oct 25 '14 at 8:24
  • added further infos in the OQ – tigerjack89 Oct 25 '14 at 9:00
0

There isn't a single command/method that I've seen that will give you this easily, but rather you'll have to create this linkage yourself using a variety of components.

For starters, on Linux you can have the system automount the NTFS partition via the /etc/fstab file anytime that it boots.

/dev/sda2   /mnt/somedir ntfs-3g    permissions,locale=en_US.utf8    1   2

Then within the NTFS partition, while it's booted to Windows, you could create a junction point or symbolic link inside the directory C:\Data\Music to C:\Data\DownloadedMusic.

I have not tried this before but it looks like you can also do this from the Linux side using the setattr command to create a junction point.

# Display the reparse data of the file source-file
$ getfattr -h -e hex -n system.ntfs_reparse_data source-file

# Copy the reparse data of the file source-file
# to the file target-file
$ REPARSE=`getfattr -h -e hex -n system.ntfs_reparse_data source-file | \
         grep '=' | sed -e 's/^.*=//'`
$ setfattr -h -v $REPARSE -n system.ntfs_reparse_data target-file 

References

0

Windows can't read the Linux filesystem. However Linux can read the Windows filesystem. So if you have your /media/Data/Music on a Windows file system you can have access to that space (the same files) on both Windows and Linux. However, if it's on a Linux filesystem you can only have access to it from Linux.

Making a Windows Filesystem (NTFS) would be the absolute answer. However, you loose functionality with the windows FS over the linux FS.

You could solve this by making a Linux fileserver and placing your music data on the server. Then you can have a the same link from Linux (via samba) and Windows (via it's native networking).

A linux fileserver doesn't require a lot of PC power. You can take an old PC that is ready for the dump, put the minimum linux configuration and a hard drive in it and have a very convenient drive access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.