fix: Correctly handle sg devices for iSCSI LUNs

This commit is contained in:
2025-12-10 12:05:52 +00:00
parent 5746891b3c
commit 7bf9c2596a
4 changed files with 19 additions and 5 deletions

Binary file not shown.

View File

@@ -1,4 +1,4 @@
Adastra VTL Installer
Version: 1.0.0
Build Date: 2025-12-09 18:33:03
Build Date: 2025-12-10 12:05:52
Build Host: vtl-dev

View File

@@ -325,11 +325,18 @@ function addLun($params) {
return;
}
// Determine backing store type
$bstypeParam = '';
if (strpos($device, '/dev/sg') === 0) {
$bstypeParam = '--bstype sg'; // Use sg (passthrough) for generic scsi devices
}
$command = sprintf(
'sudo tgtadm --lld iscsi --mode logicalunit --op new --tid %d --lun %d --backing-store %s 2>&1',
'sudo /usr/sbin/tgtadm --lld iscsi --mode logicalunit --op new --tid %d --lun %d --backing-store %s %s 2>&1',
$tid,
$lun,
escapeshellarg($device)
escapeshellarg($device),
$bstypeParam
);
$output = [];

View File

@@ -325,11 +325,18 @@ function addLun($params) {
return;
}
// Determine backing store type
$bstypeParam = '';
if (strpos($device, '/dev/sg') === 0) {
$bstypeParam = '--bstype sg'; // Use sg (passthrough) for generic scsi devices
}
$command = sprintf(
'sudo tgtadm --lld iscsi --mode logicalunit --op new --tid %d --lun %d --backing-store %s 2>&1',
'sudo /usr/sbin/tgtadm --lld iscsi --mode logicalunit --op new --tid %d --lun %d --backing-store %s %s 2>&1',
$tid,
$lun,
escapeshellarg($device)
escapeshellarg($device),
$bstypeParam
);
$output = [];