3
I know hard links to directories aren't supposed to be possible but it I have something odd on my NAS that looks very much like one. This folder originally came from a linux machine and appears to have come from dfm. At some point in time it was backed up onto an NTFS-formatted USB drive which was then transferred to a Synology NAS.
dwj$ ls -la
drwx------ 1 dwj staff 16384 Mar 2 19:17 .linktorootdir
dwj$ ls -la .linktorootdir/
total 3460
drwx------ 1 shennis staff 16384 Mar 2 19:17 .
drwx------ 1 shennis staff 16384 Jul 25 23:29 ..
drwx------ 1 shennis staff 16384 Feb 26 20:20 .system_info
drwx------ 1 shennis staff 16384 Feb 26 20:20 bin
drwx------ 1 shennis staff 16384 Mar 2 19:15 dev
drwx------ 1 shennis staff 16384 Mar 2 19:17 etc.defaults
-rwx------ 1 shennis staff 1589952 Dec 11 2012 linuxrc
drwx------ 1 shennis staff 16384 Feb 26 20:20 sbin
drwx------ 1 shennis staff 16384 Mar 2 04:49 tmp
drwx------ 1 shennis staff 16384 Mar 2 19:17 usr
drwx------ 1 shennis staff 16384 Mar 2 19:17 volume1
drwx------ 1 shennis staff 16384 Mar 1 21:44 volumeUSB2
Output of pwd; stat .linktorootdir; mount
DiskStation> pwd
/volume1/usbcopy/USBCopy_1303012145
DiskStation> ls -a
. .linktorootdir
.. Data
.DS_Store
DiskStation> stat -f .linktorootdir/ /
File: ".linktorootdir/"
ID: 1a03a45c0ea41689 Namelen: 255 Type: ext2/ext3
Block size: 4096
Blocks: Total: 719905408 Free: 654479 Available: 628879
Inodes: Total: 182845440 Free: 180250664
File: "/"
ID: 6a3b023a9a57044b Namelen: 255 Type: ext2/ext3
Block size: 4096
Blocks: Total: 612766 Free: 503152 Available: 477552
Inodes: Total: 155648 Free: 139669
DiskStation> mount
/dev/root on / type ext4 (rw,relatime,barrier=0,journal_checksum,data=ordered)
/tmp on /tmp type tmpfs (0) none on /dev/pts type devpts (gid=4,mode=620) /sys on
/sys type sysfs (0) /proc/bus/usb on /proc/bus/usb type usbfs (0)
/dev/vg1000/lv on /volume1 type ext4 (usrjquota=aquota.user,grpjquota=aquota.gro up,jqfmt=vfsv0,synoacl)
Checking inodes (per recommendation by @pabouk) with ls -lai / ; ls -lai /volume1/usbcopy/USBCopy_1303012145/.linktorootdir | head
2 drwxr-xr-x 23 root root 4096 Jul 28 19:13 .
2 drwxr-xr-x 23 root root 4096 Jul 28 19:13 ..
38 drwxr-xr-x 3 root root 4096 Apr 1 11:35 .old_patch_info
1829 -rw------- 1 root root 1024 Feb 26 20:21 .rnd
32 drwxr-xr-x 3 root root 4096 Apr 1 11:33 .syno
15315 drwxr-xr-x 2 root root 4096 Feb 26 20:20 .system_info
12 drwxr-xr-x 2 root root 4096 Apr 1 11:35 bin
89 drwxr-xr-x 10 root root 36864 Jul 28 19:13 dev
1784 drwxr-xr-x 18 root root 4096 Jul 29 09:36 etc
3380 drwxr-xr-x 17 root root 4096 Jul 28 19:13 etc.defaults
81143042 drwxrwxrwx 6 admin root 4096 Jul 29 14:50 .
30671002 drwxrwxrwx 9 root root 4096 Jul 25 23:29 ..
145895896 drwxrwxrwx 2 admin root 4096 Feb 26 20:20 bin
145895092 drwxrwxrwx 15 admin root 4096 Mar 2 19:17 etc.defaults
145753038 -rwxrwxrwx 1 admin root 1589952 Dec 11 2012 linuxrc
145753040 drwxrwxrwx 2 admin root 4096 Feb 26 20:20 sbin
145895963 drwxrwxrwx 3 admin root 4096 Jul 29 14:50 volume1
How do I remove this folder on my NAS?
Could you please show the output of following commands?
pwd ; stat .linktorootdir / ; mount
Interesting would be to compare the inode numbers – pabouk – 2013-07-29T01:31:50.507@pabouk The interesting thing is that it is pointing to root on the NAS, not on my Mac that I have the NAS drives mounted from. So
stat /
shows the Mac's inode numbers. However, the directory listing I put in the post is / on the NAS. – dwj – 2013-07-29T06:37:49.650And could you please run the commands (on the NAS)? Besides confirming that the inodes are the same it will show us the filesystem and other information. Of course from the output you can remove information which could be sensitive for you. You mentioned genesis of the files - How was the folder backed up onto the NTFS USB drive (by which tools)? How was it then transferred to the NAS? The
ls -la
output above is distorted as the "number of directory entries" value (second column) is always 1. – pabouk – 2013-07-29T08:27:39.640The various distortions are most probably caused by the network filesystem you use to access the files. It is much better to do the diagnostics on the local filesystem directly on the NAS. – pabouk – 2013-07-29T08:47:42.927
@pabouk Now that I'm running on the NAS (I didn't have ssh enabled before) I can see the inodes are different. It's really looking like I have a duplicate of the entire tree in that .linktorootdir folder! As for tools for copying to the USB drive, I don't remember; this was all done over a year ago. Copying to the NAS was via direct copy from the NAS itself. – dwj – 2013-07-29T17:17:56.610
Can you do just
ls -lai
on both to see if it's really the same inode? It could just a copy. – ott-- – 2013-07-29T20:32:37.673