Loading

Case Studies

Linux SCSI Mid-Layer driver for non-512 byte disks

Linux SCSI Mid-Layer driver for non-512 byte disks

Overview:

A client faced challenges in testing non-standard sector size drives (e.g., 520, 524, 528 bytes) on Linux with standard host tools like VDbench, IOmeter, FIO, and IO-zone. The Linux SCSI mid-layer driver (MLD) only recognized 512-byte or 4096-byte sector drives, rejecting others. The project aimed to modify the Linux SCSI MLD to enable seamless raw disk access for these drives.

Solution:

  • The solution involved modifying the SCSI MLD to make non-512-byte sector drives appear as 512-byte sector drives to Linux. Key modifications included:
  • Sector Translation: MLD would convert 512-byte sector commands into native sector size commands before passing them to the Low-Level Driver (LLD).
  • Data Padding & Stripping: Extra bytes in write operations were appended with a random/generated pattern and stripped during read operations to ensure data integrity.
  • Double Buffering: Used for read/write operations, with an expected 10% performance impact.
  • Testing & Deployment: The modified driver was tested with Ubuntu, SuSe, and RedHat/CentOS (64-bit) using sDV IO generation tools.

Outcome:

The project successfully enabled host-based testing for non-512 sector drives on Linux, ensuring seamless compatibility with existing test tools, enhancing fault-tolerant storage systems, and resolving critical bottlenecks for the client’s engineering team.

Client: Embedded Storage Manufacturing MNC, USA

Technology Used

Linux Device drivers - SCSI mid-layer driver of linux Data structures and static functions Ubuntu LTS Linux kernel