Skip to content

Chore: uthash update and buffer overflow found#570

Open
Piloalucard wants to merge 9 commits intoLinearTapeFileSystem:v2.4.8-windows-supportfrom
Piloalucard:chore/uthash-and-cwe
Open

Chore: uthash update and buffer overflow found#570
Piloalucard wants to merge 9 commits intoLinearTapeFileSystem:v2.4.8-windows-supportfrom
Piloalucard:chore/uthash-and-cwe

Conversation

@Piloalucard
Copy link
Member

@Piloalucard Piloalucard commented Feb 10, 2026

Summary of changes

This pull request includes following changes or fixes.

  • Updates uthash.h header to latest version available as a submodule with a GH action to keep it updated.

  • Added an extra comparison to prevent a memcpy with a negative count causing buffer overflow (Found with static analyzer)

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have confirmed my fix is effective or that my feature works

@Piloalucard
Copy link
Member Author

For testing, created a bash script to automatize common tests of files and directories, and different usages of ltfsck and mkltfs.

Testing script: test_ltfs_build.sh
Test passed using file-backend:
ltfs_test_log_20260209_185930.log

@vandelvan vandelvan requested a review from XV02 February 12, 2026 17:16
Copy link

@XV02 XV02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work, looks good, GTG!

@vandelvan vandelvan requested a review from alexzc117 February 12, 2026 17:38
Copy link

@alexzc117 alexzc117 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me. Thanks for your effort.

@amissael95 amissael95 self-requested a review February 13, 2026 16:51
_he_new_buckets = (UT_hash_bucket*)uthash_malloc( \
sizeof(struct UT_hash_bucket) * (tbl)->num_buckets * 2U); \
if (!_he_new_buckets) { \
HASH_RECORD_OOM(oomed); \
Copy link
Contributor

@amissael95 amissael95 Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HASH_RECORD_OOM macro ends up expanding to exit(-1) by default, it would make the ltfs process to terminate in case of malloc returning null pointer and we are now depending on the errno set by malloc. This means that we will not longer see the 10001E message in ltfs, but it will be still stopped.

@Piloalucard
Copy link
Member Author

Piloalucard commented Feb 28, 2026

Expanded macro example with the new uthash.h.
This aligns to current LTFS Implementation for error handling setting errno to ENOMEM:

		do {
		  unsigned _ha_hashv;
		  do {
		    do {
		      unsigned _hj_i, _hj_j, _hj_k;
		      unsigned
		      const char * _hj_key = (unsigned
		        const char * )(new_list -> name);
		      _ha_hashv = 0xfeedbeef u;
		      _hj_i = _hj_j = 0x9e3779b9 u;
		      _hj_k = (unsigned)(strlen(new_list -> name));
		      while (_hj_k >= 12 U) {
		        _hj_i += (_hj_key[0] + ((unsigned) _hj_key[1] << 8) + ((unsigned) _hj_key[2] << 16) + ((unsigned) _hj_key[3] << 24));
		        _hj_j += (_hj_key[4] + ((unsigned) _hj_key[5] << 8) + ((unsigned) _hj_key[6] << 16) + ((unsigned) _hj_key[7] << 24));
		        _ha_hashv += (_hj_key[8] + ((unsigned) _hj_key[9] << 8) + ((unsigned) _hj_key[10] << 16) + ((unsigned) _hj_key[11] << 24));
		        do {
		          _hj_i -= _hj_j;
		          _hj_i -= _ha_hashv;
		          _hj_i ^= (_ha_hashv >> 13);
		          _hj_j -= _ha_hashv;
		          _hj_j -= _hj_i;
		          _hj_j ^= (_hj_i << 8);
		          _ha_hashv -= _hj_i;
		          _ha_hashv -= _hj_j;
		          _ha_hashv ^= (_hj_j >> 13);
		          _hj_i -= _hj_j;
		          _hj_i -= _ha_hashv;
		          _hj_i ^= (_ha_hashv >> 12);
		          _hj_j -= _ha_hashv;
		          _hj_j -= _hj_i;
		          _hj_j ^= (_hj_i << 16);
		          _ha_hashv -= _hj_i;
		          _ha_hashv -= _hj_j;
		          _ha_hashv ^= (_hj_j >> 5);
		          _hj_i -= _hj_j;
		          _hj_i -= _ha_hashv;
		          _hj_i ^= (_ha_hashv >> 3);
		          _hj_j -= _ha_hashv;
		          _hj_j -= _hj_i;
		          _hj_j ^= (_hj_i << 10);
		          _ha_hashv -= _hj_i;
		          _ha_hashv -= _hj_j;
		          _ha_hashv ^= (_hj_j >> 15);
		        } while (0);
		        _hj_key += 12;
		        _hj_k -= 12 U;
		      }
		      _ha_hashv += (unsigned)(strlen(new_list -> name));
		      switch (_hj_k) {
		      case 11:
		        _ha_hashv += ((unsigned) _hj_key[10] << 24);
		      case 10:
		        _ha_hashv += ((unsigned) _hj_key[9] << 16);
		      case 9:
		        _ha_hashv += ((unsigned) _hj_key[8] << 8);
		      case 8:
		        _hj_j += ((unsigned) _hj_key[7] << 24);
		      case 7:
		        _hj_j += ((unsigned) _hj_key[6] << 16);
		      case 6:
		        _hj_j += ((unsigned) _hj_key[5] << 8);
		      case 5:
		        _hj_j += _hj_key[4];
		      case 4:
		        _hj_i += ((unsigned) _hj_key[3] << 24);
		      case 3:
		        _hj_i += ((unsigned) _hj_key[2] << 16);
		      case 2:
		        _hj_i += ((unsigned) _hj_key[1] << 8);
		      case 1:
		        _hj_i += _hj_key[0];
		      default:
		        ;
		      }
		      do {
		        _hj_i -= _hj_j;
		        _hj_i -= _ha_hashv;
		        _hj_i ^= (_ha_hashv >> 13);
		        _hj_j -= _ha_hashv;
		        _hj_j -= _hj_i;
		        _hj_j ^= (_hj_i << 8);
		        _ha_hashv -= _hj_i;
		        _ha_hashv -= _hj_j;
		        _ha_hashv ^= (_hj_j >> 13);
		        _hj_i -= _hj_j;
		        _hj_i -= _ha_hashv;
		        _hj_i ^= (_ha_hashv >> 12);
		        _hj_j -= _ha_hashv;
		        _hj_j -= _hj_i;
		        _hj_j ^= (_hj_i << 16);
		        _ha_hashv -= _hj_i;
		        _ha_hashv -= _hj_j;
		        _ha_hashv ^= (_hj_j >> 5);
		        _hj_i -= _hj_j;
		        _hj_i -= _ha_hashv;
		        _hj_i ^= (_ha_hashv >> 3);
		        _hj_j -= _ha_hashv;
		        _hj_j -= _hj_i;
		        _hj_j ^= (_hj_i << 10);
		        _ha_hashv -= _hj_i;
		        _ha_hashv -= _hj_j;
		        _ha_hashv ^= (_hj_j >> 15);
		      } while (0);
		    } while (0);
		  } while (0);
		  do {
		    int _ha_oomed = 0;
		    (new_list) -> hh.hashv = (_ha_hashv);
		    (new_list) -> hh.key = (const void * )(new_list -> name);
		    (new_list) -> hh.keylen = (unsigned)(strlen(new_list -> name));
		    if (!(list)) {
		      (new_list) -> hh.next = ((void * ) 0);
		      (new_list) -> hh.prev = ((void * ) 0);
		      do {
		        (new_list) -> hh.tbl = (UT_hash_table * ) malloc(sizeof(UT_hash_table));
		        if (!(new_list) -> hh.tbl) {
		          do {
		            (_ha_oomed) = 1;
		          } while (0);
		        } else {
		          memset((new_list) -> hh.tbl, '\0', sizeof(UT_hash_table));
		          (new_list) -> hh.tbl -> tail = & ((new_list) -> hh);
		          (new_list) -> hh.tbl -> num_buckets = 32 U;
		          (new_list) -> hh.tbl -> log2_num_buckets = 5 U;
		          (new_list) -> hh.tbl -> hho = (char * )( & (new_list) -> hh) - (char * )(new_list);
		          (new_list) -> hh.tbl -> buckets = (UT_hash_bucket * ) malloc(32 U * sizeof(struct UT_hash_bucket));
		          (new_list) -> hh.tbl -> signature = 0xa0111fe1 u;
		          if (!(new_list) -> hh.tbl -> buckets) {
		            do {
		              (_ha_oomed) = 1;
		            } while (0);
		            free((new_list) -> hh.tbl);
		          } else {
		            memset((new_list) -> hh.tbl -> buckets, '\0', 32 U * sizeof(struct UT_hash_bucket));;
		            if (_ha_oomed) {
		              free((new_list) -> hh.tbl -> buckets);
		              free((new_list) -> hh.tbl);
		            }
		          }
		        }
		      } while (0);
		      if (!_ha_oomed) {
		        (list) = (new_list);
		      }
		    } else {
		      (new_list) -> hh.tbl = (list) -> hh.tbl;
		      do {
		        (new_list) -> hh.next = ((void * ) 0);
		        (new_list) -> hh.prev = ((void * )(((char * )((list) -> hh.tbl -> tail)) - (((list) -> hh.tbl) -> hho)));
		        (list) -> hh.tbl -> tail -> next = (new_list);
		        (list) -> hh.tbl -> tail = & ((new_list) -> hh);
		      } while (0);
		    }
		    do {
		      if (!(_ha_oomed)) {
		        unsigned _ha_bkt;
		        (list) -> hh.tbl -> num_items++;
		        do {
		          _ha_bkt = ((_ha_hashv) & (((list) -> hh.tbl -> num_buckets) - 1 U));
		        } while (0);
		        do {
		          UT_hash_bucket * _ha_head = & ((list) -> hh.tbl -> buckets[_ha_bkt]);
		          _ha_head -> count++;
		          ( & (new_list) -> hh) -> hh_next = _ha_head -> hh_head;
		          ( & (new_list) -> hh) -> hh_prev = ((void * ) 0);
		          if (_ha_head -> hh_head != ((void * ) 0)) {
		            _ha_head -> hh_head -> hh_prev = ( & (new_list) -> hh);
		          }
		          _ha_head -> hh_head = ( & (new_list) -> hh);
		          if ((_ha_head -> count >= ((_ha_head -> expand_mult + 1 U) * 10 U)) && !( & (new_list) -> hh) -> tbl -> noexpand) {
		            do {
		              unsigned _he_bkt;
		              unsigned _he_bkt_i;
		              struct UT_hash_handle * _he_thh, * _he_hh_nxt;
		              UT_hash_bucket * _he_new_buckets, * _he_newbkt;
		              _he_new_buckets = (UT_hash_bucket * ) malloc(sizeof(struct UT_hash_bucket) * (( & (new_list) -> hh) -> tbl) -> num_buckets * 2 U);
		              if (!_he_new_buckets) {
		                do {
		                  (_ha_oomed) = 1;
		                } while (0);
		              } else {
		                memset(_he_new_buckets, '\0', sizeof(struct UT_hash_bucket) * (( & (new_list) -> hh) -> tbl) -> num_buckets * 2 U);
		                (( & (new_list) -> hh) -> tbl) -> ideal_chain_maxlen = ((( & (new_list) -> hh) -> tbl) -> num_items >> ((( & (new_list) -> hh) -> tbl) -> log2_num_buckets + 1 U)) + ((((( & (new_list) -> hh) -> tbl) -> num_items & (((( & (new_list) -> hh) -> tbl) -> num_buckets * 2 U) - 1 U)) != 0 U) ? 1 U : 0 U);
		                (( & (new_list) -> hh) -> tbl) -> nonideal_items = 0;
		                for (_he_bkt_i = 0; _he_bkt_i < (( & (new_list) -> hh) -> tbl) -> num_buckets; _he_bkt_i++) {
		                  _he_thh = (( & (new_list) -> hh) -> tbl) -> buckets[_he_bkt_i].hh_head;
		                  while (_he_thh != ((void * ) 0)) {
		                    _he_hh_nxt = _he_thh -> hh_next;
		                    do {
		                      _he_bkt = ((_he_thh -> hashv) & (((( & (new_list) -> hh) -> tbl) -> num_buckets * 2 U) - 1 U));
		                    } while (0);
		                    _he_newbkt = & (_he_new_buckets[_he_bkt]);
		                    if (++(_he_newbkt -> count) > (( & (new_list) -> hh) -> tbl) -> ideal_chain_maxlen) {
		                      (( & (new_list) -> hh) -> tbl) -> nonideal_items++;
		                      if (_he_newbkt -> count > _he_newbkt -> expand_mult * (( & (new_list) -> hh) -> tbl) -> ideal_chain_maxlen) {
		                        _he_newbkt -> expand_mult++;
		                      }
		                    }
		                    _he_thh -> hh_prev = ((void * ) 0);
		                    _he_thh -> hh_next = _he_newbkt -> hh_head;
		                    if (_he_newbkt -> hh_head != ((void * ) 0)) {
		                      _he_newbkt -> hh_head -> hh_prev = _he_thh;
		                    }
		                    _he_newbkt -> hh_head = _he_thh;
		                    _he_thh = _he_hh_nxt;
		                  }
		                }
		                free((( & (new_list) -> hh) -> tbl) -> buckets);
		                (( & (new_list) -> hh) -> tbl) -> num_buckets *= 2 U;
		                (( & (new_list) -> hh) -> tbl) -> log2_num_buckets++;
		                (( & (new_list) -> hh) -> tbl) -> buckets = _he_new_buckets;
		                (( & (new_list) -> hh) -> tbl) -> ineff_expands = ((( & (new_list) -> hh) -> tbl) -> nonideal_items > ((( & (new_list) -> hh) -> tbl) -> num_items >> 1)) ? ((( & (new_list) -> hh) -> tbl) -> ineff_expands + 1 U) : 0 U;
		                if ((( & (new_list) -> hh) -> tbl) -> ineff_expands > 1 U) {
		                  (( & (new_list) -> hh) -> tbl) -> noexpand = 1;;
		                };
		              }
		            } while (0);
		            if (_ha_oomed) {
		              do {
		                UT_hash_bucket * _hd_head = & ((list) -> hh.tbl -> buckets[_ha_bkt]);
		                _hd_head -> count--;
		                if (_hd_head -> hh_head == ( & (new_list) -> hh)) {
		                  _hd_head -> hh_head = ( & (new_list) -> hh) -> hh_next;
		                }
		                if (( & (new_list) -> hh) -> hh_prev) {
		                  ( & (new_list) -> hh) -> hh_prev -> hh_next = ( & (new_list) -> hh) -> hh_next;
		                }
		                if (( & (new_list) -> hh) -> hh_next) {
		                  ( & (new_list) -> hh) -> hh_next -> hh_prev = ( & (new_list) -> hh) -> hh_prev;
		                }
		              } while (0);
		            }
		          }
		        } while (0);
		        if (_ha_oomed) {
		          do {
		            struct UT_hash_handle * _hd_hh_item = ( & (new_list) -> hh);
		            unsigned _hd_bkt;
		            do {
		              _hd_bkt = ((_hd_hh_item -> hashv) & (((list) -> hh.tbl -> num_buckets) - 1 U));
		            } while (0);
		            (list) -> hh.tbl -> buckets[_hd_bkt].count++;
		            _hd_hh_item -> hh_next = ((void * ) 0);
		            _hd_hh_item -> hh_prev = ((void * ) 0);
		          } while (0);
		          do {
		            const struct UT_hash_handle * _hd_hh_del = ( & (new_list) -> hh);
		            if ((_hd_hh_del -> prev == ((void * ) 0)) && (_hd_hh_del -> next == ((void * ) 0))) {
		              ;
		              free((list) -> hh.tbl -> buckets);
		              free((list) -> hh.tbl);
		              (list) = ((void * ) 0);
		            } else {
		              unsigned _hd_bkt;
		              if (_hd_hh_del == (list) -> hh.tbl -> tail) {
		                (list) -> hh.tbl -> tail = ((UT_hash_handle * )(void * )(((char * )(_hd_hh_del -> prev)) + (((list) -> hh.tbl) -> hho)));
		              }
		              if (_hd_hh_del -> prev != ((void * ) 0)) {
		                ((UT_hash_handle * )(void * )(((char * )(_hd_hh_del -> prev)) + (((list) -> hh.tbl) -> hho))) -> next = _hd_hh_del -> next;
		              } else {
		                do {
		                  char ** _da_dst = (char ** )( & (list));* _da_dst = (char * )(_hd_hh_del -> next);
		                } while (0);
		              }
		              if (_hd_hh_del -> next != ((void * ) 0)) {
		                ((UT_hash_handle * )(void * )(((char * )(_hd_hh_del -> next)) + (((list) -> hh.tbl) -> hho))) -> prev = _hd_hh_del -> prev;
		              }
		              do {
		                _hd_bkt = ((_hd_hh_del -> hashv) & (((list) -> hh.tbl -> num_buckets) - 1 U));
		              } while (0);
		              do {
		                UT_hash_bucket * _hd_head = & ((list) -> hh.tbl -> buckets[_hd_bkt]);
		                _hd_head -> count--;
		                if (_hd_head -> hh_head == (_hd_hh_del)) {
		                  _hd_head -> hh_head = (_hd_hh_del) -> hh_next;
		                }
		                if ((_hd_hh_del) -> hh_prev) {
		                  (_hd_hh_del) -> hh_prev -> hh_next = (_hd_hh_del) -> hh_next;
		                }
		                if ((_hd_hh_del) -> hh_next) {
		                  (_hd_hh_del) -> hh_next -> hh_prev = (_hd_hh_del) -> hh_prev;
		                }
		              } while (0);
		              (list) -> hh.tbl -> num_items--;
		            };
		          } while (0);
		          (new_list) -> hh.tbl = ((void * ) 0);
		          do {
		            ( * _errno()) = 12;
		          } while (0);
		        } else {
		          ;;
		        }
		      } else {
		        (new_list) -> hh.tbl = ((void * ) 0);
		        do {
		          ( * _errno()) = 12;
		        } while (0);
		      }
		    } while (0);;
		  } while (0);
		} while (0);

@Piloalucard Piloalucard force-pushed the chore/uthash-and-cwe branch from 134f422 to d5382d5 Compare March 2, 2026 21:46
@Piloalucard
Copy link
Member Author

Piloalucard commented Mar 3, 2026

Linux Integration tests:

============================================================
 IBM Storage Archive SDE for Linux - Comprehensive Test Suite
 Drive Device  : /dev/sg7
 Mount Point   : /root/tavo/ya/
 Tape Path     : /root/tavo/ya/
 Test Mode     : standard
 Backend Type  : Physical Tape
============================================================

============================================================
 PHASE 1 - PRE-MOUNT CHECKS
============================================================

[TEST] CHECK VERSION (mkltfs)
------------------------------------------------------------
[CMD] sudo mkltfs --version
mkltfs version 2.4.5.1 (Prelim).
LTFS Format Specification version 2.4.0.

[TEST] CHECK VERSION (ltfs)
------------------------------------------------------------
[CMD] sudo ltfs --version
LTFS version 2.4.5.1 (Prelim).
LTFS Format Specification version 2.4.0.

[TEST] CHECK VERSION (ltfsck)
------------------------------------------------------------
[CMD] sudo ltfsck --version
ltfsck version 2.4.5.1 (Prelim).
LTFS Format Specification version 2.4.0.

[TEST] LIST DEVICES
------------------------------------------------------------
[CMD] sudo ltfs -o device_list
12903 LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
12903 LTFS14058I LTFS Format Specification version 2.4.0.
12903 LTFS14104I Launched by "ltfs -o device_list".
12903 LTFS14105I This binary is built for Linux (x86_64).
12903 LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
12903 LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
12903 LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
12903 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
12903 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
12903 LTFS17085I Plugin: Loading "sg" tape backend.
Tape Device list:.
Device Name = /dev/sg7 (8.0.1.0), Vendor ID = IBM     , Product ID = ULT3580-HH9     , Serial Number = 1013002519, Product Name =[ULT3580-HH9].
[WARN] ltfsck/ltfs -o device_list returned exit code 1 (treated as non-fatal).

[TEST] CHECK DEVICE
------------------------------------------------------------
[INFO] Device exists: /dev/sg7
[CMD] ls -l /dev/sg7
crw-rw----. 1 root tape 21, 7 Mar  2 19:24 /dev/sg7

============================================================
 PHASE 2 - MKLTFS FORMAT OPERATIONS
============================================================

[TEST] FORMAT BASIC
------------------------------------------------------------
[CMD] sudo mkltfs -d /dev/sg7 -f
LTFS15000I Starting mkltfs, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS15041I Launched by "mkltfs -d /dev/sg7 -f".
LTFS15042I This binary is built for Linux (x86_64).
LTFS15043I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS15003I Formatting device '/dev/sg7'.
LTFS15004I LTFS volume blocksize: 524288.
LTFS15005I Index partition placement policy: None.

LTFS11337I Update index-dirty flag (1) - NO_BARCODE (0x0x560033d9c6f0).
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS15049I Checking the medium (load).
LTFS30252I Logical block protection is disabled.
LTFS15010I Creating data partition b on SCSI partition 1.
LTFS15011I Creating index partition a on SCSI partition 0.
LTFS17165I Resetting the medium's capacity proportion.
LTFS11097I Partitioning the medium.
LTFS30263I MODESELECT returns Mode Parameters Rounded (-20101) /dev/sg7.
LTFS11100I Writing label to partition b.
LTFS11278I Writing index to partition b.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to b (Reason: Format, 0 files) 1013002519.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = b, Pos = 5, 1013002519).
LTFS11337I Update index-dirty flag (0) - NO_BARCODE (0x0x560033d9c6f0).
LTFS11100I Writing label to partition a.
LTFS11278I Writing index to partition a.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to a (Reason: Format, 0 files) 1013002519.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = a, Pos = 5, 1013002519).
LTFS15013I Volume UUID is: 2b4c3b26-e129-45e3-a1af-b85d0d63d39c.

