/r/filesystems

Photograph via snooOG

Links about usage of file systems, FS implementation and theory behind implementations. Floss or proprietary, legacy or alpha-stage.

Links about usage of file systems, FS implementation and theory behind implementations. Floss or proprietary, legacy or alpha-stage.

Subreddits related to filesystems:

/r/filesystems

2,400 Subscribers

5

Why does the link count work different in macOS than in Linux?

Hello. I hope this is a good place to ask

I am self-learning operating systems, and I was playing around with stat when I noticed this behavior on my macOS.

https://preview.redd.it/jd5he1mjfi1d1.png?width=1284&format=png&auto=webp&s=2807e9afc62772922f49d51efa8e800848614f98

The Link increased from 2 to 3 after adding a file.

This is against what I expected – or at least how I understand the filesystem to work in Unix and Linux, where directories are the ones who create a link, never ordinary files. This leads me to believe that macOS's filesystem has a different implementation for linking than Linux.

Is this assumption right? If so, what's the reason for Apple to do it this way? Also – where can I learn more about the differences of MacOS and Linux filesystem implementations?

I've been running around all of the internet trying to find references to this, but to my surprise I can't find anything – and ChatGPT keeps insisting that what I just did is impossible!

(In particular, I am referencing the UNIX Time-Sharing System (Section 4) :

The file's i-node contains the description of the file as follows:

[...] 6. The number of links to the file, that is, the number of times it appears in a directory.

[...]

Making a link to an existing file involves creating a directory entry with the new name, copying the i-number from the original file entry, and incrementing the link-count field of the i-node.

I tested on an actual Linux machine and it worked as expected. I don't know where to find how MacOS's implements this)

2 Comments
2024/05/20
04:16 UTC

0

Filesystem for HDD

There are 4 HDD x 1Tb available, which FS is better to install or does not matter. ZFS (2x mirror) vs Btrfs (Raid-10) vs ? thanks for answers.

5 Comments
2024/05/07
09:18 UTC

1

About to install Kubuntu 24.04 as Linux non-expert: ZFS/BTRFS primarily for checksum - good idea?

Hi. I am an only moderately experienced Linux user and am interested in said filesystems primarily for the checksum feature that as I understand prevents stuff like hardware error caused data corruption to go unnoticed. (I had a case of an NTFS SSD gradually having bad blocks apparently in part due to deterioration of long not accessed data - which officially should not happen, and it was a pain to hunt down which files had been affected so I could restore them from a backup.)

Does the encryption feature of those filesystems make much sense if SSDs already have their own in-hardware encryption?

Can I deliberately install those filesystems with limited features like said focus on checksum? Is performance impact noticeable on modern hardware like a fast laptop with nvme SSD? I'd assume that especially with a fast SSD the CPU burden of filesystem activity would be high.
What would be the downsides compared to ext4? Anything that could pose a problem for me later? (Maybe third party tools like for partitioning and maintenance not able to handle partitions using ZFS or BTRFS?) And which of the two would you recommend?

Thank you!

9 Comments
2024/05/04
07:32 UTC

3

efs, a no_std library for filesystems

0 Comments
2024/04/28
16:21 UTC

Back To Top