Site banner image, showing the newly started bind9 server for the domain you are visiting.

 23.12.2019 techarticle

What is the difference between network block devices and network file systems?

Terminology

Before we speak about the hows and whys, let’s talk about the terms we are going to be using. There is some confusion to be had, if you are not familiar with it. So, let’s get started.

Small note: The term “disk” in this article refers to HDD as well as SSD.

Block Device

A block device, is, by definition, a device that stores or reads data in blocks. This means, always a certain amount of data is transmitted at every operation. How big that block is, highly depends on the protocol used.

File System

A file system is how your hard disk is formatted. It manages how the data is physically laid out, how the journal (the database of where which file is on the disk) looks like, which security features it supports or how big the files can be. For example, NTFS supports bitlocker, an encryption method, or security descriptors that tell Windows who can access files. FAT32 from Windows98 only supports files up to 4 GiB, NTFS supports very large files.

Network File System

Now comes the confusing part. I said previously, that file system means how your disk is formatted. This ain’t true for Network File Systems. They don’t care which file system your disk is formatted as. There may be some that do care, but most common used Network File Systems don’t. As long as the OS can handle it, they can use it.

A network file system is for example SMB , which is used by Windows to share files with other computers in the same network. If you are coming from the Linux, then you may know CIFS (which is used to access SMB shares) or NFS , which is also called Network File System. Yeah I know, my head exploded too.

The actual difference

So why are they called file systems then, you may ask? They are what is called Distributed File Systems . These kind of file system do not give the remote computer block level access.

This means, the remote computer cannot access the raw files or the underlying hardware with low level tools. But a Network Block Device does. It gives you full access to the underlying hardware. Imagine your network cable being a really long SATA cable. This is what a network block device does. In most cases, this connection is also exclusive, which means, only one remote computer can use that device, which can be a full, physical disc, or a volume/partition. Your operating system will, if supporting it, make no difference between a disk connected via SATA or via NBD.

Distributed File Systems act as a server for multiple clients. Imagine a household with a simple NAS, like Synology or QNap. Any device, from the phone to Moms laptop, can connect at the same time. That is because the server is managing the incoming files and data.

Both of these things can work across networks and can be both routed. There are a lot of protocols used in the wild for both methods. One notable protocol for NBD is Fibre Channel , which is used by Storage Area Networks (SAN), but that one can only routed when used with FCoE .

For the others the most notable are CIFS/SMB and NFS, which are both supported by Windows and Linux.

What is NBD good for?

Besides just being an online storage, diskless workstations. One could boot the computer with PXE into a small live linux, from where the NBD can be mounted and the operating system booted. There is no local disk, all data is central. Nowadays one would rather use virtualization for that, but it is an option.

Update about NFS

A user on Reddit pointed out, that NFS does care which file system it is used on. And he is right. NFS needs a file system that can work with the security features NFS provides. So, hope this sets the record straight.

As always, if you have errata, rants, gifts or coffee, feel free to send it to contact@tuxstash.de.

Link to the author's twitter Link to the authors ko-fi page

comments

Characters: 0/1000

gravatar portrait

 Pinned by contact@tuxstash.de

Come join the discussion and write something nice. You will have to confirm your comment by mail, so make sure it is legit and not a throwaway. Only the name part of it will be displayed, so don't worry about spam. If it does not show up after confirming it, it may be considered spam, but I curate them manually, so don't worry. Please read the privacy statement for more.