LTFS15019I Volume capacity is 17550 GB.
LTFS30252I Logical block protection is disabled.
LTFS15024I Medium formatted successfully.

[TEST] FORMAT WITH SERIAL AND VOLUME NAME
------------------------------------------------------------
[CMD] sudo mkltfs -d /dev/sg7 -f -s SRLTST -n LBLTST
LTFS15000I Starting mkltfs, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS15041I Launched by "mkltfs -d /dev/sg7 -f -s SRLTST -n LBLTST".
LTFS15042I This binary is built for Linux (x86_64).
LTFS15043I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS15003I Formatting device '/dev/sg7'.
LTFS15004I LTFS volume blocksize: 524288.
LTFS15005I Index partition placement policy: None.

LTFS11337I Update index-dirty flag (1) - SRLTST (0x0x55e967e0e7f0).
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS15049I Checking the medium (load).
LTFS30252I Logical block protection is disabled.
LTFS15010I Creating data partition b on SCSI partition 1.
LTFS15011I Creating index partition a on SCSI partition 0.
LTFS17165I Resetting the medium's capacity proportion.
LTFS11097I Partitioning the medium.
LTFS30263I MODESELECT returns Mode Parameters Rounded (-20101) /dev/sg7.
LTFS11100I Writing label to partition b.
LTFS11278I Writing index to partition b.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of SRLTST to b (Reason: Format, 0 files) 1013002519.
LTFS30263I READ_ATTR returns Command TIMEOUT (-21102) /dev/sg7.
LTFS30262I Forcing drive dump.
LTFS30253I Saving drive dump to /tmp/ltfs_1013002519_2026_0302_204717_f.dmp.
LTFS30233I Cannot read attribute (-21102).
LTFS12056W Cannot get Volume Change Reference parameter: read attribute failed (-21102).
LTFS17236I Wrote index of SRLTST (Gen = 1, Part = b, Pos = 5, 1013002519).
LTFS11337I Update index-dirty flag (0) - SRLTST (0x0x55e967e0e7f0).
LTFS11100I Writing label to partition a.
LTFS11278I Writing index to partition a.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of SRLTST to a (Reason: Format, 0 files) 1013002519.
LTFS17236I Wrote index of SRLTST (Gen = 1, Part = a, Pos = 5, 1013002519).
LTFS15013I Volume UUID is: f44b8a87-f1cb-42fa-bd6d-3a7a6e1712b5.

LTFS15019I Volume capacity is 17550 GB.
LTFS30252I Logical block protection is disabled.
LTFS15024I Medium formatted successfully.

[TEST] FORMAT WITH RULES (size)
------------------------------------------------------------
[CMD] sudo mkltfs -d /dev/sg7 -f -r size=1M
LTFS15000I Starting mkltfs, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS15041I Launched by "mkltfs -d /dev/sg7 -f -r size=1M".
LTFS15042I This binary is built for Linux (x86_64).
LTFS15043I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS15003I Formatting device '/dev/sg7'.
LTFS15004I LTFS volume blocksize: 524288.
LTFS15005I Index partition placement policy: size=1M.

LTFS11337I Update index-dirty flag (1) - NO_BARCODE (0x0x556782a41770).
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS15049I Checking the medium (load).
LTFS30252I Logical block protection is disabled.
LTFS15010I Creating data partition b on SCSI partition 1.
LTFS15011I Creating index partition a on SCSI partition 0.
LTFS17165I Resetting the medium's capacity proportion.
LTFS11097I Partitioning the medium.
LTFS30263I MODESELECT returns Mode Parameters Rounded (-20101) /dev/sg7.
LTFS11100I Writing label to partition b.
LTFS11278I Writing index to partition b.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to b (Reason: Format, 0 files) 1013002519.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = b, Pos = 5, 1013002519).
LTFS11337I Update index-dirty flag (0) - NO_BARCODE (0x0x556782a41770).
LTFS11100I Writing label to partition a.
LTFS11278I Writing index to partition a.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to a (Reason: Format, 0 files) 1013002519.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = a, Pos = 5, 1013002519).
LTFS15013I Volume UUID is: 9bf38ddd-5aaf-4e43-b250-380bb8a4f6b7.

LTFS15019I Volume capacity is 17550 GB.
LTFS30252I Logical block protection is disabled.
LTFS15024I Medium formatted successfully.

[TEST] FORMAT WITH RULES (size and name pattern)
------------------------------------------------------------
[CMD] sudo mkltfs -d /dev/sg7 -f -r size=1M/name=*.txt
LTFS15000I Starting mkltfs, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS15041I Launched by "mkltfs -d /dev/sg7 -f -r size=1M/name=*.txt".
LTFS15042I This binary is built for Linux (x86_64).
LTFS15043I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS15003I Formatting device '/dev/sg7'.
LTFS15004I LTFS volume blocksize: 524288.
LTFS15005I Index partition placement policy: size=1M/name=*.txt.

