Page 1 of 1

gethdinfo for usb ?

Posted: Fri Apr 29, 2016 10:09 pm
by tas3086
Is there a function or utility in tbos like GETHDINFO and GETDRVLTRINFO, that would allow the detection of information for USB connected drives?
Thanks in advance.

Re: gethdinfo for usb ?

Posted: Fri Apr 29, 2016 10:46 pm
by TeraByte Support
the .bus member ?


"tas3086" wrote in message news:11461@public.tbosdt...

Is there a function or utility in tbos like GETHDINFO and GETDRVLTRINFO,
that would allow the detection of information for USB connected drives?
Thanks in advance.


Re: gethdinfo for usb ?

Posted: Mon May 02, 2016 2:53 pm
by tas3086
TeraByte Support wrote:
> the .bus member ?
>
>
> "tas3086" wrote in message news:11461@public.tbosdt...
>
> Is there a function or utility in tbos like GETHDINFO and GETDRVLTRINFO,
> that would allow the detection of information for USB connected drives?
> Thanks in advance.

Having started TBOSDT on Windows 10 (64 bit), I can cd to J:, and runtbs a script that includes the gethdinfo function. All sata drives are listed, but not the CD/DVD and USB drives, including J:, a drive that has 4 partitions.

It should be noted that running (exec imagew) under tbosdt will see the J: drive as an available backup drive.

Any ideas?

Re: gethdinfo for usb ?

Posted: Tue May 03, 2016 6:40 am
by TeraByte Support
are you running it elevated?

cd/dvd drives are not HD so the command won't show them.

What are the drive numbers as shown in drive management (is there a large
gap) ?


"tas3086" wrote in message news:11465@public.tbosdt...

TeraByte Support wrote:
> the .bus member ?
>
>
> "tas3086" wrote in message news:11461@public.tbosdt...
>
> Is there a function or utility in tbos like GETHDINFO and GETDRVLTRINFO,
> that would allow the detection of information for USB connected drives?
> Thanks in advance.

Having started TBOSDT on Windows 10 (64 bit), I can cd to J:, and runtbs a
script that includes the gethdinfo function. All sata drives are listed, but
not the CD/DVD and USB drives, including J:, a drive that has 4
partitions.

It should be noted that running (exec imagew) under tbosdt will see the J:
drive as an available backup drive.

Any ideas?


Re: gethdinfo for usb ?

Posted: Tue May 03, 2016 4:45 pm
by tas3086
Windows diskpart shows the following drives:
DISKPART> list disk

Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 1863 GB 1060 GB
Disk 1 Online 2794 GB 0 B *
Disk 2 Online 931 GB 1024 KB
Disk 3 Online 223 GB 47 GB
Disk 4 No Media 0 B 0 B
Disk 5 No Media 0 B 0 B
Disk 6 Online 7650 MB 0 B
Disk 7 Online 7650 MB 0 B
Disk 8 Online 931 GB 0 B
Disk 9 Online 232 GB 0 B

Disks 0-3 are sata
4-5 cd/dvd
6-7 are USB
8-9 are sata on a second controller

It should be noted that tbexplo.tbs finds/sees the usb's.

Additional information.:
It seams that if the system is booted with all drives connected, then gethdinfo will work. If USB drives , or hot swap sata drives are connected after boot, then gethdinfo will not see the devices. Not 100% sure, but did see a change with one test.

Re: gethdinfo for usb ?

Posted: Wed May 04, 2016 4:54 am
by Eric
Why do you say that gethdinfo() don't see them?
How do you do the loop to browse all disk? Are you doing like below or with a "while"?
for hd=0 to 64
h=gethdinfo(hd)
if h then
...
end if
next

Re: gethdinfo for usb ?

Posted: Wed May 04, 2016 3:51 pm
by tas3086
n=0
h=gethdinfo(n,1)
while h
printl("")
printl("--------------DISK: ", h.num," -----------------------------------")
printl("Disk HDNum :", h.num)
printl("BIOSHDNUM :", h.BIOSHDNUM)
printl("NT Disk Sig :", hex(h.sig))
printl("GPT GUID :", hex(h.GUID))
printl("NAME :", h.NAME)
printl("Secsize :", h.secsize)
printl("Sectors :", h.size)
printl("Embr :", hex(h.embr))
printl("OutOfSync :", hex(h.OutOfSync))
printl("GPT :", h.gpt)
printl("GPT guid :", h.guid)
printl("Bus :", h.bus)
printl("c :", h.c)
printl("h :", h.h)
printl("s :", h.s)

pn=1
while h.partition[pn]
printl("--------------DISK: ", h.num," --- PARTITION: ", h.partition[pn].name)

.....


Changed while h to while h<=15 and things are working fine now. Thanks for the hint.

Re: gethdinfo for usb ?

Posted: Thu May 05, 2016 7:01 am
by Eric
You mean to "while n<=15", not h?

Re: gethdinfo for usb ?

Posted: Sat May 07, 2016 3:47 am
by tas3086
Eric wrote:
> You mean to "while n<=15", not h?

Absolutely correct. I used the example that was in the manual, unfortunately that example stops when a CD/DVD device is detected. You need to continue checking if you want to get all devices. Too bad that there isn't some other easy way to determine when you get to the end of the device chain. A value of 64 took perceptibly longer to complete, but is probably more accurate that my value of 15 !!

Thank you again for suggesting the solution.