Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a Linux utility that can create NTFS symbolic links? That is, a link on an NTFS partition that points to another NTFS folder - one that will work within Windows 7, specifically.

I wish to relocate a folder that is normally in-use while Windows is running. This machine can already dual-boot into Ubuntu, so I'd like to leverage that.

EDIT: To keep this from potentially turning into "which Windows Live CD is best", I will limit this question to "Is it possible with Linux, yes or no?"

share|improve this question
1  
Create the symbolic link on the drive slaved up in another Windows machine? –  user3914 Jul 29 '10 at 19:17
    
That's definitely an alternative, but I'm more likely to go with a boot CD than to pull the drive in this case. –  rymo Jul 29 '10 at 20:16
add comment

4 Answers 4

up vote 2 down vote accepted

By using NTFS-3G Advanced, it appears possible to treat existing junctions/NTFS links as if they were Linux symlinks, but my actual goal of creating new ones that work within Windows is a no-go:

Dereferencing junction points and symbolic links created by Windows is thus made possible, so are hard linking, renaming and deleting, but creating new ones is not.

share|improve this answer
add comment

How to make a symbolic link (aka: junction point or reparse point) on an NTFS drive from Linux. Taken from: http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/

# 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
share|improve this answer
    
Could you improve this anwser? You have not mentioned it requires sudo apt-get attr first. What is the source-file and target-file? If I want to create a link from /home/xxx/Music to /media/Storage/Music which one is the source and which is the target? –  loostro Jun 24 at 13:36
    
Also, the first part (getfattr) returns "No such attribute" no matter in I run it on /home/xxx/Music or /media/Storage/Music –  loostro Jun 24 at 13:38
add comment

Just mounting the partition under Linux and creating the link with ln -s should work. This doesn't give you access to the full complexity of NTFS links, but should be enough for your purpose.

There are two different implementations of NTFS for Linux: NTFS-3g (filesystem name ntfs-3g, Ubuntu package ntfs-3g) and Linux-NTFS (filesystem name fuse.ntfs, Ubuntu package ntfsprogs). If one of them doesn't do what you want, try the other one.

share|improve this answer
1  
I'm already mounting the partition with ntfs-3g, and it neither follows existing links/junctions, nor creates Windows-compatible links with ln –  rymo Jul 29 '10 at 21:16
add comment

It appears that the documentation for NTFS-3G is outdated, I'm using the Ubuntu version 2011.4.12AR.4-2ubuntu3 and I was successfully able to create symbolic links inside of a virtual partition. Here's the procedure I used to test this:

dd if=/dev/zero of=ntfs.image bs=1024 count=20480
mkfs.ntfs -F ntfs.image
mkdir ntfs
sudo mount ntfs.image ntfs
cd ntfs
mkdir target
ln -s ./target symlink
ls -alF
cd -
rmdir ntfs
sudo umount ntfs
rm ntfs.image
share|improve this answer
1  
The question is, would your symlink function properly if that ntfs.image were mounted under an actual Windows installation? The whole point was that I wanted to use Linux to rearrange a physical Windows partition's directory structure. –  rymo Jun 20 '12 at 4:49
    
I don't know for sure, but I would guess that NTFS-3G would not have added this feature of Windows did not recognize the link. It's important to note that you would need to load the "ntfs-3g" package if you booted to a live disk to try this, no distribution that I'm aware of includes NTFS-3G on the disk. –  Compholio Jun 21 '12 at 14:32
1  
ln -s "worked" for me in that it didn't fail, but the resulting link was not usable when mounted under Windows. If you can actually test this, let us know what happens. –  rymo Jun 21 '12 at 16:14
    
Yeah, I tried at work and these links are not recognized. It also doesn't recognize the Junction Points made on Windows though, so it's possible that I just need to upgrade my OS (currently using 11.10). –  Compholio Jun 22 '12 at 17:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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