LTFS11337I Update index-dirty flag (1) - NO_BARCODE (0x0x5619b94a7780).
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS15049I Checking the medium (load).
LTFS30252I Logical block protection is disabled.
LTFS15010I Creating data partition b on SCSI partition 1.
LTFS15011I Creating index partition a on SCSI partition 0.
LTFS17165I Resetting the medium's capacity proportion.
LTFS11097I Partitioning the medium.
LTFS30263I MODESELECT returns Mode Parameters Rounded (-20101) /dev/sg7.
LTFS11100I Writing label to partition b.
LTFS11278I Writing index to partition b.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to b (Reason: Format, 0 files) 1013002519.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = b, Pos = 5, 1013002519).
LTFS11337I Update index-dirty flag (0) - NO_BARCODE (0x0x5619b94a7780).
LTFS11100I Writing label to partition a.
LTFS11278I Writing index to partition a.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to a (Reason: Format, 0 files) 1013002519.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = a, Pos = 5, 1013002519).
LTFS15013I Volume UUID is: 1f038267-21d0-45fe-9e76-0c1170f840ea.

LTFS15019I Volume capacity is 17550 GB.
LTFS30252I Logical block protection is disabled.
LTFS15024I Medium formatted successfully.

[TEST] FORMAT WITH RULES (multiple patterns)
------------------------------------------------------------
[CMD] sudo mkltfs -d /dev/sg7 -f -r size=1M/name=*.jpg:*.png
LTFS15000I Starting mkltfs, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS15041I Launched by "mkltfs -d /dev/sg7 -f -r size=1M/name=*.jpg:*.png".
LTFS15042I This binary is built for Linux (x86_64).
LTFS15043I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS15003I Formatting device '/dev/sg7'.
LTFS15004I LTFS volume blocksize: 524288.
LTFS15005I Index partition placement policy: size=1M/name=*.jpg:*.png.

LTFS11337I Update index-dirty flag (1) - NO_BARCODE (0x0x560808eb2770).
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS15049I Checking the medium (load).
LTFS30252I Logical block protection is disabled.
LTFS15010I Creating data partition b on SCSI partition 1.
LTFS15011I Creating index partition a on SCSI partition 0.
LTFS17165I Resetting the medium's capacity proportion.
LTFS11097I Partitioning the medium.
LTFS30263I MODESELECT returns Mode Parameters Rounded (-20101) /dev/sg7.
LTFS11100I Writing label to partition b.
LTFS11278I Writing index to partition b.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to b (Reason: Format, 0 files) 1013002519.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = b, Pos = 5, 1013002519).
LTFS11337I Update index-dirty flag (0) - NO_BARCODE (0x0x560808eb2770).
LTFS11100I Writing label to partition a.
LTFS11278I Writing index to partition a.
LTFS30205I READ_ATTR (0x8c) returns -20501.
LTFS30263I READ_ATTR returns Invalid Field in CDB (-20501) /dev/sg7.
LTFS30233I Cannot read attribute (-20501).
LTFS11336I The attribute does not exist. Ignore the expected error.
LTFS17235I Writing index of NO_BARCODE to a (Reason: Format, 0 files) 1013002519.
LTFS17236I Wrote index of NO_BARCODE (Gen = 1, Part = a, Pos = 5, 1013002519).
LTFS15013I Volume UUID is: c8e5d235-7dc3-4cdc-88ec-3d5aa5b1d3f1.

LTFS15019I Volume capacity is 17550 GB.
LTFS30252I Logical block protection is disabled.
LTFS15024I Medium formatted successfully.

============================================================
 PHASE 3 - LTFS MOUNT OPERATIONS
============================================================

[TEST] MOUNT BASIC
------------------------------------------------------------
[CMD] sudo ltfs -o devname=/dev/sg7 /root/tavo/ya/
14eac LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
14eac LTFS14058I LTFS Format Specification version 2.4.0.
14eac LTFS14104I Launched by "ltfs -o devname=/dev/sg7 /root/tavo/ya/".
14eac LTFS14105I This binary is built for Linux (x86_64).
14eac LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
14eac LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
14eac LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
14eac LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
14eac LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
14eac LTFS14063I Sync type is "time", Sync time is 300 sec.
14eac LTFS17085I Plugin: Loading "sg" tape backend.
14eac LTFS17085I Plugin: Loading "unified" iosched backend.
14eac LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
14eac LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
14eac LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
14eac LTFS30207I Vendor ID is IBM     .
14eac LTFS30208I Product ID is ULT3580-HH9     .
14eac LTFS30214I Firmware revision is Q9E9.
14eac LTFS30215I Drive serial is 1013002519.
14eac LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
14eac LTFS30294I Setting up timeout values from RSOC.
14eac LTFS17160I Maximum device block size is 1048576.
14eac LTFS11330I Loading cartridge.
14eac LTFS30252I Logical block protection is disabled.
14eac LTFS11332I Load successful.
14eac LTFS17157I Changing the drive setting to write-anywhere mode.
14eac LTFS11005I Mounting the volume.
14eac LTFS30252I Logical block protection is disabled.
14eac LTFS17227I Tape attribute: Vendor = IBM.
14eac LTFS17227I Tape attribute: Application Name = LTF.
14eac LTFS17227I Tape attribute: Application Version = 2.4.
14eac LTFS17227I Tape attribute: Medium Label = .
14eac LTFS17228I Tape attribute: Text Localization ID = 0x81.
14eac LTFS17227I Tape attribute: Barcode =    .
14eac LTFS17227I Tape attribute: Application Format Version = 2.4pNU.
14eac LTFS17228I Tape attribute: Volume Lock Status = 0x00.
14eac LTFS17227I Tape attribute: Media Pool name = .
14eac LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 1 / (a, 5) -> (b, 5) / 1013002519.
14eac LTFS14111I Initial setup completed successfully.
14eac LTFS14112I Invoke 'mount' command to check the result of final setup.
14eac LTFS14113I Specified mount point is listed if succeeded.

[TEST] UNMOUNT
------------------------------------------------------------
[CMD] sudo umount /root/tavo/ya/
[CMD] sleep 5

[TEST] MOUNT WITH SYNC TYPE (time@3)
------------------------------------------------------------
[CMD] sudo ltfs -o devname=/dev/sg7 -o sync_type=time@3 /root/tavo/ya/
15035 LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
15035 LTFS14058I LTFS Format Specification version 2.4.0.
15035 LTFS14104I Launched by "ltfs -o devname=/dev/sg7 -o sync_type=time@3 /root/tavo/ya/".
15035 LTFS14105I This binary is built for Linux (x86_64).
15035 LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
15035 LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
15035 LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
15035 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
15035 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
15035 LTFS14063I Sync type is "time", Sync time is 180 sec.
15035 LTFS17085I Plugin: Loading "sg" tape backend.
15035 LTFS17085I Plugin: Loading "unified" iosched backend.
15035 LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
15035 LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
15035 LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
15035 LTFS30207I Vendor ID is IBM     .
15035 LTFS30208I Product ID is ULT3580-HH9     .
15035 LTFS30214I Firmware revision is Q9E9.
15035 LTFS30215I Drive serial is 1013002519.
15035 LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
15035 LTFS30294I Setting up timeout values from RSOC.
15035 LTFS17160I Maximum device block size is 1048576.
15035 LTFS11330I Loading cartridge.
15035 LTFS30252I Logical block protection is disabled.
15035 LTFS11332I Load successful.
15035 LTFS17157I Changing the drive setting to write-anywhere mode.
15035 LTFS11005I Mounting the volume.
15035 LTFS30252I Logical block protection is disabled.
15035 LTFS17227I Tape attribute: Vendor = IBM.
15035 LTFS17227I Tape attribute: Application Name = LTF.
15035 LTFS17227I Tape attribute: Application Version = 2.4.
15035 LTFS17227I Tape attribute: Medium Label = .
15035 LTFS17228I Tape attribute: Text Localization ID = 0x81.
15035 LTFS17227I Tape attribute: Barcode =    .
15035 LTFS17227I Tape attribute: Application Format Version = 2.4� � i�.
15035 LTFS17228I Tape attribute: Volume Lock Status = 0x00.
15035 LTFS17227I Tape attribute: Media Pool name = .
15035 LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 1 / (a, 5) -> (b, 5) / 1013002519.
15035 LTFS14111I Initial setup completed successfully.
15035 LTFS14112I Invoke 'mount' command to check the result of final setup.
15035 LTFS14113I Specified mount point is listed if succeeded.

[TEST] UNMOUNT
------------------------------------------------------------
[CMD] sudo umount /root/tavo/ya/
[CMD] sleep 5

