Can Hard Link, link to different file systems? Or different partitions?
I'm seeing Invalid cross-device link error.
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.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.