20

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?"

rymo
  • 523

5 Answers5

12

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.

rymo
  • 523
6

I know this thread is pretty outdated, but lately I've had the same problem (I needed to move some windows system folders to another drive) and here is simple solution.

In Windows, copy (not move) the folder into new location and create symlink to it with slightly different name (so no collision occurs) and then in Linux simply delete original folder and rename symlink to original folder name. Restart and it's working. Used systems were Windows 8.1 and Ubuntu 14.04.

Lubo

Lubo
  • 61
  • 1
  • 1
4

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/

If needed: sudo apt-get attr

# 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
0

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.

-1

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
Compholio
  • 121