[TEST] MOUNT WITH SYNC TYPE (close)
------------------------------------------------------------
[CMD] sudo ltfs -o devname=/dev/sg7 -o sync_type=close /root/tavo/ya/
150fd LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
150fd LTFS14058I LTFS Format Specification version 2.4.0.
150fd LTFS14104I Launched by "ltfs -o devname=/dev/sg7 -o sync_type=close /root/tavo/ya/".
150fd LTFS14105I This binary is built for Linux (x86_64).
150fd LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
150fd LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
150fd LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
150fd LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
150fd LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
150fd LTFS14064I Sync type is "close".
150fd LTFS17085I Plugin: Loading "sg" tape backend.
150fd LTFS17085I Plugin: Loading "unified" iosched backend.
150fd LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
150fd LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
150fd LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
150fd LTFS30207I Vendor ID is IBM     .
150fd LTFS30208I Product ID is ULT3580-HH9     .
150fd LTFS30214I Firmware revision is Q9E9.
150fd LTFS30215I Drive serial is 1013002519.
150fd LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
150fd LTFS30294I Setting up timeout values from RSOC.
150fd LTFS17160I Maximum device block size is 1048576.
150fd LTFS11330I Loading cartridge.
150fd LTFS30252I Logical block protection is disabled.
150fd LTFS11332I Load successful.
150fd LTFS17157I Changing the drive setting to write-anywhere mode.
150fd LTFS11005I Mounting the volume.
150fd LTFS30252I Logical block protection is disabled.
150fd LTFS17227I Tape attribute: Vendor = IBM.
150fd LTFS17227I Tape attribute: Application Name = LTF.
150fd LTFS17227I Tape attribute: Application Version = 2.4.
150fd LTFS17227I Tape attribute: Medium Label = .
150fd LTFS17228I Tape attribute: Text Localization ID = 0x81.
150fd LTFS17227I Tape attribute: Barcode =    .
150fd LTFS17227I Tape attribute: Application Format Version = 2.4�   {�.
150fd LTFS17228I Tape attribute: Volume Lock Status = 0x00.
150fd LTFS17227I Tape attribute: Media Pool name = .
150fd LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 1 / (a, 5) -> (b, 5) / 1013002519.
150fd LTFS14111I Initial setup completed successfully.
150fd LTFS14112I Invoke 'mount' command to check the result of final setup.
150fd LTFS14113I Specified mount point is listed if succeeded.

[TEST] UNMOUNT
------------------------------------------------------------
[CMD] sudo umount /root/tavo/ya/
[CMD] sleep 5

[TEST] MOUNT WITH SYNC TYPE (unmount)
------------------------------------------------------------
[CMD] sudo ltfs -o devname=/dev/sg7 -o sync_type=unmount /root/tavo/ya/
15273 LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
15273 LTFS14058I LTFS Format Specification version 2.4.0.
15273 LTFS14104I Launched by "ltfs -o devname=/dev/sg7 -o sync_type=unmount /root/tavo/ya/".
15273 LTFS14105I This binary is built for Linux (x86_64).
15273 LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
15273 LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
15273 LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
15273 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
15273 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
15273 LTFS14064I Sync type is "unmount".
15273 LTFS17085I Plugin: Loading "sg" tape backend.
15273 LTFS17085I Plugin: Loading "unified" iosched backend.
15273 LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
15273 LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
15273 LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
15273 LTFS30207I Vendor ID is IBM     .
15273 LTFS30208I Product ID is ULT3580-HH9     .
15273 LTFS30214I Firmware revision is Q9E9.
15273 LTFS30215I Drive serial is 1013002519.
15273 LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
15273 LTFS30294I Setting up timeout values from RSOC.
15273 LTFS17160I Maximum device block size is 1048576.
15273 LTFS11330I Loading cartridge.
15273 LTFS30252I Logical block protection is disabled.
15273 LTFS11332I Load successful.
15273 LTFS17157I Changing the drive setting to write-anywhere mode.
15273 LTFS11005I Mounting the volume.
15273 LTFS30252I Logical block protection is disabled.
15273 LTFS17227I Tape attribute: Vendor = IBM.
15273 LTFS17227I Tape attribute: Application Name = LTF.
15273 LTFS17227I Tape attribute: Application Version = 2.4.
15273 LTFS17227I Tape attribute: Medium Label = .
15273 LTFS17228I Tape attribute: Text Localization ID = 0x81.
15273 LTFS17227I Tape attribute: Barcode =    .
15273 LTFS17227I Tape attribute: Application Format Version = 2.4W Y�.
15273 LTFS17228I Tape attribute: Volume Lock Status = 0x00.
15273 LTFS17227I Tape attribute: Media Pool name = .
15273 LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 1 / (a, 5) -> (b, 5) / 1013002519.
15273 LTFS14111I Initial setup completed successfully.
15273 LTFS14112I Invoke 'mount' command to check the result of final setup.
15273 LTFS14113I Specified mount point is listed if succeeded.

[TEST] UNMOUNT
------------------------------------------------------------
[CMD] sudo umount /root/tavo/ya/
[CMD] sleep 5

[TEST] MOUNT WITH SYMLINK TYPE (posix)
------------------------------------------------------------
[CMD] sudo ltfs -o devname=/dev/sg7 -o symlink_type=posix /root/tavo/ya/
15350 LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
15350 LTFS14058I LTFS Format Specification version 2.4.0.
15350 LTFS14104I Launched by "ltfs -o devname=/dev/sg7 -o symlink_type=posix /root/tavo/ya/".
15350 LTFS14105I This binary is built for Linux (x86_64).
15350 LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
15350 LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
15350 LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
15350 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
15350 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
15350 LTFS14063I Sync type is "time", Sync time is 300 sec.
15350 LTFS17085I Plugin: Loading "sg" tape backend.
15350 LTFS17085I Plugin: Loading "unified" iosched backend.
15350 LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
15350 LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
15350 LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
15350 LTFS30207I Vendor ID is IBM     .
15350 LTFS30208I Product ID is ULT3580-HH9     .
15350 LTFS30214I Firmware revision is Q9E9.
15350 LTFS30215I Drive serial is 1013002519.
15350 LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
15350 LTFS30294I Setting up timeout values from RSOC.
15350 LTFS17160I Maximum device block size is 1048576.
15350 LTFS11330I Loading cartridge.
15350 LTFS30252I Logical block protection is disabled.
15350 LTFS11332I Load successful.
15350 LTFS17157I Changing the drive setting to write-anywhere mode.
15350 LTFS14092I Symbolic link type is (posix).
15350 LTFS11005I Mounting the volume.
15350 LTFS30252I Logical block protection is disabled.
15350 LTFS17227I Tape attribute: Vendor = IBM.
15350 LTFS17227I Tape attribute: Application Name = LTF.
15350 LTFS17227I Tape attribute: Application Version = 2.4.
15350 LTFS17227I Tape attribute: Medium Label = .
15350 LTFS17228I Tape attribute: Text Localization ID = 0x81.
15350 LTFS17227I Tape attribute: Barcode =    .
15350 LTFS17227I Tape attribute: Application Format Version = 2.4m  n�.
15350 LTFS17228I Tape attribute: Volume Lock Status = 0x00.
15350 LTFS17227I Tape attribute: Media Pool name = .
15350 LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 1 / (a, 5) -> (b, 5) / 1013002519.
15350 LTFS14111I Initial setup completed successfully.
15350 LTFS14112I Invoke 'mount' command to check the result of final setup.
15350 LTFS14113I Specified mount point is listed if succeeded.

[TEST] UNMOUNT
------------------------------------------------------------
[CMD] sudo umount /root/tavo/ya/
[CMD] sleep 5

[TEST] MOUNT WITH SYMLINK TYPE (live)
------------------------------------------------------------
[CMD] sudo ltfs -o devname=/dev/sg7 -o symlink_type=live /root/tavo/ya/
154cd LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
154cd LTFS14058I LTFS Format Specification version 2.4.0.
154cd LTFS14104I Launched by "ltfs -o devname=/dev/sg7 -o symlink_type=live /root/tavo/ya/".
154cd LTFS14105I This binary is built for Linux (x86_64).
154cd LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
154cd LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
154cd LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
154cd LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
154cd LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
154cd LTFS14063I Sync type is "time", Sync time is 300 sec.
154cd LTFS17085I Plugin: Loading "sg" tape backend.
154cd LTFS17085I Plugin: Loading "unified" iosched backend.
154cd LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
154cd LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
154cd LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
154cd LTFS30207I Vendor ID is IBM     .
154cd LTFS30208I Product ID is ULT3580-HH9     .
154cd LTFS30214I Firmware revision is Q9E9.
154cd LTFS30215I Drive serial is 1013002519.
154cd LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
154cd LTFS30294I Setting up timeout values from RSOC.
154cd LTFS17160I Maximum device block size is 1048576.
154cd LTFS11330I Loading cartridge.
154cd LTFS30252I Logical block protection is disabled.
154cd LTFS11332I Load successful.
154cd LTFS17157I Changing the drive setting to write-anywhere mode.
154cd LTFS14092I Symbolic link type is (live).
154cd LTFS11005I Mounting the volume.
154cd LTFS30252I Logical block protection is disabled.
154cd LTFS17227I Tape attribute: Vendor = IBM.
154cd LTFS17227I Tape attribute: Application Name = LTF.
154cd LTFS17227I Tape attribute: Application Version = 2.4.
154cd LTFS17227I Tape attribute: Medium Label = .
154cd LTFS17228I Tape attribute: Text Localization ID = 0x81.
154cd LTFS17227I Tape attribute: Barcode =    .
154cd LTFS17227I Tape attribute: Application Format Version = 2.4�    �.
154cd LTFS17228I Tape attribute: Volume Lock Status = 0x00.
154cd LTFS17227I Tape attribute: Media Pool name = .
154cd LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 1 / (a, 5) -> (b, 5) / 1013002519.
154cd LTFS14111I Initial setup completed successfully.
154cd LTFS14112I Invoke 'mount' command to check the result of final setup.
154cd LTFS14113I Specified mount point is listed if succeeded.

============================================================
 PHASE 4 - FILE OPERATIONS
============================================================

============================================================
 FILE OPERATIONS TEST MODULE
 Tape Path: /root/tavo/ya
============================================================

[TEST 1] CREATE EMPTY FILE
------------------------------------------------------------
[CMD] touch "/root/tavo/ya/empty_file.txt"

[TEST 2] CREATE FILE WITH CONTENT
------------------------------------------------------------
[CMD] echo "Hello, LTFS!" > "/root/tavo/ya/hello.txt"

[TEST 3] READ FILE CONTENT
------------------------------------------------------------
[CMD] cat "/root/tavo/ya/hello.txt"
Hello, LTFS!

[TEST 4] APPEND TO FILE
------------------------------------------------------------
[CMD] echo "Appended line" >> "/root/tavo/ya/hello.txt"

[TEST 5] VERIFY APPEND
------------------------------------------------------------
[CMD] cat "/root/tavo/ya/hello.txt"
Hello, LTFS!
Appended line

[TEST 6] COPY FILE
------------------------------------------------------------
[CMD] cp "/root/tavo/ya/hello.txt" "/root/tavo/ya/hello_copy.txt"

[TEST 7] VERIFY COPY
------------------------------------------------------------
[CMD] cat "/root/tavo/ya/hello_copy.txt"
Hello, LTFS!
Appended line

[TEST 8] RENAME FILE
------------------------------------------------------------
[CMD] mv "/root/tavo/ya/hello_copy.txt" "/root/tavo/ya/hello_renamed.txt"

[TEST 9] VERIFY RENAME
------------------------------------------------------------
[CMD] ls -la "/root/tavo/ya/hello_renamed.txt"
-rwxrwxrwx. 1 root root 27 Mar  2 20:56 /root/tavo/ya/hello_renamed.txt

[TEST 10] DELETE FILE
------------------------------------------------------------
[CMD] rm "/root/tavo/ya/hello_renamed.txt"

[TEST 11] VERIFY DELETE
------------------------------------------------------------
[CMD] ls "/root/tavo/ya/hello_renamed.txt" 2>&1
ls: cannot access '/root/tavo/ya/hello_renamed.txt': No such file or directory
[INFO] File successfully deleted (expected error)

[TEST 12] CREATE MULTI-LINE FILE
------------------------------------------------------------
[CMD] cat > "/root/tavo/ya/multiline.txt" << 'EOF'

[TEST 13] COUNT LINES IN FILE
------------------------------------------------------------
[CMD] wc -l "/root/tavo/ya/multiline.txt"
5 /root/tavo/ya/multiline.txt

[TEST 14] CREATE BINARY FILE
------------------------------------------------------------
[CMD] dd if=/dev/urandom of="/root/tavo/ya/binary_file.bin" bs=1024 count=10
10+0 records in
10+0 records out
10240 bytes (10 kB, 10 KiB) copied, 6.43678 s, 1.6 kB/s

[TEST 15] VERIFY BINARY FILE SIZE
------------------------------------------------------------
[CMD] ls -lh "/root/tavo/ya/binary_file.bin"
-rwxrwxrwx. 1 root root 10K Mar  2 20:57 /root/tavo/ya/binary_file.bin

[TEST 16] CREATE LARGE TEXT FILE
------------------------------------------------------------
[CMD] for i in {1..1000}; do echo "Line $i of large file" >> "/root/tavo/ya/large_file.txt"; done

[TEST 17] VERIFY LARGE FILE LINE COUNT
------------------------------------------------------------
[CMD] wc -l "/root/tavo/ya/large_file.txt"
1000 /root/tavo/ya/large_file.txt

[TEST 18] SET FILE PERMISSIONS
------------------------------------------------------------
[CMD] chmod 644 "/root/tavo/ya/hello.txt"

[TEST 19] VERIFY FILE PERMISSIONS
------------------------------------------------------------
[CMD] ls -l "/root/tavo/ya/hello.txt"
-rwxrwxrwx. 1 root root 27 Mar  2 20:56 /root/tavo/ya/hello.txt

[TEST 20] CREATE FILE WITH UNICODE NAME (Japanese)
------------------------------------------------------------
[CMD] echo "Unicode test file" > "/root/tavo/ya/テスト.txt"

[CMD] ls -la "/root/tavo/ya/テスト.txt"
-rwxrwxrwx. 1 root root 18 Mar  2 20:57 /root/tavo/ya/テスト.txt

[TEST 21] FILE TRUNCATE OPERATIONS
------------------------------------------------------------
[CMD] echo "This is a long line of text that will be truncated" > "/root/tavo/ya/truncate_test.txt"
[CMD] truncate -s 10 "/root/tavo/ya/truncate_test.txt"
[CMD] stat -c%s "/root/tavo/ya/truncate_test.txt"
10

[TEST 22] FILE OVERWRITE OPERATIONS
------------------------------------------------------------
[CMD] echo "Original content" > "/root/tavo/ya/overwrite_test.txt"
[CMD] echo "New content" > "/root/tavo/ya/overwrite_test.txt"
[CMD] cat "/root/tavo/ya/overwrite_test.txt"
New content

[TEST 23] BINARY FILE WITH CHECKSUM
------------------------------------------------------------
[CMD] dd if=/dev/urandom of="/root/tavo/ya/binary_checksum.bin" bs=1024 count=100
100+0 records in
100+0 records out
102400 bytes (102 kB, 100 KiB) copied, 6.5228 s, 15.7 kB/s
[CMD] md5sum "/root/tavo/ya/binary_checksum.bin"
32974a03166b7832da8ff44d79ce32da  /root/tavo/ya/binary_checksum.bin

[TEST 24] MULTIPLE FILE TYPES
------------------------------------------------------------
[CMD] mkdir -p "/root/tavo/ya/mixed_types"
[CMD] echo "Text content" > "/root/tavo/ya/mixed_types/file.txt"
[CMD] echo '{"key": "value"}' > "/root/tavo/ya/mixed_types/file.json"
[CMD] echo '<?xml version="1.0"?><root><item>test</item></root>' > "/root/tavo/ya/mixed_types/file.xml"
[CMD] ls -la "/root/tavo/ya/mixed_types"
total 2
drwxrwxrwx. 2 root root  0 Mar  2 20:58 .
drwxrwxrwx. 3 root root  0 Mar  2 20:58 ..
-rwxrwxrwx. 1 root root 31 Mar  2 20:58 file.json
-rwxrwxrwx. 1 root root 13 Mar  2 20:58 file.txt
-rwxrwxrwx. 1 root root 52 Mar  2 20:58 file.xml

[TEST 25] CONCURRENT FILE OPERATIONS
------------------------------------------------------------
[CMD] Creating 5 files concurrently...
[CMD] ls -la "/root/tavo/ya"/concurrent_*.txt
-rwxrwxrwx. 1 root root 13 Mar  2 20:58 /root/tavo/ya/concurrent_1.txt
-rwxrwxrwx. 1 root root 13 Mar  2 20:58 /root/tavo/ya/concurrent_2.txt
-rwxrwxrwx. 1 root root 13 Mar  2 20:58 /root/tavo/ya/concurrent_3.txt
-rwxrwxrwx. 1 root root 13 Mar  2 20:58 /root/tavo/ya/concurrent_4.txt
-rwxrwxrwx. 1 root root 13 Mar  2 20:58 /root/tavo/ya/concurrent_5.txt

============================================================
 FILE OPERATIONS TEST MODULE - COMPLETED
 Total Tests: 25
============================================================

============================================================
 PHASE 5 - DIRECTORY OPERATIONS
============================================================

============================================================
 DIRECTORY OPERATIONS TEST MODULE
 Tape Path: /root/tavo/ya
============================================================

[TEST 1] CREATE DIRECTORY
------------------------------------------------------------
[CMD] mkdir "/root/tavo/ya/test_dir"

[TEST 2] VERIFY DIRECTORY EXISTS
------------------------------------------------------------
[CMD] ls -ld "/root/tavo/ya/test_dir"
drwxrwxrwx. 2 root root 0 Mar  2 20:58 /root/tavo/ya/test_dir

[TEST 3] CREATE FILE IN DIRECTORY
------------------------------------------------------------
[CMD] echo "File in directory" > "/root/tavo/ya/test_dir/file_in_dir.txt"

[TEST 4] LIST DIRECTORY CONTENTS
------------------------------------------------------------
[CMD] ls -la "/root/tavo/ya/test_dir"
total 1
drwxrwxrwx. 2 root root  0 Mar  2 20:58 .
drwxrwxrwx. 4 root root  0 Mar  2 20:58 ..
-rwxrwxrwx. 1 root root 18 Mar  2 20:58 file_in_dir.txt

[TEST 5] CREATE NESTED DIRECTORIES (Level 1)
------------------------------------------------------------
[CMD] mkdir "/root/tavo/ya/nested"

[TEST 6] CREATE NESTED DIRECTORIES (Level 2)
------------------------------------------------------------
[CMD] mkdir "/root/tavo/ya/nested/level1"

[TEST 7] CREATE NESTED DIRECTORIES (Level 3)
------------------------------------------------------------
[CMD] mkdir "/root/tavo/ya/nested/level1/level2"

[TEST 8] CREATE FILE IN NESTED DIRECTORY
------------------------------------------------------------
[CMD] echo "Deep file" > "/root/tavo/ya/nested/level1/level2/deep_file.txt"

[TEST 9] VERIFY NESTED STRUCTURE
------------------------------------------------------------
[CMD] find "/root/tavo/ya/nested" -type f
/root/tavo/ya/nested/level1/level2/deep_file.txt

[TEST 10] COPY DIRECTORY
------------------------------------------------------------
[CMD] cp -r "/root/tavo/ya/test_dir" "/root/tavo/ya/test_dir_copy"

[TEST 11] VERIFY DIRECTORY COPY
------------------------------------------------------------
[CMD] ls -la "/root/tavo/ya/test_dir_copy"
total 1
drwxrwxrwx. 2 root root  0 Mar  2 20:58 .
drwxrwxrwx. 6 root root  0 Mar  2 20:58 ..
-rwxrwxrwx. 1 root root 18 Mar  2 20:58 file_in_dir.txt

[TEST 12] RENAME DIRECTORY
------------------------------------------------------------
[CMD] mv "/root/tavo/ya/test_dir_copy" "/root/tavo/ya/test_dir_renamed"

[TEST 13] VERIFY DIRECTORY RENAME
------------------------------------------------------------
[CMD] ls -ld "/root/tavo/ya/test_dir_renamed"
drwxrwxrwx. 2 root root 0 Mar  2 20:58 /root/tavo/ya/test_dir_renamed

[TEST 14] DELETE EMPTY DIRECTORY
------------------------------------------------------------
[CMD] mkdir "/root/tavo/ya/empty_dir"
[CMD] rmdir "/root/tavo/ya/empty_dir"

[TEST 15] DELETE DIRECTORY WITH CONTENTS
------------------------------------------------------------
[CMD] rm -rf "/root/tavo/ya/test_dir_renamed"

[TEST 16] VERIFY DIRECTORY DELETION
------------------------------------------------------------
[CMD] ls "/root/tavo/ya/test_dir_renamed" 2>&1
ls: cannot access '/root/tavo/ya/test_dir_renamed': No such file or directory
[INFO] Directory successfully deleted (expected error)

[TEST 17] SET DIRECTORY PERMISSIONS
------------------------------------------------------------
[CMD] chmod 755 "/root/tavo/ya/test_dir"

[TEST 18] VERIFY DIRECTORY PERMISSIONS
------------------------------------------------------------
[CMD] ls -ld "/root/tavo/ya/test_dir"
drwxrwxrwx. 2 root root 0 Mar  2 20:58 /root/tavo/ya/test_dir

[TEST 19] CREATE DIRECTORY WITH UNICODE NAME (Japanese)
------------------------------------------------------------
[CMD] mkdir "/root/tavo/ya/ディレクトリ"

[CMD] ls -ld "/root/tavo/ya/ディレクトリ"
drwxrwxrwx. 2 root root 0 Mar  2 20:58 /root/tavo/ya/ディレクトリ

[TEST 20] CREATE FILE IN UNICODE DIRECTORY
------------------------------------------------------------
[CMD] echo "File in Unicode directory" > "/root/tavo/ya/ディレクトリ/unicode_test.txt"

[CMD] ls -la "/root/tavo/ya/ディレクトリ"
total 1
drwxrwxrwx. 2 root root  0 Mar  2 20:58 .
drwxrwxrwx. 6 root root  0 Mar  2 20:58 ..
-rwxrwxrwx. 1 root root 26 Mar  2 20:58 unicode_test.txt

============================================================
 DIRECTORY OPERATIONS TEST MODULE - COMPLETED
============================================================

============================================================
 PHASE 6 - LTFSCK CHECK OPERATIONS
============================================================

[TEST] UNMOUNT
------------------------------------------------------------
[CMD] sudo umount /root/tavo/ya/
[CMD] sleep 120

[TEST] CHECK TAPE (ltfsck)
------------------------------------------------------------
[CMD] sudo ltfsck /dev/sg7
LTFS16000I Starting ltfsck, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS16088I Launched by "ltfsck /dev/sg7".
LTFS16089I This binary is built for Linux (x86_64).
LTFS16090I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS16014I Checking LTFS file system on '/dev/sg7'.
LTFS30252I Logical block protection is disabled.
LTFS16023I LTFS volume information:.
LTFS16024I Volser (bar code) :       .
LTFS16025I Volume UUID     : c8e5d235-7dc3-4cdc-88ec-3d5aa5b1d3f1.
LTFS16026I Format time     : 2026-03-02 20:52:06.775081350 EST.
LTFS16027I Block size      : 524288.
LTFS16028I Compression     : Enabled.
LTFS16029I Index partition : ID = a, SCSI Partition = 0.
LTFS16030I Data partition  : ID = b, SCSI Partition = 1.

LTFS11005I Mounting the volume.
LTFS30252I Logical block protection is disabled.
LTFS11026I Performing a full medium consistency check.
LTFS11233I Updating MAM coherency data.
LTFS17227I Tape attribute: Vendor = IBM.
LTFS17227I Tape attribute: Application Name = LTF.
LTFS17227I Tape attribute: Application Version = 2.4.
LTFS17227I Tape attribute: Medium Label = .
LTFS17228I Tape attribute: Text Localization ID = 0x81.
LTFS17227I Tape attribute: Barcode =    .
LTFS17227I Tape attribute: Application Format Version = 2.4.
LTFS17228I Tape attribute: Volume Lock Status = 0x00.
LTFS17227I Tape attribute: Media Pool name = .
LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
LTFS16031I Data placement policy information:.
LTFS16032I Size threshold : 1048576.
LTFS16033I Name pattern   : *.jpg.
LTFS16033I Name pattern   : *.png.
LTFS16034I Policy update  : Allowed.

LTFS17265I Skip writing the index because of the volume is not dirty and current self pointer points IP.
LTFS11034I Volume unmounted successfully.
LTFS16022I Volume is consistent.
LTFS30252I Logical block protection is disabled.
[WARN] ltfsck/ltfs -o device_list returned exit code 1 (treated as non-fatal).

[TEST] LIST ROLLBACK POINTS
------------------------------------------------------------
[CMD] sudo ltfsck -l /dev/sg7
LTFS16000I Starting ltfsck, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS16088I Launched by "ltfsck -l /dev/sg7".
LTFS16089I This binary is built for Linux (x86_64).
LTFS16090I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS16084I List indexes in backward direction strategy.
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS16018I Listing LTFS file system rollback points on '/dev/sg7'.
LTFS30252I Logical block protection is disabled.
LTFS16023I LTFS volume information:.
LTFS16024I Volser (bar code) :       .
LTFS16025I Volume UUID     : c8e5d235-7dc3-4cdc-88ec-3d5aa5b1d3f1.
LTFS16026I Format time     : 2026-03-02 20:52:06.775081350 EST.
LTFS16027I Block size      : 524288.
LTFS16028I Compression     : Enabled.
LTFS16029I Index partition : ID = a, SCSI Partition = 0.
LTFS16030I Data partition  : ID = b, SCSI Partition = 1.

LTFS11005I Mounting the volume.
LTFS30252I Logical block protection is disabled.
LTFS17227I Tape attribute: Vendor = IBM.
LTFS17227I Tape attribute: Application Name = LTF.
LTFS17227I Tape attribute: Application Version = 2.4.
LTFS17227I Tape attribute: Medium Label = .
LTFS17228I Tape attribute: Text Localization ID = 0x81.
LTFS17227I Tape attribute: Barcode =    .
LTFS17227I Tape attribute: Application Format Version = 2.4.
LTFS17228I Tape attribute: Volume Lock Status = 0x00.
LTFS17227I Tape attribute: Media Pool name = .
LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
LTFS30252I Logical block protection is disabled.
Generation: Date       Time               Zone     SelfPtr->BackPtr (Part, Pos)
           (UTC Date   UTC Time           UTC)                                 
            Commit Message                                                     
-------------------------------------------------------------------------------
         2: 2026-03-02 20:58:29.439398084 EST      (0, 5)->(1, 1030)
           (2026-03-03 01:58:29.439398084 UTC)
            No commit message
         2: 2026-03-02 20:58:29.439398084 EST      (1, 1030)->(1, 5)
           (2026-03-03 01:58:29.439398084 UTC)
            No commit message
         1: 2026-03-02 20:53:31.334217555 EST      (1, 5) <<Initial Index>>
           (2026-03-03 01:53:31.334217555 UTC)
            No commit message

[TEST] LIST ROLLBACK POINTS (forward)
------------------------------------------------------------
[CMD] sudo ltfsck -l -v forward /dev/sg7
LTFS16000I Starting ltfsck, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS16088I Launched by "ltfsck -l -v forward /dev/sg7".
LTFS16089I This binary is built for Linux (x86_64).
LTFS16090I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS16083I List indexes in forward direction strategy.
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS16018I Listing LTFS file system rollback points on '/dev/sg7'.
LTFS30252I Logical block protection is disabled.
LTFS16023I LTFS volume information:.
LTFS16024I Volser (bar code) :       .
LTFS16025I Volume UUID     : c8e5d235-7dc3-4cdc-88ec-3d5aa5b1d3f1.
LTFS16026I Format time     : 2026-03-02 20:52:06.775081350 EST.
LTFS16027I Block size      : 524288.
LTFS16028I Compression     : Enabled.
LTFS16029I Index partition : ID = a, SCSI Partition = 0.
LTFS16030I Data partition  : ID = b, SCSI Partition = 1.

LTFS11005I Mounting the volume.
LTFS30252I Logical block protection is disabled.
LTFS17227I Tape attribute: Vendor = IBM.
LTFS17227I Tape attribute: Application Name = LTF.
LTFS17227I Tape attribute: Application Version = 2.4.
LTFS17227I Tape attribute: Medium Label = .
LTFS17228I Tape attribute: Text Localization ID = 0x81.
LTFS17227I Tape attribute: Barcode =    .
LTFS17227I Tape attribute: Application Format Version = 2.4.
LTFS17228I Tape attribute: Volume Lock Status = 0x00.
LTFS17227I Tape attribute: Media Pool name = .
LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
LTFS30252I Logical block protection is disabled.
Generation: Date       Time               Zone     SelfPtr->BackPtr (Part, Pos)
           (UTC Date   UTC Time           UTC)                                 
            Commit Message                                                     
-------------------------------------------------------------------------------
         2: 2026-03-02 20:58:29.439398084 EST      (0, 5)->(1, 1030)
           (2026-03-03 01:58:29.439398084 UTC)
            No commit message
         1: 2026-03-02 20:53:31.334217555 EST      (1, 5) <<Initial Index>>
           (2026-03-03 01:53:31.334217555 UTC)
            No commit message
         2: 2026-03-02 20:58:29.439398084 EST      (1, 1030)->(1, 5)
           (2026-03-03 01:58:29.439398084 UTC)
            No commit message

[TEST] LIST ROLLBACK POINTS (full info)
------------------------------------------------------------
[CMD] sudo ltfsck -l -m /dev/sg7
LTFS16000I Starting ltfsck, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS16088I Launched by "ltfsck -l -m /dev/sg7".
LTFS16089I This binary is built for Linux (x86_64).
LTFS16090I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS16084I List indexes in backward direction strategy.
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS16018I Listing LTFS file system rollback points on '/dev/sg7'.
LTFS30252I Logical block protection is disabled.
LTFS16023I LTFS volume information:.
LTFS16024I Volser (bar code) :       .
LTFS16025I Volume UUID     : c8e5d235-7dc3-4cdc-88ec-3d5aa5b1d3f1.
LTFS16026I Format time     : 2026-03-02 20:52:06.775081350 EST.
LTFS16027I Block size      : 524288.
LTFS16028I Compression     : Enabled.
LTFS16029I Index partition : ID = a, SCSI Partition = 0.
LTFS16030I Data partition  : ID = b, SCSI Partition = 1.

LTFS11005I Mounting the volume.
LTFS30252I Logical block protection is disabled.
LTFS17227I Tape attribute: Vendor = IBM.
LTFS17227I Tape attribute: Application Name = LTF.
LTFS17227I Tape attribute: Application Version = 2.4.
LTFS17227I Tape attribute: Medium Label = .
LTFS17228I Tape attribute: Text Localization ID = 0x81.
LTFS17227I Tape attribute: Barcode =    .
LTFS17227I Tape attribute: Application Format Version = 2.4.
LTFS17228I Tape attribute: Volume Lock Status = 0x00.
LTFS17227I Tape attribute: Media Pool name = .
LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
LTFS30252I Logical block protection is disabled.
Generation: Date       Time               Zone     SelfPtr->BackPtr (Part, Pos)
           (UTC Date   UTC Time           UTC)                                 
            LTFS Format Version, Creator
            Volume name
            Placement Policy: [Overwrite] size_threshold pattern
            Commit Message                                                     
-------------------------------------------------------------------------------
         2: 2026-03-02 20:58:29.439398084 EST      (0, 5)->(1, 1030)
           (2026-03-03 01:58:29.439398084 UTC)
            2.4.0, "IBM LTFS 2.4.5.1 (Prelim) - Linux - ltfs - Unmount"
            No Volume Name
            [  Allowed  ] 1048576 *.jpg *.png 
            No commit message
         2: 2026-03-02 20:58:29.439398084 EST      (1, 1030)->(1, 5)
           (2026-03-03 01:58:29.439398084 UTC)
            2.4.0, "IBM LTFS 2.4.5.1 (Prelim) - Linux - ltfs - Unmount"
            No Volume Name
            [  Allowed  ] 1048576 *.jpg *.png 
            No commit message
         1: 2026-03-02 20:53:31.334217555 EST      (1, 5) <<Initial Index>>
           (2026-03-03 01:53:31.334217555 UTC)
            2.4.0, "IBM LTFS 2.4.5.1 (Prelim) - Linux - mkltfs - Format"
            No Volume Name
            [  Allowed  ] 1048576 *.jpg *.png 
            No commit message

============================================================
 PHASE 7 - LTFSCK ROLLBACK OPERATIONS
============================================================

[TEST] VERIFY ROLLBACK POINT (generation 2)
------------------------------------------------------------
[CMD] sudo ltfsck -g 2 -n /dev/sg7
LTFS16000I Starting ltfsck, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS16088I Launched by "ltfsck -g 2 -n /dev/sg7".
LTFS16089I This binary is built for Linux (x86_64).
LTFS16090I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS16006I Rolling back to generation 2.
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS16017I Verify rollback point on '/dev/sg7'.
LTFS30252I Logical block protection is disabled.
LTFS16023I LTFS volume information:.
LTFS16024I Volser (bar code) :       .
LTFS16025I Volume UUID     : c8e5d235-7dc3-4cdc-88ec-3d5aa5b1d3f1.
LTFS16026I Format time     : 2026-03-02 20:52:06.775081350 EST.
LTFS16027I Block size      : 524288.
LTFS16028I Compression     : Enabled.
LTFS16029I Index partition : ID = a, SCSI Partition = 0.
LTFS16030I Data partition  : ID = b, SCSI Partition = 1.

LTFS11005I Mounting the volume.
LTFS30252I Logical block protection is disabled.
LTFS17227I Tape attribute: Vendor = IBM.
LTFS17227I Tape attribute: Application Name = LTF.
LTFS17227I Tape attribute: Application Version = 2.4.
LTFS17227I Tape attribute: Medium Label = .
LTFS17228I Tape attribute: Text Localization ID = 0x81.
LTFS17227I Tape attribute: Barcode =    .
LTFS17227I Tape attribute: Application Format Version = 2.4.
LTFS17228I Tape attribute: Volume Lock Status = 0x00.
LTFS17227I Tape attribute: Media Pool name = .
LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
LTFS17265I Skip writing the index because of the volume is not dirty and current self pointer points IP.
LTFS11034I Volume unmounted successfully.
LTFS16063I Specified rollback point is the current index. The volume is consistent. No operation is required.
LTFS30252I Logical block protection is disabled.

[TEST] ROLLBACK TO GENERATION 2
------------------------------------------------------------
[CMD] sudo ltfsck -g 2 -r /dev/sg7
LTFS16000I Starting ltfsck, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS16088I Launched by "ltfsck -g 2 -r /dev/sg7".
LTFS16089I This binary is built for Linux (x86_64).
LTFS16090I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS16006I Rolling back to generation 2.
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS16015I Rolling back LTFS file system on '/dev/sg7'.
LTFS30252I Logical block protection is disabled.
LTFS16023I LTFS volume information:.
LTFS16024I Volser (bar code) :       .
LTFS16025I Volume UUID     : c8e5d235-7dc3-4cdc-88ec-3d5aa5b1d3f1.
LTFS16026I Format time     : 2026-03-02 20:52:06.775081350 EST.
LTFS16027I Block size      : 524288.
LTFS16028I Compression     : Enabled.
LTFS16029I Index partition : ID = a, SCSI Partition = 0.
LTFS16030I Data partition  : ID = b, SCSI Partition = 1.

LTFS11005I Mounting the volume.
LTFS30252I Logical block protection is disabled.
LTFS17227I Tape attribute: Vendor = IBM.
LTFS17227I Tape attribute: Application Name = LTF.
LTFS17227I Tape attribute: Application Version = 2.4.
LTFS17227I Tape attribute: Medium Label = .
LTFS17228I Tape attribute: Text Localization ID = 0x81.
LTFS17227I Tape attribute: Barcode =    .
LTFS17227I Tape attribute: Application Format Version = 2.4.
LTFS17228I Tape attribute: Volume Lock Status = 0x00.
LTFS17227I Tape attribute: Media Pool name = .
LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
LTFS17265I Skip writing the index because of the volume is not dirty and current self pointer points IP.
LTFS11034I Volume unmounted successfully.
LTFS16063I Specified rollback point is the current index. The volume is consistent. No operation is required.
LTFS30252I Logical block protection is disabled.

[TEST] ROLLBACK WITH ERASE HISTORY
------------------------------------------------------------
[CMD] sudo ltfsck -g 2 -r -j /dev/sg7
LTFS16000I Starting ltfsck, LTFS version 2.4.5.1 (Prelim), log level 2.
LTFS16088I Launched by "ltfsck -g 2 -r -j /dev/sg7".
LTFS16089I This binary is built for Linux (x86_64).
LTFS16090I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
LTFS16006I Rolling back to generation 2.
LTFS17085I Plugin: Loading "sg" tape backend.
LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
LTFS30207I Vendor ID is IBM     .
LTFS30208I Product ID is ULT3580-HH9     .
LTFS30214I Firmware revision is Q9E9.
LTFS30215I Drive serial is 1013002519.
LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
LTFS30294I Setting up timeout values from RSOC.
LTFS17160I Maximum device block size is 1048576.
LTFS11330I Loading cartridge.
LTFS30252I Logical block protection is disabled.
LTFS11332I Load successful.
LTFS17157I Changing the drive setting to write-anywhere mode.
LTFS16015I Rolling back LTFS file system on '/dev/sg7'.
LTFS30252I Logical block protection is disabled.
LTFS16023I LTFS volume information:.
LTFS16024I Volser (bar code) :       .
LTFS16025I Volume UUID     : c8e5d235-7dc3-4cdc-88ec-3d5aa5b1d3f1.
LTFS16026I Format time     : 2026-03-02 20:52:06.775081350 EST.
LTFS16027I Block size      : 524288.
LTFS16028I Compression     : Enabled.
LTFS16029I Index partition : ID = a, SCSI Partition = 0.
LTFS16030I Data partition  : ID = b, SCSI Partition = 1.

LTFS11005I Mounting the volume.
LTFS30252I Logical block protection is disabled.
LTFS17227I Tape attribute: Vendor = IBM.
LTFS17227I Tape attribute: Application Name = LTF.
LTFS17227I Tape attribute: Application Version = 2.4.
LTFS17227I Tape attribute: Medium Label = .
LTFS17228I Tape attribute: Text Localization ID = 0x81.
LTFS17227I Tape attribute: Barcode =    .
LTFS17227I Tape attribute: Application Format Version = 2.4.
LTFS17228I Tape attribute: Volume Lock Status = 0x00.
LTFS17227I Tape attribute: Media Pool name = .
LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
LTFS17265I Skip writing the index because of the volume is not dirty and current self pointer points IP.
LTFS11034I Volume unmounted successfully.
LTFS16063I Specified rollback point is the current index. The volume is consistent. No operation is required.
LTFS30252I Logical block protection is disabled.

============================================================
 PHASE 8 - LTFS MOUNT OPTIONS
============================================================

[TEST] ROLLBACK MOUNT (generation 2)
------------------------------------------------------------
[CMD] sudo ltfs -o devname=/dev/sg7 -o rollback_mount=2 /root/tavo/ya/
16ff5 LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
16ff5 LTFS14058I LTFS Format Specification version 2.4.0.
16ff5 LTFS14104I Launched by "ltfs -o devname=/dev/sg7 -o rollback_mount=2 /root/tavo/ya/".
16ff5 LTFS14105I This binary is built for Linux (x86_64).
16ff5 LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
16ff5 LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
16ff5 LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
16ff5 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
16ff5 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
16ff5 LTFS14063I Sync type is "time", Sync time is 300 sec.
16ff5 LTFS17085I Plugin: Loading "sg" tape backend.
16ff5 LTFS17085I Plugin: Loading "unified" iosched backend.
16ff5 LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
16ff5 LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
16ff5 LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
16ff5 LTFS30207I Vendor ID is IBM     .
16ff5 LTFS30208I Product ID is ULT3580-HH9     .
16ff5 LTFS30214I Firmware revision is Q9E9.
16ff5 LTFS30215I Drive serial is 1013002519.
16ff5 LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
16ff5 LTFS30294I Setting up timeout values from RSOC.
16ff5 LTFS17160I Maximum device block size is 1048576.
16ff5 LTFS11330I Loading cartridge.
16ff5 LTFS30252I Logical block protection is disabled.
16ff5 LTFS11332I Load successful.
16ff5 LTFS17157I Changing the drive setting to write-anywhere mode.
16ff5 LTFS11005I Mounting the volume.
16ff5 LTFS30252I Logical block protection is disabled.
16ff5 LTFS17227I Tape attribute: Vendor = IBM.
16ff5 LTFS17227I Tape attribute: Application Name = LTF.
16ff5 LTFS17227I Tape attribute: Application Version = 2.4.
16ff5 LTFS17227I Tape attribute: Medium Label = .
16ff5 LTFS17228I Tape attribute: Text Localization ID = 0x81.
16ff5 LTFS17227I Tape attribute: Barcode =    .
16ff5 LTFS17227I Tape attribute: Application Format Version = 2.4.
16ff5 LTFS17228I Tape attribute: Volume Lock Status = 0x00.
16ff5 LTFS17227I Tape attribute: Media Pool name = .
16ff5 LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
16ff5 LTFS14072I Rollback mount is specified. Mounting as read-only at generation 2.
16ff5 LTFS14111I Initial setup completed successfully.
16ff5 LTFS14112I Invoke 'mount' command to check the result of final setup.
16ff5 LTFS14113I Specified mount point is listed if succeeded.

[TEST] UNMOUNT
------------------------------------------------------------
[CMD] sudo umount /root/tavo/ya/
[CMD] sleep 5

[TEST] FORCE MOUNT NO EOD
------------------------------------------------------------
[CMD] sudo ltfs -o devname=/dev/sg7 -o force_mount_no_eod /root/tavo/ya/
17167 LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
17167 LTFS14058I LTFS Format Specification version 2.4.0.
17167 LTFS14104I Launched by "ltfs -o devname=/dev/sg7 -o force_mount_no_eod /root/tavo/ya/".
17167 LTFS14105I This binary is built for Linux (x86_64).
17167 LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
17167 LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
17167 LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
17167 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
17167 LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
17167 LTFS14063I Sync type is "time", Sync time is 300 sec.
17167 LTFS17085I Plugin: Loading "sg" tape backend.
17167 LTFS17085I Plugin: Loading "unified" iosched backend.
17167 LTFS14095I Set the tape device write-anywhere mode to avoid cartridge ejection.
17167 LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
17167 LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
17167 LTFS30207I Vendor ID is IBM     .
17167 LTFS30208I Product ID is ULT3580-HH9     .
17167 LTFS30214I Firmware revision is Q9E9.
17167 LTFS30215I Drive serial is 1013002519.
17167 LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
17167 LTFS30294I Setting up timeout values from RSOC.
17167 LTFS17160I Maximum device block size is 1048576.
17167 LTFS11330I Loading cartridge.
17167 LTFS30252I Logical block protection is disabled.
17167 LTFS11332I Load successful.
17167 LTFS17157I Changing the drive setting to write-anywhere mode.
17167 LTFS14076I Attempting to mount the cartridge without EOD existence check.
17167 LTFS14077I The cartridge will be mounted as read-only.
17167 LTFS11005I Mounting the volume.
17167 LTFS30252I Logical block protection is disabled.
17167 LTFS17227I Tape attribute: Vendor = IBM.
17167 LTFS17227I Tape attribute: Application Name = LTF.
17167 LTFS17227I Tape attribute: Application Version = 2.4.
17167 LTFS17227I Tape attribute: Medium Label = .
17167 LTFS17228I Tape attribute: Text Localization ID = 0x81.
17167 LTFS17227I Tape attribute: Barcode =    .
17167 LTFS17227I Tape attribute: Application Format Version = 2.4.
17167 LTFS17228I Tape attribute: Volume Lock Status = 0x00.
17167 LTFS17227I Tape attribute: Media Pool name = .
17167 LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
17167 LTFS14111I Initial setup completed successfully.
17167 LTFS14112I Invoke 'mount' command to check the result of final setup.
17167 LTFS14113I Specified mount point is listed if succeeded.

============================================================
 PHASE 9 - TAPE CLEANUP
============================================================

[TEST] UNMOUNT
------------------------------------------------------------
[CMD] sudo umount /root/tavo/ya/
[CMD] sleep 5

[TEST] MOUNT WITH EJECT OPTION
------------------------------------------------------------
[CMD] sudo ltfs -o devname=/dev/sg7 -o eject /root/tavo/ya/
1723f LTFS14000I LTFS starting, LTFS version 2.4.5.1 (Prelim), log level 2.
1723f LTFS14058I LTFS Format Specification version 2.4.0.
1723f LTFS14104I Launched by "ltfs -o devname=/dev/sg7 -o eject /root/tavo/ya/".
1723f LTFS14105I This binary is built for Linux (x86_64).
1723f LTFS14106I GCC version is 8.5.0 20210514 (Red Hat 8.5.0-26).
1723f LTFS17087I Kernel version: Linux version 4.18.0-553.107.1.el8_10.x86_64 (mockbuild@x86-64-03.build.eng.rdu2.redhat.com) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-28) (GCC)) #1 SMP Tue Feb 17 05:52:05 EST 2026 i386.
1723f LTFS17089I Distribution: NAME="Red Hat Enterprise Linux".
1723f LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
1723f LTFS17089I Distribution: Red Hat Enterprise Linux release 8.10 (Ootpa).
1723f LTFS14063I Sync type is "time", Sync time is 300 sec.
1723f LTFS17085I Plugin: Loading "sg" tape backend.
1723f LTFS17085I Plugin: Loading "unified" iosched backend.
1723f LTFS30209I Opening a device through sg-ibmtape driver (/dev/sg7).
1723f LTFS30250I Opened the SCSI tape device 8.0.1.0 (/dev/sg7).
1723f LTFS30207I Vendor ID is IBM     .
1723f LTFS30208I Product ID is ULT3580-HH9     .
1723f LTFS30214I Firmware revision is Q9E9.
1723f LTFS30215I Drive serial is 1013002519.
1723f LTFS30285I The reserved buffer size of /dev/sg7 is 1048576.
1723f LTFS30294I Setting up timeout values from RSOC.
1723f LTFS17160I Maximum device block size is 1048576.
1723f LTFS11330I Loading cartridge.
1723f LTFS30252I Logical block protection is disabled.
1723f LTFS11332I Load successful.
1723f LTFS17157I Changing the drive setting to append-only mode.
1723f LTFS11005I Mounting the volume.
1723f LTFS30252I Logical block protection is disabled.
1723f LTFS17227I Tape attribute: Vendor = IBM.
1723f LTFS17227I Tape attribute: Application Name = LTF.
1723f LTFS17227I Tape attribute: Application Version = 2.4.
1723f LTFS17227I Tape attribute: Medium Label = .
1723f LTFS17228I Tape attribute: Text Localization ID = 0x81.
1723f LTFS17227I Tape attribute: Barcode =    .
1723f LTFS17227I Tape attribute: Application Format Version = 2.4.
1723f LTFS17228I Tape attribute: Volume Lock Status = 0x00.
1723f LTFS17227I Tape attribute: Media Pool name = .
1723f LTFS11031I Volume mounted successfully. NO_BARCODE : Gen = 2 / (a, 5) -> (b, 1030) / 1013002519.
1723f LTFS14111I Initial setup completed successfully.
1723f LTFS14112I Invoke 'mount' command to check the result of final setup.
1723f LTFS14113I Specified mount point is listed if succeeded.

