Tape Storage

 View Only
Expand all | Collapse all

unable to change active partition in lto8

  • 1.  unable to change active partition in lto8

    Posted 16 days ago

    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 14 days ago

    @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 12 days ago

    @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 11 days ago

    @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 11 days ago

    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 10 days ago

    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 10 days ago

    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 10 days ago

    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 9 days ago

    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 9 days ago

    @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 9 days ago

    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 8 days ago

    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 8 days ago
    Edited by sher cheeta 8 days ago

    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 4 days ago
    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 5 days ago

    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 4 days ago

    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 4 days ago

    @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 4 days ago
    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 3 days ago

    @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 3 days ago
    Edited by sher cheeta 2 days ago

    @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
    ------------------------------