linuxflashfilesystemsdiskext4

Does a physical filesystem works only for a specific type of storage media?


The term physical filesystem is a reference to https://en.wikipedia.org/wiki/File_system#Architecture.

In my opinion, a physical filesystem is constructed on a physical storage media. It use low level interfaces to interact with physical storage media. So it shoud work on a specific type of storage media. For example, you can't format a optical disc to ext4 filesystem who is designed for disk.

My Question is why ext4 filesystem can be used for flash who is a different type of storage media with disk, if above description is true. Do Flash and HDD have the same low level interfaces or protocols?

I have searched with Google, but no useful info have found. I hope some can give some suggestions.


Solution

  • It depends on the filesystem driver, but generally it's possible for a filesystem to use different media types.

    Specifically ext4 works on both HDD and SSD and other flash drive types.

    The reason it can do this is because it uses Linux' "block layer" as its disk abstraction, and so anything that can be represented as a block device can be formatted to ext4.

    That said, ext4 was written for HDDs and is optimized for them - you may not get the most out of other types of media even if the filesystem you use can be stored on that media.

    Note that other type of filesystems may avoid the block device abstraction and talk directly to the driver. Examples are UBIFS and, for that matter, NFS.