[TEST] UNMOUNT (will eject)
------------------------------------------------------------
[CMD] sudo umount /root/tavo/ya/
[CMD] sleep 5

============================================================
 Script completed successfully.
============================================================

@Piloalucard
Copy link
Member Author

SDE integration tests on Windows

PS C:\Users\Administrator\Documents\batch> .\SDE_Windows.cmd 0.0.15.0 Z
============================================================
 IBM Storage Archive SDE for Windows - Common Operations Script
 Working Path  : C:\Program Files\IBM\LTFS
 Drive Address : 0.0.15.0
 Drive Letter  : Z:
 Tape Path     : Z:\
============================================================

============================================================
 SERVICE CHECK - LtfsAtMntSvc
============================================================
[INFO] LtfsAtMntSvc is not running - no action needed.

============================================================
 PHASE 1 - PRE-MOUNT CHECKS
============================================================

[TEST] CHECK VERSION
------------------------------------------------------------
[CMD] .\mkltfs.exe --version
LTFS9015W Setting the locale to 'en_US.UTF-8'. If this is wrong, please set the LANG environment variable before starting mkltfs.
mkltfs version 2.4.8.
LTFS Format Specification version 2.4.0.

[TEST] CHECK DRIVE
------------------------------------------------------------
[CMD] .\LtfsCmdDrives.exe
Assigned   Address      Serial                   Status
---------- ------------ ------------------------ --------------------
           0.0.15.0     117193D05B               RESET

