[pbs-devel] [PATCH proxmox-backup] tape: increase timeout for moving medium in changer

Dominik Csapak d.csapak at proxmox.com
Fri Jul 25 13:36:56 CEST 2025


from the current 5 minutes to 30 minutes. According to documentation
from vendors (e.g. HP see [0]) moving a medium between slots or to/from
a drive can take up a much longer time than 5 minutes. (up to 38 minutes
in a HP library) so increase the timeout we use here to something that
exceeds these recommendations.

0: https://support.hpe.com/hpesc/public/docDisplay?docId=sd00001714en_us&page=GUID-D7147C7F-2016-0901-065E-00000000072C.html

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 pbs-tape/src/sg_pt_changer.rs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pbs-tape/src/sg_pt_changer.rs b/pbs-tape/src/sg_pt_changer.rs
index 7122fcdb4..dd297a822 100644
--- a/pbs-tape/src/sg_pt_changer.rs
+++ b/pbs-tape/src/sg_pt_changer.rs
@@ -18,6 +18,7 @@ use crate::{
 };
 
 const SCSI_CHANGER_DEFAULT_TIMEOUT: usize = 60 * 5; // 5 minutes
+const SCSI_CHANGER_MOVE_MEDIUM_TIMEOUT: usize = 60 * 45; // 45 minutes
 const SCSI_VOLUME_TAG_LEN: usize = 36;
 
 /// Initialize element status (Inventory)
@@ -181,7 +182,7 @@ pub fn load_slot(file: &mut File, from_slot: u64, drivenum: u64) -> Result<(), E
     );
 
     let mut sg_raw = SgRaw::new(file, 64)?;
-    sg_raw.set_timeout(SCSI_CHANGER_DEFAULT_TIMEOUT);
+    sg_raw.set_timeout(SCSI_CHANGER_MOVE_MEDIUM_TIMEOUT);
 
     sg_raw
         .do_command(&cmd)
@@ -205,7 +206,7 @@ pub fn unload(file: &mut File, to_slot: u64, drivenum: u64) -> Result<(), Error>
     );
 
     let mut sg_raw = SgRaw::new(file, 64)?;
-    sg_raw.set_timeout(SCSI_CHANGER_DEFAULT_TIMEOUT);
+    sg_raw.set_timeout(SCSI_CHANGER_MOVE_MEDIUM_TIMEOUT);
 
     sg_raw
         .do_command(&cmd)
@@ -233,7 +234,7 @@ pub fn transfer_medium<F: AsRawFd>(
     );
 
     let mut sg_raw = SgRaw::new(file, 64)?;
-    sg_raw.set_timeout(SCSI_CHANGER_DEFAULT_TIMEOUT);
+    sg_raw.set_timeout(SCSI_CHANGER_MOVE_MEDIUM_TIMEOUT);
 
     sg_raw.do_command(&cmd).map_err(|err| {
         format_err!(
-- 
2.39.5





More information about the pbs-devel mailing list