Page 2 of 2

Re: Partitions ID Not In Order

Posted: Mon Aug 30, 2021 6:19 am
by Brian K
So, for the (Current ID), you append 0x before the ID.
And for (Desired ID), you drop the 0.
Not really. Any number preceded by 0x is a hexadecimal number. The number 16 is 0x10 in hexadecimal.
Subtracting 1 from 16 is 15. So partition ID of 0x10 would be in GPT slot 15 in Reorder GPT. Clear as mud?

Its easy from 0x01 to 0x09 as decimal numbers are the same. But hex of ten is 0x0A.

I'm not sure if "set part num" can use decimal partition IDs over ten instead of hex IDs. It probably can but it's confusing to the amateur. For over ten I'd use Reorder GPT.

Re: Partitions ID Not In Order

Posted: Mon Aug 30, 2021 11:32 am
by Eric
Hadron wrote: Sat Aug 28, 2021 1:51 am Exactly how would I have used set part num to reorder my partitions?
Can someone please give an example to help me understand how to use it?
You can build a script that will reorder everything automatically:

sub main()
// Physical HD number or link to the virutal drive file
hdnum=0
// read info of drive
h=GetHdInfo(hdnum)
// For EMBR drive we change the id, for MBR and GPT we change the entry number
if h.embr=0 then
type="num"
else
type="id"
end if
pn=1
while h.partition[pn]
if h.partition[pn].id > pn then
// we do the change of entry number or id only if needed
ext("set part " # type # " ^"" # h.num # "^" " # h.partition[pn].id # " " # (pn-(type="num")))
// read again the drive since changing one ID may have impact on other IDs
h=GetHdInfo(hdnum)
end if
pn=pn+1
wend
end sub

Re: Partitions ID Not In Order

Posted: Mon Aug 30, 2021 9:09 pm
by Hadron
Thanks, Eric.

Do I just run that from TeraByte OS Deployment Tool?

Re: Partitions ID Not In Order

Posted: Mon Aug 30, 2021 9:16 pm
by Eric
You would have to create a script file with that inside (with .tbs as extension - for ex. "reorder.tbs"). Then run it from tbosdtw.exe with the command "runtbs reorder.tbs".
Take care that line "hdnum=0" is correct, and that the HD you want to reorder is the "0" one. Otherwise change it to point to the correct number.

Re: Partitions ID Not In Order

Posted: Mon Aug 30, 2021 10:05 pm
by Brian K
Hadron,

Another manual method is to edit a Boot Item if you have BIU installed. You can lock each partition to a GPT Entry Number. So if a Partition ID gets inadvertently changed, it will be corrected to your desired Partition ID when you next run that Boot Item.

Re: Partitions ID Not In Order

Posted: Mon Aug 30, 2021 10:24 pm
by Hadron
Eric wrote: Mon Aug 30, 2021 9:16 pm You would have to create a script file with that inside (with .tbs as extension - for ex. "reorder.tbs"). Then run it from tbosdtw.exe with the command "runtbs reorder.tbs".
Take care that line "hdnum=0" is correct, and that the HD you want to reorder is the "0" one. Otherwise change it to point to the correct number.
Eric, I can see that .tbs files are associated with tbosdtw64.exe.
Would that mean that a .tbs file could be double clicked to run as well as the runtbs command?

Re: Partitions ID Not In Order

Posted: Mon Aug 30, 2021 10:25 pm
by Hadron
Brian K wrote: Mon Aug 30, 2021 10:05 pm Hadron,

Another manual method is to edit a Boot Item if you have BIU installed. You can lock each partition to a GPT Entry Number. So if a Partition ID gets inadvertently changed, it will be corrected to your desired Partition ID when you next run that Boot Item.
Brian, I will have to have another look at BIU and check out Edit a Boot Item.
But I do agree that Reorder GPT was very simple. I am just trying to learn more. 😀

Re: Partitions ID Not In Order

Posted: Tue Aug 31, 2021 6:39 am
by Eric
Hadron wrote: Mon Aug 30, 2021 10:24 pm Eric, I can see that .tbs files are associated with tbosdtw64.exe.
Would that mean that a .tbs file could be double clicked to run as well as the runtbs command?
Yes.
You can also modify the script to first ask for the HD. Or better: to list all HD that are not well ordered, and ask for the HD, then for the user to confirm.

Re: Partitions ID Not In Order

Posted: Tue Aug 31, 2021 4:18 pm
by nemesis
Brian K wrote: Mon Aug 30, 2021 6:19 am I'm not sure if "set part num" can use decimal partition IDs over ten instead of hex IDs. It probably can but it's confusing to the amateur. For over ten I'd use Reorder GPT.
It can