============================================================
 PHASE 2 - ASSIGN DRIVE
============================================================

[TEST] ASSIGN
------------------------------------------------------------
[CMD] .\LtfsCmdAssign.exe Z 0.0.15.0

============================================================
 PHASE 3 - LOAD TAPE
============================================================

[TEST] LOAD
------------------------------------------------------------
[CMD] .\LtfsCmdLoad.exe Z
LTFS60201E Drive interface call 'MountMedium' returned error (False)

============================================================
 PHASE 4 - FORMAT TAPE
============================================================

[TEST] FORMAT
------------------------------------------------------------
[CMD] .\LtfsCmdFormat.exe Z /S:SRLTST /N:LBLTST
The medium has been formatted as a LTFS medium.
Volume UUID is: 22f0f332-a627-40ae-88ef-d4d96069570f.

============================================================
 PHASE 5 - FILE OPERATIONS
============================================================

============================================================
 FILE OPERATIONS  |  Z:
============================================================
[INFO] Working in tape directory: Z:

[TEST] CREATE TEXT FILE
------------------------------------------------------------
[CMD] echo Hello LTFS > "Z:\test.txt"
[CMD] type "Z:\test.txt"
Hello LTFS

[TEST] CREATE BINARY FILE
------------------------------------------------------------
[CMD] powershell WriteAllBytes "Z:\binary_test.bin" 1048576
[CMD] dir "Z:\binary_test.bin"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

