2016-11-15 07:12 PM
volume A contains 2 qtrees: tree1 and tree2
If I create a file in qtree1, and then try to create a hard link in tree2 for the file, it will complain "Invalid cross-device link." So it seems to me a qtree is like a volume having its own file system. In other words, say in qtree1 a file has inode 11111, it's possible in qtree2 there a file also having inode 11111. Is it correct?
I know hard links should be avoided in general but unfortunately the data set i am dealing with already have alot of hard links and I need to migrate them from isilon to NetApp.
2016-11-21 08:58 AM
Qtrees are not considered file systems from a hard link perspective.
Instead, use symbolic links.
[root@centos7 qtree2]# ln /nfs/qtree1/file1 file1_link
ln: failed to create hard link ‘file1_link’ => ‘/nfs/qtree1/file1’: Invalid cross-device link
[root@centos7 qtree2]# ln -s /nfs/qtree1/file1 file1_link
[root@centos7 qtree2]# ls -la
drwxr-xr-x 2 root root 4096 Nov 21 2016 .
drwxr-xr-x 6 root root 8192 Nov 21 09:47 ..
lrwxrwxrwx 1 root root 17 Nov 21 2016 file1_link -> /nfs/qtree1/file1
-rw-r--r-- 1 root root 0 Nov 21 09:49 file2
2016-11-24 02:00 PM
thanks for the info. The problem is I am migrating data from Isilon and it has alot of hard links. I have to create qtrees to keep the quota setups similar to the Isilon so there are many qtrees under the volume. When I copy files from Isilon to NetApp, it fails with "invalid cross-device link" error as you described because the hard links go across qtrees. I doubt there is a way to work around this. Any suggestions?