Tape Library

Tape Library

Cyber resilient, energy-efficient tape storage with airgap and long-term retention

 View Only
Expand all | Collapse all

unable to change active partition in lto8

  • 1.  unable to change active partition in lto8

    Posted Thu July 11, 2024 06:19 AM

    I am using ts2280 IBM Ultrium LTO 8 and i have created two partition i.e.  Partition 0 and Partition 1 both are 3T.B each with wrap wise partitioning  and i am using this code in order to switch between those partitions

    i am using SetTapePosition function to change the active partition of a LTO tape drive but unable to do so it compiled without any error but didn't change the partition as well, On the other hand i and able to set the dwOffsetLow and it is working completely fine but the partition is not changing.

    DWORD bytesReturned;

    DWORD partition = 2;

    TAPE_SET_POSITION tapePosition{};

    tapePosition.Method = TAPE_LOGICAL_POSITION;

    tapePosition.Partition = partition;

    tapePosition.Offset.LowPart = 0;

    tapePosition.Offset.HighPart = 0;

    tapePosition.Immediate = FALSE;

    if (!DeviceIoControl(hTape, IOCTL_TAPE_SET_POSITION, &tapePosition, sizeof(tapePosition), NULL, 0, &bytesReturned, NULL)) {

    return GetLastError();

    }

    only able to set the offsetlowPart but unable to change the partition.

    kindly let me know how to resolve this issue.

    and i have already included the header files



    ------------------------------
    sher cheeta
    ------------------------------


  • 2.  RE: unable to change active partition in lto8

    Posted Fri July 12, 2024 12:51 PM

    @sher cheeta To change partition use SET_ACTIVE_PARTITION (see https://www.ibm.com/docs/en/ts4300-tape-library?topic=overview-set-active-partition



    ------------------------------
    Kevin Butt
    IBM, Tape Development Ecosystem
    Tape SCSI Architect, T10 Representative
    ------------------------------



  • 3.  RE: unable to change active partition in lto8

    Posted Sun July 14, 2024 10:21 PM

    @Kevin Butt but i am using windows OS and from where should i get sys/Atape.h header file ?



    ------------------------------
    sher cheeta
    ------------------------------



  • 4.  RE: unable to change active partition in lto8

    Posted Mon July 15, 2024 12:17 PM

    @sher cheeta if you are using Windows IBM Tape driver: https://www.ibm.com/docs/en/ts4300-tape-library?topic=deviceiocontrol-ioctl-set-active-partition



    ------------------------------
    MAYRA PADILLA DUARTE
    ------------------------------



  • 5.  RE: unable to change active partition in lto8

    Posted Tue July 16, 2024 01:28 AM

    Hello 

    Let me explain you the whole scenario i am not able to change the active partition on windows and as you suggested, that Windows IBM Tape driver: https://www.ibm.com/docs/en/ts4300-tape-library?topic=deviceiocontrol-ioctl-set-active-partition 

    first of all this is also not working and secondly if i am not able to change the partition then How ITDT(IBM Tape Diagnostic tool) is able to change the partition on same on and same drivers because i have not installed any other thing.



    ------------------------------
    sher cheeta
    ------------------------------



  • 6.  RE: unable to change active partition in lto8

    Posted Tue July 16, 2024 02:12 PM

    At this point, all I can suggest is to read through https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-settapeposition and make sure everything is done correctly. The return code should help narrow down why it is failing.



    ------------------------------
    Kevin Butt
    IBM, Tape Development Ecosystem
    Tape SCSI Architect, T10 Representative
    ------------------------------



  • 7.  RE: unable to change active partition in lto8

    Posted Tue July 16, 2024 02:20 PM

    ITDT can work with Microsoft native driver or IBMTape driver.

    The ioctl-set-active-partition and ioctl-query-active-partition only works with IBMTape driver



    ------------------------------
    MAYRA PADILLA DUARTE
    ------------------------------



  • 8.  RE: unable to change active partition in lto8

    Posted Tue July 16, 2024 10:23 PM

    Again the thing is that then how ITDT is able to change the partition, if i am not able to change the partition, on the same machine , with same Tape connected with same configuration everything is same .

    Then why that function is not working while i am manually doing it but ITDT can do the same without any issue??

    How exactly ITDT's change partition works then?



    ------------------------------
    sher cheeta
    ------------------------------



  • 9.  RE: unable to change active partition in lto8

    Posted Wed July 17, 2024 10:20 PM

    I have just found out if i am trying to check the number of  partition it is also showing 0 but the tape is definitely partitioned, then why it is showing 0

    Here is the code snippet which i have used to check the partitions

    This code as well executed without throwing any compile or run time error and showed 0

    DWORD getTapePartitions(HANDLE hTape) {
        TAPE_GET_MEDIA_PARAMETERS mediaParams = { 0 };
        DWORD bytesReturned;
    
        if (!DeviceIoControl(hTape, IOCTL_TAPE_GET_MEDIA_PARAMS, NULL, 0, &mediaParams, sizeof(mediaParams), &bytesReturned, NULL)) {
            DWORD error = GetLastError();
            printErrorMessage(error);
            throw std::runtime_error("Error getting tape media parameters.");
        }
        else {
            std::cout << "Partition Count: " << mediaParams.PartitionCount << std::endl;
            return mediaParams.PartitionCount;
        }
    }


    ------------------------------
    sher cheeta
    ------------------------------



  • 10.  RE: unable to change active partition in lto8

    Posted Thu July 18, 2024 12:57 AM

    @sher cheeta I will defer to Mayra about device driver comments. I speak at the SCSI layer. However, I can tell you that the Volume Statistics Log Page, log page 17h, has some counters that can help you confirm the sizes of the partitions on tape. These counters are in log parameter 0202h, Approximate native capacity of partition(s). If you know how to query those, then you can double check the partitioning. There are a lot of interesting statistics in there. See the LTO SCSI Reference at https://www.ibm.com/support/pages/node/6490249



    ------------------------------
    Kevin Butt
    IBM, Tape Development Ecosystem
    Tape SCSI Architect, T10 Representative
    ------------------------------



  • 11.  RE: unable to change active partition in lto8

    Posted Thu July 18, 2024 02:11 AM

    but how this Volume statistics log page , will help me to change the partition of tape?



    ------------------------------
    sher cheeta
    ------------------------------



  • 12.  RE: unable to change active partition in lto8

    Posted Thu July 18, 2024 01:42 PM

    It will not help change the partition. It will just confirm that the mounted tape is partitioned.



    ------------------------------
    Kevin Butt
    IBM, Tape Development Ecosystem
    Tape SCSI Architect, T10 Representative
    ------------------------------



  • 13.  RE: unable to change active partition in lto8

    Posted Thu July 18, 2024 10:25 PM
    Edited by sher cheeta Fri July 19, 2024 01:43 AM

    Okay here is the thing How exactly ITDT's change partition work ??

    how it changes the partition???



    ------------------------------
    sher cheeta
    ------------------------------



  • 14.  RE: unable to change active partition in lto8

    Posted Mon July 22, 2024 09:42 AM
    Good day, Folks:

    I really appreciate your initiative in attempting to solve this tricky problem of a historical database.  

    In truth there is no earth-shattering revelation at the end of your exploration.  The data is from a study of harbour seal (P. vitulina)  behaviour and ecology conducted on the island archipelago of St. Pierre et Miquelon, RF,(a French territory outre de la Mer) South of Newfoundland, Canada).  It was conducted several years ago but is current and meaningful  (on an ecological level).

    Is there any information I can share that would make your exploration a little simpler or easier?

    Kind regards.

    Clar 709 725-2888 (cell/text)






  • 15.  RE: unable to change active partition in lto8

    Posted Sun July 21, 2024 11:04 PM

    and as you say it is about driver can you help me to find out which is the suitable driver for the device TS-2280 ULT3580-HH8



    ------------------------------
    sher cheeta
    ------------------------------



  • 16.  RE: unable to change active partition in lto8

    Posted Mon July 22, 2024 07:34 PM

    Sher,

    For the IBM Device Driver you can go to Fix Central -> https://www.ibm.com/support/fixcentral/

    Select the product tab (not the default search tab)

    In the "Product Group" select "System Storage"

    In the "System Storage" select "Tape Systems"

    In the "Tape Systems" select "Tape drivers and Software"

    In the "Tape drives and Software" select "Tape device driver"

    In "Platform" select your specific platform. There are a few selections for various Windows systems.

    Click "Continue".

    You will be taken to a screen that contains the current Tape Device Driver and an archive of previous drivers, as well as some links to documentation.



    ------------------------------
    Kevin Butt
    IBM, Tape Development Ecosystem
    Tape SCSI Architect, T10 Representative
    ------------------------------



  • 17.  RE: unable to change active partition in lto8

    Posted Mon July 22, 2024 11:21 PM

    @Kevin Butt

    it is not doing anything still stuck at the same scenario ,

    can you provide me a full code snippet to change the active partition?



    ------------------------------
    sher cheeta
    ------------------------------



  • 18.  RE: unable to change active partition in lto8

    Posted Tue July 23, 2024 06:16 AM
    after updating firmware and latest driver
    @Kevin Butt as you have suggested i have installed the latest driver from fix central, after that when i have checked my device manager it shows me that some further installation is required. And still have not changed the partition.


    ------------------------------
    sher cheeta
    ------------------------------



  • 19.  RE: unable to change active partition in lto8

    Posted Tue July 23, 2024 11:15 AM

    @sher cheeta Here some links:

    IBMTape Windows driver installation (only Windows Server is supported):

    https://www.ibm.com/docs/en/ts4300-tape-library?topic=wtmcdd-installation-configuration-instructions

    Windows IBMTape programming reference for partitioning ioctls:

    https://www.ibm.com/docs/en/ts4300-tape-library?topic=deviceiocontrol-ioctl-set-active-partition

    https://www.ibm.com/docs/en/ts4300-tape-library?topic=deviceiocontrol-ioctl-query-partition

    If you are not using IBM Tape driver (or supported Windows Server versions) another option I can think of is build your own passthrough ioctls:

    https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddscsi/ni-ntddscsi-ioctl_scsi_pass_through

    https://www.ibm.com/support/pages/node/6490249



    ------------------------------
    MAYRA PADILLA DUARTE
    ------------------------------



  • 20.  RE: unable to change active partition in lto8

    Posted Wed July 24, 2024 02:41 AM
    Edited by sher cheeta Thu July 25, 2024 01:01 AM

    @MAYRA PADILLA DUARTE

    okay let me ask you this again as you suggested that 

    IBMTape Windows driver installation (only Windows Server is supported): then if i want to change the partition on windows machine how can i do that, because again ITDT is doing the same thing then why windows api setActivePartition is not changing its partition but can traverse in the current partition because i can set offset low and high accordingly but when i set partition it simply execute it without giving any error.

    if anyone can give me a complete example that would be appreciated. 



    ------------------------------
    sher cheeta
    ------------------------------



  • 21.  RE: unable to change active partition in lto8

    Posted Mon July 29, 2024 06:33 PM

    ITDT commands can utilize one of the following options:
    (1) use IBMtape device driver, which sends ioctls commands as described in IBM Tape Device Driver Programming Reference (https://www.ibm.com/docs/en/ts4300-tape-library?topic=interface-vendor-specific-device-ioctls-deviceiocontrol)
    (2) use MS (embedded Windows) device driver, which utilizes MS defined commands.

    For Option (1) use IBM Tape Driver and specific for Partition Commands, the Programming Reference sections listed below provide examples for:
    Obtain Partition Information (including the number of partitions) > https://www.ibm.com/docs/en/ts4300-tape-library?topic=deviceiocontrol-ioctl-query-partition
    Set Active Partition > https://www.ibm.com/docs/en/ts4300-tape-library?topic=deviceiocontrol-ioctl-set-active-partition

    If you wish, you can alternatively use Option (2) and ITDT scripting, see https://www.ibm.com/docs/en/ts4300-tape-library?topic=edition-standard-tapeutil-scripting-commands

    If you still need help, please submit a support ticket with (a) drive dump, (b) driver trace, and (c) ITDT log.



    ------------------------------
    Carla Ruhl
    ------------------------------



  • 22.  RE: unable to change active partition in lto8

    Posted Mon July 29, 2024 06:34 PM

    ITDT has two options:
    (1) use IBMtape device driver ioctls, as defined in IBM Programming Reference:  https://www.ibm.com/docs/en/ts4300-tape-library?topic=interface-vendor-specific-device-ioctls-deviceiocontrol
    (2) use native (MS embedded) device driver calls (see https://www.ibm.com/docs/en/ts4300-tape-library?topic=edition-generic-operating-system-driver-itdt-se)

    If ITDT program is run with option for (1) use IBMtape driver, the same ioctls are utilized as defined in IBM Programming Reference:  https://www.ibm.com/docs/en/ts4300-tape-library?topic=interface-vendor-specific-device-ioctls-deviceiocontrol

    If option (2), this will utilize MS defined tape controls.  These are NOT documented by IBM, as this interface is owned by Microsoft.

    If you still desire to utilize ioctls, please review the following sections that contain sample code:
    Obtain Partition Information > https://www.ibm.com/docs/en/ts4300-tape-library?topic=deviceiocontrol-ioctl-query-partition
    Set Active Partition > https://www.ibm.com/docs/en/ts4300-tape-library?topic=deviceiocontrol-ioctl-set-active-partition

    If you have the option to utilize ITDT scripting function, see https://www.ibm.com/docs/en/ts4300-tape-library?topic=edition-standard-tapeutil-scripting-commands.

    If the above does not help, please contact support with a drive dump and device driver trace.



    ------------------------------
    Carla Ruhl
    ------------------------------



  • 23.  RE: unable to change active partition in lto8

    Posted Mon July 29, 2024 09:12 PM

    Thank you for your information and guidance.  Both are VERY welcome.  Now I have to look for the availability of a 'antique' 3/4" width tape drive reader so I can access the data I stored....waaay back!  The data was collected on the biology and behaviour of seals in Newfoundland Caanda.