03/03/2026  07:41 AM         1,048,576 binary_test.bin
               1 File(s)      1,048,576 bytes
               0 Dir(s)  2,408,082,046,976 bytes free

[TEST] CREATE MULTIPLE FILES
------------------------------------------------------------
[CMD] for /L %i in (1,1,5) do echo File %i > "Z:\file_%i.txt"
[CMD] dir "Z:\file_*.txt"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

03/03/2026  07:42 AM                 9 file_1.txt
03/03/2026  07:42 AM                 9 file_2.txt
03/03/2026  07:42 AM                 9 file_3.txt
03/03/2026  07:42 AM                 9 file_4.txt
03/03/2026  07:42 AM                 9 file_5.txt
               5 File(s)             45 bytes
               0 Dir(s)  2,408,082,046,976 bytes free

[TEST] READ FILE CONTENT
------------------------------------------------------------
[CMD] type "Z:\test.txt"
Hello LTFS

[TEST] VERIFY FILE SIZE
------------------------------------------------------------
[CMD] dir "Z:\binary_test.bin"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

03/03/2026  07:41 AM         1,048,576 binary_test.bin
               1 File(s)      1,048,576 bytes
               0 Dir(s)  2,408,078,901,248 bytes free

[TEST] APPEND TO FILE
------------------------------------------------------------
[CMD] echo Additional line >> "Z:\test.txt"
[CMD] type "Z:\test.txt"
Hello LTFS
Additional line

[TEST] OVERWRITE FILE
------------------------------------------------------------
[CMD] echo New content > "Z:\test.txt"
[CMD] type "Z:\test.txt"
New content

[TEST] COPY FILE
------------------------------------------------------------
[CMD] echo Source content > "Z:\source.txt"
[CMD] copy "Z:\source.txt" "Z:\copy.txt"
        1 file(s) copied.
[CMD] type "Z:\copy.txt"
Source content

[TEST] RENAME FILE
------------------------------------------------------------
[CMD] echo Rename test > "Z:\old_name.txt"
[CMD] copy "Z:\old_name.txt" "Z:\new_name.txt"
        1 file(s) copied.
[CMD] del "Z:\old_name.txt"
[CMD] dir "Z:\new_name.txt"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

03/03/2026  07:43 AM                14 new_name.txt
               1 File(s)             14 bytes
               0 Dir(s)  2,408,065,269,760 bytes free

[TEST] DELETE SINGLE FILE
------------------------------------------------------------
[CMD] del "Z:\file_1.txt"
[CMD] dir "Z:\file_1.txt"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

File Not Found

[TEST] DELETE MULTIPLE FILES
------------------------------------------------------------
[CMD] del "Z:\file_*.txt"
[CMD] dir "Z:\file_*.txt"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

File Not Found

[TEST] FILE WITH SPACES
------------------------------------------------------------
[CMD] echo Space test > "Z:\file with spaces.txt"
[CMD] type "Z:\file with spaces.txt"
Space test

[TEST] FILE WITH SPECIAL CHARS
------------------------------------------------------------
[CMD] echo Special > "Z:\file_with-chars@123.txt"
[CMD] type "Z:\file_with-chars@123.txt"
Special

[TEST] FILE WITH PARENTHESES
------------------------------------------------------------
[CMD] echo Parens > "Z:\file(test).txt"
[CMD] type "Z:\file(test).txt"
Parens

[TEST] LONG FILENAME
------------------------------------------------------------
[CMD] echo Long name > "Z:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt"
[CMD] dir "Z:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

03/03/2026  07:44 AM                12 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt
               1 File(s)             12 bytes
               0 Dir(s)  2,408,056,881,152 bytes free

[TEST] FILE WITH DOTS
------------------------------------------------------------
[CMD] echo Dots > "Z:\file.with.many.dots.txt"
[CMD] type "Z:\file.with.many.dots.txt"
Dots

[TEST] NUMERIC FILENAME
------------------------------------------------------------
[CMD] echo Numbers > "Z:\123456789.txt"
[CMD] type "Z:\123456789.txt"
Numbers

[TEST] DEEP DIRECTORY TREE
------------------------------------------------------------
[CMD] mkdir "Z:\d1"
[CMD] mkdir "Z:\d1\d2"
[CMD] mkdir "Z:\d1\d2\d3"
[CMD] mkdir "Z:\d1\d2\d3\d4"
[CMD] mkdir "Z:\d1\d2\d3\d4\d5"
[CMD] echo Deep > "Z:\d1\d2\d3\d4\d5\deep.txt"
[CMD] type "Z:\d1\d2\d3\d4\d5\deep.txt"
Deep

[TEST] CREATE MULTIPLE FILE TYPES
------------------------------------------------------------
[CMD] echo {"key":"value"} > "Z:\data.json"
[CMD] echo <?xml version="1.0"?><root></root> > "Z:\data.xml"
[CMD] echo name,age > "Z:\data.csv"
[CMD] echo John,30 >> "Z:\data.csv"
[CMD] dir "Z:\data.*"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

03/03/2026  07:44 AM                18 data.json
03/03/2026  07:45 AM                37 data.xml
03/03/2026  07:45 AM                21 data.csv
               3 File(s)             76 bytes
               0 Dir(s)  2,408,046,395,392 bytes free

[TEST] CREATE LARGE FILE
------------------------------------------------------------
[CMD] powershell WriteAllBytes "Z:\large_file.bin" 10485760
[CMD] dir "Z:\large_file.bin"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

03/03/2026  07:45 AM        10,485,760 large_file.bin
               1 File(s)     10,485,760 bytes
               0 Dir(s)  2,408,046,395,392 bytes free

[TEST] COPY LARGE FILE
------------------------------------------------------------
[CMD] copy "Z:\large_file.bin" "Z:\large_file_copy.bin"
        1 file(s) copied.
[CMD] dir "Z:\large_file_copy.bin"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

03/03/2026  07:45 AM        10,485,760 large_file_copy.bin
               1 File(s)     10,485,760 bytes
               0 Dir(s)  2,408,034,861,056 bytes free

[TEST] FILE WITH UNICODE CHARACTERS
------------------------------------------------------------
[CMD] powershell WriteAllText "Z:\[U+65E5U+672CU+8A9EU+30C6U+30B9U+30C8].txt" (UTF-8)
[CMD] powershell Get-Content "Z:\[U+65E5U+672CU+8A9EU+30C6U+30B9U+30C8].txt" -Encoding UTF8
こんにちは,LTFSテスト
[CMD] dir "Z:\" /B | findstr /R "."
Found: 日本語テスト.txt

[TEST 21] FILE TRUNCATE OPERATIONS
------------------------------------------------------------
[CMD] echo This is a long line of text that will be truncated > "Z:\truncate_test.txt"
[CMD] powershell -Command "$file = 'Z:\truncate_test.txt'; $stream = [System.IO.File]::Open($file, 'Open'); $stream.SetLength(10); $stream.Close()"
File size: 10 bytes

[TEST 22] FILE OVERWRITE OPERATIONS
------------------------------------------------------------
[CMD] echo Original content > "Z:\overwrite_test.txt"
[CMD] echo New content > "Z:\overwrite_test.txt"
New content

[TEST 23] BINARY FILE WITH CHECKSUM
------------------------------------------------------------
[CMD] powershell -Command "$bytes = New-Object byte[] 102400; (New-Object Random).NextBytes($bytes); [IO.File]::WriteAllBytes('Z:\binary_checksum.bin', $bytes)"
[CMD] powershell -Command "Get-FileHash 'Z:\binary_checksum.bin' -Algorithm MD5"

