{"id":46288,"library":"rtslib-fb","title":"rtslib-fb","description":"rtslib-fb is a Python object API for managing the Linux kernel SCSI target subsystem (LIO). Version 2.2.4 requires Python >=3.9 and is actively maintained under the open-iscsi organization on GitHub. It provides classes to configure iSCSI, Fibre Channel, and other target backstores, ACLs, and LUNs.","status":"active","version":"2.2.4","language":"python","source_language":"en","source_url":"https://github.com/open-iscsi/rtslib-fb","tags":["scsi","target","lio","iscsi","storage","linux-kernel"],"install":[{"cmd":"pip install rtslib-fb","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used for device discovery and event handling","package":"pyudev","optional":false}],"imports":[{"note":"RTSLibError is in rtslib_fb.utils, not directly in rtslib_fb","wrong":"","symbol":"RTSLibError","correct":"from rtslib_fb.utils import RTSLibError"},{"note":"Target class is in rtslib_fb.target submodule","wrong":"from rtslib_fb import Target","symbol":"Target","correct":"from rtslib_fb.target import Target"},{"note":"Use rtslib_fb.block for block storage objects","wrong":"","symbol":"BlockStorageObject","correct":"from rtslib_fb.block import BlockStorageObject"}],"quickstart":{"code":"import os\nfrom rtslib_fb.root import RTSRoot\n\n# Ensure root privileges (rtslib_fb requires root)\nif os.geteuid() != 0:\n    raise PermissionError('This example requires root privileges')\n\nroot = RTSRoot()\nprint('Targets:', [t.to_dict() for t in root.targets])\n\n# Example: list all backstores\nfor backstore in root.backstores:\n    print(f'Backstore: {backstore.to_dict()}')","lang":"python","description":"Initialize RTSRoot and list existing targets and backstores."},"warnings":[{"fix":"Run the Python script with sudo or as root.","message":"rtslib-fb requires root privileges. Most operations will fail with PermissionError if not run as root.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace all imports of rtslib with rtslib_fb (e.g., from rtslib_fb.root import RTSRoot).","message":"In version 2.2.0, the module name changed from rtslib to rtslib_fb. Old imports like 'import rtslib' will fail.","severity":"breaking","affected_versions":">=2.2.0"},{"fix":"Ensure no other process is modifying LIO config concurrently, or use locking mechanisms.","message":"The library directly manipulates kernel configfs and sysfs; concurrent modifications from other tools (e.g., targetcli) can cause race conditions or stale state.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.2.4':22 '3.9':25 'acl':50 'activ':28 'api':11 'backstor':49 'channel':45 'class':40 'configur':42 'fb':3,6 'fibr':44 'github':37 'iscsi':34,43,56 'kernel':16,60 'linux':15,59 'linux-kernel':58 'lio':20,55 'lun':52 'maintain':29 'manag':13 'object':10 'open':33 'open-iscsi':32 'organ':35 'provid':39 'python':9,24 'requir':23 'rtslib':2,5 'rtslib-fb':1,4 'scsi':17,53 'storag':57 'subsystem':19 'target':18,48,54 'version':21","created_at":"2026-06-07T12:59:11.950976+00:00","updated_at":"2026-06-07T12:59:11.950976+00:00","problems":[{"fix":"Change import to 'rtslib_fb' (e.g., 'from rtslib_fb.root import RTSRoot').","cause":"Old import path using 'rtslib'; the module was renamed to 'rtslib_fb' in 2.2.0.","error":"ModuleNotFoundError: No module named 'rtslib'"},{"fix":"Run the script with sudo or as root user.","cause":"Trying to create or modify LIO objects without root privileges.","error":"PermissionError: [Errno 1] Operation not permitted"},{"fix":"Use 'from rtslib_fb.target import Target'.","cause":"Importing Target directly from the top-level module instead of the submodule.","error":"AttributeError: module 'rtslib_fb' has no attribute 'Target'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"http://github.com/open-iscsi/rtslib-fb","github":"http://github.com/open-iscsi/rtslib-fb","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}