0

I have 9 directories in my home directory but when I am using ls -la command the total hard links showing is 1 (for the home directory). Although there are total 9 directories inside my home directory so the total hard link should be 9 + 2 (one for . and ..) = 11 (2 + n).

This kind of problem is also for the directories for root user and root group (like /usr). As far as I know every folder has at least two hard links plus total numer directories it contains.

But this problem is not there for the folder I have created the hard link count is 2 + (number of directories it contains).

I am very much confused. Please help ...

Using : btrfs

arka
  • 193
  • 5
  • @StephenKitt Using Btrfs ... Directory should contain (2 + n) hard links. – arka Jan 18 '22 at 17:40
  • @arka Btrfs doesn’t count hard links like that, see the linked Q&A for details (especially the bottom-most answer). – Stephen Kitt Jan 18 '22 at 17:43
  • A google search for ["btrfs link count"](https://www.google.com/search?q=btrfs+link+count) gives a few sources noting that btrfs indeed just leaves the link count at 1 for directories. Also changing it looks to have been considered, but rejected, see [4.6 Track link count for directories in btrfs.wiki.kernel.org](https://btrfs.wiki.kernel.org/index.php/Project_ideas#Track_link_count_for_directories) – ilkkachu Jan 18 '22 at 17:46

0 Answers0