$ sudo su
# dd if=/dev/zero of=./myext.img bs=1024 count=100
.
.
.
# modprobe loop
# losetup --find --show myext.img
/dev/loop0
# mkfs -t myext /dev/loop0
.
.
.
# mkdir mnt
# mount /dev/loop0 ./mnt
# cd mnt
# ls -al
total 17
drwxr-xr-x 3 root root 1024 Jul 21 02:22 .
drwxr-xr-x 11 shisui shisui 4096 Jul 21 02:22 ..
drwx------ 2 root root 12288 Jul 21 02:22 lost+found
(Cut out some of the output of some commands). My first question is, why isn't mnt
showing up in the ls -al
output? All I see is root
. I cd'd into \mnt
so I expected to see it in my ls -al
output.
But then what is the third link?
Finally, are all the link numbers in this ls -al
output hard links? Or does this link count also include symbolic links?
root
is the owner. The number of hard links is shown, that is, the number of references to that folder from other folders. A simple file would have 1 link/reference. The background is that only when that number reaches 0 the space on the disk will be de-allocated (made available for other files). – Ned64 Dec 12 '21 at 08:58