Technology
5 min read
Unlock Block Device Creation with Ublk for Linux
Hackaday
January 21, 2026•1 day ago

AI-Generated SummaryAuto-generated
A new framework called Ublk allows developers to create block devices in user space for Linux. Utilizing the io_uring facility, Ublk simplifies block device development by enabling the use of any programming language and standard debugging tools. This approach offers easier development and debugging compared to traditional kernel-space drivers, though performance may be lower. Ublk is useful for various applications, including custom RAID schemes or exposing file-based block devices.
Your new project really could use a block device for Linux. File systems are easy to do with FUSE, but that’s sometimes too high-level. But a block driver can be tough to write and debug, especially since bugs in the kernel’s space can be catastrophic. [Jiri Pospisil] suggests Ublk, a framework for writing block devices in user space. This works using the io_uring facility in recent kernels.
This opens the block device field up. You can use any language you want (we’ve seen FUSE used with some very strange languages). You can use libraries that would not work in the kernel. Debugging is simple, and crashing is a minor inconvenience.
Another advantage? Your driver won’t depend on the kernel code. There is a kernel driver, of course, named ublk_drv, but that’s not your code. That’s what your code talks to.
The driver maintains the block devices and relays I/O and ioctl requests to your code for servicing. There are several possible use cases for this. For example, you could dream up some exotic RAID scheme and expose it as a block device that multiplexes many devices. The example in the post, for example, exposes a block device that is made up of many discrete files on a different file system.
Do you need this? Probably not. But if you do, it is a great way to push out a block driver in a hurry. Is it high-performance? Probably not, just like FUSE isn’t as performant as a “real” file system. But for many cases, that’s not a problem.
Rate this article
Login to rate this article
Comments
Please login to comment
No comments yet. Be the first to comment!
