file systems like ext3/ext4 uses i-nodes to store file meta-data (mode, atime, ctime, mtime, uid, gid, size, links_count, acl etc.)
i-node table is a linear array of struct ext4_inode. this struct ext4_inode has field i_links_count. that refers to hard link count.
whenever new hard link to file is created this link_count value of that files i-node is incremented.
e.g.
ls -l /home/raju/test.sh
-rwxrwxrwx 2 raju raju 287 Aug 23 23:19 /home/raju/test.sh
here 2 is link count.
different volumes have different i-node tables.
directory is flat file that maps file names to an i-node number on the filesystem.
directory entries across the filesystem that reference the same i-node number--these are known as hard links.
directory entry of one filesystem (volume1) can not reference i-node which is on different filesystem (volume2).
so ln fails with invalid cross-device link error.
but you can always create symbolic links to files on different filesystems/ volumes.
symlinks do not use i-node to reference file they use file path names. check link target of symlink.
reference: https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Table