Partitions ID Not In Order

User discussion and information resource forum for the TeraByte OS Deployment Tool Suite.
Brian K
Posts: 2213
Joined: Fri Aug 12, 2011 1:11 am
Location: NSW, Australia

Re: Partitions ID Not In Order

Post 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.
Eric
Posts: 224
Joined: Mon Sep 05, 2011 6:53 pm
Location: France

Re: Partitions ID Not In Order

Post 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
Hadron
Posts: 37
Joined: Tue Oct 22, 2019 1:29 am

Re: Partitions ID Not In Order

Post by Hadron »

Thanks, Eric.

Do I just run that from TeraByte OS Deployment Tool?
Eric
Posts: 224
Joined: Mon Sep 05, 2011 6:53 pm
Location: France

Re: Partitions ID Not In Order

Post 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.
Brian K
Posts: 2213
Joined: Fri Aug 12, 2011 1:11 am
Location: NSW, Australia

Re: Partitions ID Not In Order

Post 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.
Hadron
Posts: 37
Joined: Tue Oct 22, 2019 1:29 am

Re: Partitions ID Not In Order

Post 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?
Hadron
Posts: 37
Joined: Tue Oct 22, 2019 1:29 am

Re: Partitions ID Not In Order

Post 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. 😀
Eric
Posts: 224
Joined: Mon Sep 05, 2011 6:53 pm
Location: France

Re: Partitions ID Not In Order

Post 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.
nemesis
Posts: 76
Joined: Mon Jun 21, 2021 12:25 pm

Re: Partitions ID Not In Order

Post 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
Post Reply