Create a hardlink from the network

6

I'm trying to create an NTFS hardlink over a network drive:

  • I'm using Windows an XP SP3 workstation
  • mapped drive F: over a Windows 7 Server with

    net use f: \\server\shared_folder

  • then I try

    fsutil hardlink create new_entry existing_file

That works locally on the server, but not when I try to do it over the network using the mapped drive (F:). The error shown is:

The FSUTIL utility needs a local NTFS drive

(or somewhat like that, my error message is in Spanish)

Is there any way to create the hardlink from the network share or should I access the physical server remotely every time I need to create a hardlink?

PabloG

Posted 2012-10-18T14:25:03.540

Reputation: 819

Answers

6

You cannot create a hardlink to a remote drive, or even between two local drives. A hardlink must point from one point in a filesystem to another point in that exact same filesystem.

What you want is a symbolic link, which acts more like a shortcut, and can point to remote files or shares.

Darth Android

Posted 2012-10-18T14:25:03.540

Reputation: 35 133

1yes, I'm aware that hardlinks only works over the same filesystem, but I wanted to create that hardlink over the same network filesystem. Symbolics links doesn't work for me, because the application program that uses the files apparently checks the directory entry of each linked file and reports them as "corrupt". – PabloG – 2012-10-18T14:45:13.373

1@PabloG Ah, then no, you must simply create them remotely. Windows shares use a protocol called CIFS, which doesn't expose the ability to create hardlinks. Creating hardlinks requires knowing intimate data about the destination filesystem, and that could create security issues. – Darth Android – 2012-10-18T15:23:31.637

1ok then, I'm going to use PsExec from SysInternals to run the fsutil command from any machine from the network, thx – PabloG – 2012-10-18T16:05:18.783

Technically I think SMB is a superset of CIFS, but neither supports creating hardlinks AFAIK. – Harry Johnston – 2012-10-18T21:30:15.760

@HarryJohnston SMB is the same thing as CIFS

– Darth Android – 2012-10-18T21:31:41.427

1

That article is wrong, although my previous comment wasn't quite right either. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365233%28v=vs.85%29.aspx

– Harry Johnston – 2012-10-18T21:36:19.420

1

See also http://serverfault.com/a/397791/94065 and http://serverfault.com/a/370275/94065 for examples that the distinction between SMB and CIFS is not entirely theoretical.

– Harry Johnston – 2012-10-18T23:11:52.897

3

I use this command to create symbolic links on windows (almost aways in my web server folders of xampp). This is an example to use that:

mklink /D "C:\mySMBremoteServer" "\\server\shared_folder"
  • mklink -> command to create links
  • /D -> create a simbolic link (manage the same folder remotely)
  • "Locale_folder" -> path to make the local link
  • "remote_link" -> path to the samba server

I leave here the manual mklink Windows manual and I hope it helps.

SPANISH TRASLATION

Yo uso este comando para mi servidor local de xampp ya que no hay manera de crear carpetas virtuales... si no te funciona (a mi hasta la fecha me va de lujo) prueba con la opcion /H aun que no la he probado.

Este comando lo que hace es crear un "acceso directo" al destino que quieras, modificandolo si así es necesario remotamente

Firegore

Posted 2012-10-18T14:25:03.540

Reputation: 31