Pretty much as the title says, I am wondering what is the most effective way to determine Linux's disk/partition tags from grub4dos counterparts, like for example:
- (hd0,0) = sda1
- (hd0,1) = sda2
- (hd1,0) = sdb1
- (hd1,1) = sdb2
The partition number is easy because it's simply the same partition number +1.
But the disk number/letter isn't so and seems to only be determinable using nested "if"s.
At the moment I'm using something like this:
# Determine Linux disk/partition id - set LXDSKTYP to use hd instead of sd if using IDE disk set LXDSKTYP=sd find --set-root /target/file.ext if exist /target/file.ext set DSKN=%@root:~3,1% && set PRTN=%@root:~5,1% if %DSKN%==0 set LXDSK=a || if %DSKN%==1 set LXDSK=b || if %DSKN%==2 set LXDSK=c || if %DSKN%==3 set LXDSK=d if exist PRTN set /a LXPRTN=%PRTN%+1 if exist LXDSK set LXDSKID=%LXDSKTYP%%LXDSK%%LXPRTN%
Due to my limited knowledge of Grub4dos and it's extensive range of possibilities, I wonder if a better approach is possible, particularly for determining the disk letter.
Thanks for your input
Edited by ner0, 15 November 2016 - 11:39 AM.