richielky
Cadet
Cadet
  • 46 Views

Can Hard Link, link to different file systems?

Can Hard Link, link to different file systems?  Or different partitions?

I'm seeing Invalid cross-device link error.

Labels (1)
0 Kudos
1 Reply
ricardodacosta
Moderator
Moderator
  • 29 Views

Re: Can Hard Link, link to different file systems?

Quick answer: no

A bit longer answer:

Users have IDs -> uid

Processes have IDs -> pid

Files have IDs -> inode

An inode exists for every file on a filesystem and describes the file (things like ownership, permissions, timestamps, paths to the blocks that make up the content of the file). But the inode doesn't record the filename - that's the responsibility of the filesystem. The filesystem has a mapping of filename:inode.

A hard link is effectively filename[*]:inode or filename1:inode1 and filename2:inode1

That means that filename1 and filename2 will be the same file (same ownership, permissions, timestamps, data blocks, etc). All that the filesystem is doing is taking another name and associating it with an inode.

Because inodes are unique to a filesystem, and hard links are mappings of name:inode, you cannot create links across filesystems.

0 Kudos
Reply
Loading...
Join the discussion
You must log in to join this conversation.