Hash
----
FF9B3EC47517CA5A31FE8E2F14A68C62



[TEST 24] MULTIPLE FILE TYPES
------------------------------------------------------------
[CMD] mkdir "Z:\mixed_types"
[CMD] echo Text content > "Z:\mixed_types\file.txt"
[CMD] echo {"key": "value", "number": 42} > "Z:\mixed_types\file.json"
[CMD] echo <?xml version="1.0"?><root><item>test</item></root> > "Z:\mixed_types\file.xml"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\mixed_types

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM                15 file.txt
03/03/2026  07:46 AM                33 file.json
03/03/2026  07:46 AM                54 file.xml
               3 File(s)            102 bytes
               2 Dir(s)  2,408,025,423,872 bytes free

[TEST 25] CONCURRENT FILE OPERATIONS
------------------------------------------------------------
[CMD] Creating 5 files concurrently...
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\

03/03/2026  07:46 AM                15 concurrent_1.txt
03/03/2026  07:46 AM                15 concurrent_2.txt
03/03/2026  07:46 AM                15 concurrent_3.txt
03/03/2026  07:46 AM                15 concurrent_4.txt
03/03/2026  07:46 AM                15 concurrent_5.txt
               5 File(s)             75 bytes
               0 Dir(s)  2,408,025,423,872 bytes free

============================================================
 FILE OPERATIONS COMPLETE
 Total Tests: 25
============================================================

============================================================
 PHASE 6 - DIRECTORY OPERATIONS
============================================================

============================================================
 DIRECTORY OPERATIONS  |  Z:
============================================================

[TEST] DIR: CREATE SINGLE DIRECTORY
------------------------------------------------------------
[CMD] mkdir "Z:\dir_single"
[CMD] dir "Z:\" | findstr dir_single
03/03/2026  07:46 AM    <DIR>          dir_single

[TEST] DIR: CREATE NESTED DIRECTORY STRUCTURE
------------------------------------------------------------
[CMD] mkdir "Z:\parent"
[CMD] mkdir "Z:\parent\child"
[CMD] mkdir "Z:\parent\child\grandchild"
[CMD] dir "Z:\parent\child"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\parent\child

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM    <DIR>          grandchild
               0 File(s)              0 bytes
               3 Dir(s)  2,408,025,423,872 bytes free

[TEST] DIR: CREATE MULTIPLE DIRECTORIES
------------------------------------------------------------
[CMD] mkdir "Z:\multi_dir_1"
[CMD] mkdir "Z:\multi_dir_2"
[CMD] mkdir "Z:\multi_dir_3"
[CMD] mkdir "Z:\multi_dir_4"
[CMD] mkdir "Z:\multi_dir_5"
[CMD] dir "Z:\" | findstr multi_dir_
03/03/2026  07:46 AM    <DIR>          multi_dir_1
03/03/2026  07:46 AM    <DIR>          multi_dir_2
03/03/2026  07:46 AM    <DIR>          multi_dir_3
03/03/2026  07:46 AM    <DIR>          multi_dir_4
03/03/2026  07:46 AM    <DIR>          multi_dir_5

[TEST] DIR: CREATE FILES INSIDE DIRECTORY
------------------------------------------------------------
[CMD] echo File in dir > "Z:\dir_single\inside.txt"
[CMD] echo Another file > "Z:\dir_single\another.txt"
[CMD] dir "Z:\dir_single"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\dir_single

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM                14 inside.txt
03/03/2026  07:46 AM                15 another.txt
               2 File(s)             29 bytes
               2 Dir(s)  2,408,025,423,872 bytes free

[TEST] DIR: READ FILE INSIDE DIRECTORY
------------------------------------------------------------
[CMD] type "Z:\dir_single\inside.txt"
File in dir

[TEST] DIR: COPY DIRECTORY WITH CONTENTS
------------------------------------------------------------
[CMD] xcopy "Z:\dir_single" "Z:\dir_single_copy" /E /I /Q
2 File(s) copied
[CMD] dir "Z:\dir_single_copy"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\dir_single_copy

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM                14 inside.txt
03/03/2026  07:46 AM                15 another.txt
               2 File(s)             29 bytes
               2 Dir(s)  2,408,021,229,568 bytes free

[TEST] DIR: RENAME DIRECTORY
------------------------------------------------------------
[CMD] mkdir "Z:\multi_dir_renamed"
[CMD] xcopy "Z:\multi_dir_1" "Z:\multi_dir_renamed" /E /I /Q
0 File(s) copied
[CMD] rmdir /S /Q "Z:\multi_dir_1"
[CMD] dir "Z:\" | findstr multi_dir_renamed
03/03/2026  07:46 AM    <DIR>          multi_dir_renamed

[TEST] DIR: DELETE EMPTY DIRECTORY
------------------------------------------------------------
[CMD] mkdir "Z:\dir_to_delete_empty"
[CMD] rmdir "Z:\dir_to_delete_empty"
[CMD] dir "Z:\" | findstr dir_to_delete_empty

[TEST] DIR: DELETE DIRECTORY WITH CONTENTS
------------------------------------------------------------
[CMD] rmdir /S /Q "Z:\dir_single_copy"
[CMD] dir "Z:\" | findstr dir_single_copy

[TEST] DIR: DIRECTORY WITH SPACES IN NAME
------------------------------------------------------------
[CMD] mkdir "Z:\my folder with spaces"
[CMD] echo Content > "Z:\my folder with spaces\file.txt"
[CMD] dir "Z:\my folder with spaces"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\my folder with spaces

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM                10 file.txt
               1 File(s)             10 bytes
               2 Dir(s)  2,408,021,229,568 bytes free

[TEST] DIR: DIRECTORY WITH SPECIAL CHARACTERS
------------------------------------------------------------
[CMD] mkdir "Z:\dir_special-chars@123"
[CMD] echo Content > "Z:\dir_special-chars@123\file.txt"
[CMD] dir "Z:\dir_special-chars@123"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\dir_special-chars@123

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM                10 file.txt
               1 File(s)             10 bytes
               2 Dir(s)  2,408,021,229,568 bytes free

[TEST] DIR: DIRECTORY WITH PARENTHESES
------------------------------------------------------------
[CMD] mkdir "Z:\dir(test)"
[CMD] echo Content > "Z:\dir(test)\file.txt"
[CMD] dir "Z:\dir(test)"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\dir(test)

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM                10 file.txt
               1 File(s)             10 bytes
               2 Dir(s)  2,408,021,229,568 bytes free

[TEST] DIR: DIRECTORY WITH DOTS IN NAME
------------------------------------------------------------
[CMD] mkdir "Z:\dir.with.dots"
[CMD] echo Content > "Z:\dir.with.dots\file.txt"
[CMD] dir "Z:\" | findstr dir.with.dots
03/03/2026  07:46 AM    <DIR>          dir.with.dots

[TEST] DIR: NUMERIC DIRECTORY NAME
------------------------------------------------------------
[CMD] mkdir "Z:\123456"
[CMD] echo Content > "Z:\123456\file.txt"
[CMD] dir "Z:\" | findstr 123456
03/03/2026  07:44 AM                10 123456789.txt
03/03/2026  07:46 AM    <DIR>          123456

[TEST] DIR: LONG DIRECTORY NAME
------------------------------------------------------------
[CMD] mkdir "Z:\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
[CMD] echo Content > "Z:\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\file.txt"
[CMD] dir "Z:\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM                10 file.txt
               1 File(s)             10 bytes
               2 Dir(s)  2,408,021,229,568 bytes free

[TEST] DIR: DEEP DIRECTORY TREE
------------------------------------------------------------
[CMD] mkdir "Z:\deep"
[CMD] mkdir "Z:\deep\a"
[CMD] mkdir "Z:\deep\a\b"
[CMD] mkdir "Z:\deep\a\b\c"
[CMD] mkdir "Z:\deep\a\b\c\d"
[CMD] echo Deep content > "Z:\deep\a\b\c\d\deep.txt"
[CMD] type "Z:\deep\a\b\c\d\deep.txt"
Deep content

[TEST] DIR: DIRECTORY WITH UNICODE NAME
------------------------------------------------------------
[CMD] powershell New-Item -ItemType Directory "Z:\[U+65E5U+672CU+8A9EU+30D5U+30A9U+30EBU+30C0]"
[CMD] powershell WriteAllText "Z:\[U+65E5U+672CU+8A9EU+30D5U+30A9U+30EBU+30C0]\[U+30C6U+30B9U+30C8].txt" (UTF-8)
[CMD] powershell Get-Content "Z:\[U+65E5U+672CU+8A9EU+30D5U+30A9U+30EBU+30C0]\[U+30C6U+30B9U+30C8].txt" -Encoding UTF8
日本語ディレクトリテスト
[CMD] powershell dir "Z:\[U+65E5U+672CU+8A9EU+30D5U+30A9U+30EBU+30C0]"


    Directory: Z:\日本語フォルダ


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----          3/3/2026   7:46 AM             39 テスト.txt                                                                   



[TEST] DIR: COPY DIRECTORY WITH MULTIPLE FILE TYPES
------------------------------------------------------------
[CMD] mkdir "Z:\mixed_src"
[CMD] echo {"key":"value"} > "Z:\mixed_src\data.json"
[CMD] echo name,age > "Z:\mixed_src\data.csv"
[CMD] powershell WriteAllBytes "Z:\mixed_src\data.bin" 524288
[CMD] xcopy "Z:\mixed_src" "Z:\mixed_dst" /E /I /Q
3 File(s) copied
[CMD] dir "Z:\mixed_dst"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\mixed_dst

03/03/2026  07:47 AM    <DIR>          .
03/03/2026  07:47 AM    <DIR>          ..
03/03/2026  07:46 AM                18 data.json
03/03/2026  07:47 AM                11 data.csv
03/03/2026  07:47 AM           524,288 data.bin
               3 File(s)        524,317 bytes
               2 Dir(s)  2,408,004,452,352 bytes free

[TEST] DIR: MOVE DIRECTORY INTO ANOTHER DIRECTORY
------------------------------------------------------------
[CMD] mkdir "Z:\container"
[CMD] mkdir "Z:\container\multi_dir_2"
[CMD] xcopy "Z:\multi_dir_2" "Z:\container\multi_dir_2" /E /I /Q
0 File(s) copied
[CMD] rmdir /S /Q "Z:\multi_dir_2"
[CMD] dir "Z:\container"
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\container

03/03/2026  07:47 AM    <DIR>          .
03/03/2026  07:47 AM    <DIR>          ..
03/03/2026  07:46 AM    <DIR>          multi_dir_2
               0 File(s)              0 bytes
               3 Dir(s)  2,408,004,452,352 bytes free

[TEST] DIR: LIST DIRECTORY RECURSIVELY
------------------------------------------------------------
[CMD] dir "Z:\parent" /S /B
Z:\parent\child
Z:\parent\child\grandchild

[TEST] DIR: DIRECTORY SIZE CHECK
------------------------------------------------------------
[CMD] dir "Z:\deep" /S
 Volume in drive Z is LBLTST
 Volume Serial Number is 0000-0000

 Directory of Z:\deep

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:47 AM    <DIR>          ..
03/03/2026  07:46 AM    <DIR>          a
               0 File(s)              0 bytes

 Directory of Z:\deep\a

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM    <DIR>          b
               0 File(s)              0 bytes

 Directory of Z:\deep\a\b

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM    <DIR>          c
               0 File(s)              0 bytes

 Directory of Z:\deep\a\b\c

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM    <DIR>          d
               0 File(s)              0 bytes

 Directory of Z:\deep\a\b\c\d

03/03/2026  07:46 AM    <DIR>          .
03/03/2026  07:46 AM    <DIR>          ..
03/03/2026  07:46 AM                15 deep.txt
               1 File(s)             15 bytes

     Total Files Listed:
               1 File(s)             15 bytes
              14 Dir(s)  2,408,004,452,352 bytes free

============================================================
 DIRECTORY OPERATIONS COMPLETE
============================================================

============================================================
 PHASE 7 - CHECK TAPE
============================================================

[TEST] CHECK
------------------------------------------------------------
[CMD] .\LtfsCmdCheck.exe Z
Date : 2026/03/03
The medium was found to be consistent. No changes were made.
LTFS volume information:.
Tape Serial Number : : SRLTST.
UUID               : 22f0f332-a627-40ae-88ef-d4d96069570f.
Format Time        : 2026-03-03 07:38:41.687000000    .

============================================================
 PHASE 8 - ROLLBACK
============================================================

[TEST] ROLLBACK LIST
------------------------------------------------------------
[CMD] .\LtfsCmdRollback.exe Z /L
 Generations Date & Time
------------ --------------------
           1 2026-03-03 07:39:56
           2 2026-03-03 07:46:33
           3 2026-03-03 07:47:14

[TEST] ROLLBACK
------------------------------------------------------------
[CMD] .\LtfsCmdRollback.exe Z /G:2 /E

============================================================
 PHASE 9 - TAPE CLEANUP
============================================================

[TEST] UNFORMAT
------------------------------------------------------------
[CMD] .\LtfsCmdUnformat.exe Z
The medium has been unformatted.

[TEST] EJECT
------------------------------------------------------------
[CMD] .\LtfsCmdEject.exe Z

[TEST] UNASSIGN
------------------------------------------------------------
[CMD] .\LtfsCmdUnassign.exe Z

============================================================
 Script completed successfully.
============================================================
PS C:\Users\Administrator\Documents\batch>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants