Jump to content











Photo
- - - - -

Booting WimPE(s) & Linux Live(s) on the PC from the Micro SD on my smartphone


  • Please log in to reply
55 replies to this topic

#1 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 13 October 2019 - 06:30 AM

I know there is an App for smartphones Drive Droid to let us do this, but it requires rooting the phone.

 

There is an old thread here on the forum about this App: http://reboot.pro/to... sd on phone

 

My cellphone is not a new device, in fact ts is old but it has been with me for a long time and as it is still working very fine I don't see a reazon to replace it yet and I have readen same models of this brand (Lanix) has some problems when rooted.

Then the only option was try to do it myself:

The cellphone when connected by USB cable to the PC has several options, one of them is Connect as Mass Storage Device, first idea was to install grub4dos on the MBR of the Micro-SD could work.

 

Then installed grub4dos MBR on the (FAT-32) Micro-SD and grld and menu.lst on the root of the SD + several .iso files into Iso folder, just as always do on my USB devices. But to my surprise when booted from it I got a message from grub4dos saying it can't find menu.lst, I tried to check if something was wrong but all was just as my USBs with grub4dos, so for an unknown reason this did not work.

Next I deleted the Iso folder, grld and menu.lst and installed AIO Boot but without formating the Micro-SD to don't losse my info, and installed the preselected option grub2 on MBR and with AIO Boot installed several WimPE .wim an Linux Lite x64 (Live), this time the PC booted fine from the Micro-SD on the cellphone and all runs fine.

 

EDIT: It seems there was a problem with C/H/S geometry of the Micro-SD card. Thanks to steve6375 the issue on grub4dos to find the menu.lst is solved now, once booting from grub4dos just by typing on command line the following:

 

Quote from Post No. 17

geometry --sync (hd0) >>> A message appeared saying:

Writing MBR for drive 0X80 ...sucess.
Partition num: 0, active, file system Fat 32, partition type 0X0C ...

Then I pressed ESC key and the menu.lst was visible finally.

Rebooted the PC twice and menu.lst appeared inmediatly as it usually does.
 

 

Now booting from grub4dos is possible too.

 

alacran


Edited by alacran, 16 October 2019 - 09:00 AM.


#2 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 13 October 2019 - 07:17 AM

Since I do not know how you prepared the drive 'just as I always do' - it is difficult to guess as to why grub4dos did not load the menu. Did you make the drive with two partitions? When in grub4dos, did you try any commands such as:

find

ls /

map --status

geometry



#3 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 13 October 2019 - 07:39 AM

Hi steve

 

It was a single Fat-32 active partition and grub4dos-0.4.6a-2019-08-01 was installed with BootIce to MBR + grld & menu.lst on the root of the partition, same procedure I always follow, in fact I copied both and the Iso folder directly from my USB (wich is booting fine).

 

BootIce has internally a very old grub4dos 0.4.6a version, but just by putting on same folder where BootIce is, the new version, the newer is selected for install automatically.

 

And no I didn't try the command line, it is always hard with a non English keyboard, I do have somewere the Spanish keyboard from your E2B but usually I forget to make use of it.

 

alacran



#4 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 13 October 2019 - 08:04 AM

I remembered something else, first time I booted from it, grub4dos found the menu.lst on my PC (I use blue background on PC and green on USB, Isos folder on PC and Iso folder on USB) and rebooted and renamed the one on PC to menu-.lst to avoid this and rebooted, this time I got the message abut can't find menu.lst, then is when I checked it was there and also deleted it and copied it again from the USB just in case it was on a damaged/non readable sector, and rebooted, but with same result. Even deleted all and did all again next day with no change.

 

I like better to use grub4dos, but anyway using AIO Boot + grub2 on MBR (installed from it) all is working fine.



#5 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 October 2019 - 12:07 PM

Come on, it is years that I use grub4dos on command line with the built-in EN-US keyboard with my Italian keyboard, the number of mis-mapped keys actually used on command line is relative (a handful) and - set apart enter which is the same and that is "critical" - at the most you mistype and you can delete via backspace (which is also the same), it takes very little time to memorize the different key-presses.

Your issue is probably connected with the embedded menu.lst in grub4dos, which in recent grub4dos 0.46a is:

pxe detect
configfile
default 0
timeout 1

title find /menu.lst, /boot/grub/menu.lst, /grub/menu.lst
errorcheck off
configfile /boot/grub/menu.lst
configfile /grub/menu.lst
if "%@root%"=="(ud)" && calc *0x82A0=*0x82b9&0xff
if "%@root:~1,1%"=="f" && find --set-root --devices=f /menu.lst && configfile /menu.lst
find --set-root --ignore-floppies --ignore-cd /menu.lst && configfile /menu.lst
find --set-root --ignore-floppies --ignore-cd /boot/grub/menu.lst && configfile /boot/grub/menu.lst
find --set-root --ignore-floppies --ignore-cd /grub/menu.lst && configfile /grub/menu.lst
configfile http://b.chenall.net/menu.lst
errorcheck on
commandline

title commandline
commandline

title reboot
reboot

title halt
halt

if the SD card (or anyway the device where the menu.lst) is *somehoiw* skipped/ignored, the grub4dos will find the menu.lst on your internal hard disk (and this will happen also if - again for *any* reason - the internal hard disk is mapped to an "earlier" disk).

So, on command line you have to:
1) make sure that the current root is set to the actual device (by issuing the command "root" and - say - the command "geometry")
2) make sure that the menu.lst is in the current root (by issuing the command "ls")
3) load it by "configfile /menu.lst"

Only if this latter command gives an error there is an issue of some kind with the filesystem or with the file.
Depending on the results of the first two commands you may want to change the embedded menu.lst in such a way that it actually finds the device.

:duff:
Wonko

#6 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 13 October 2019 - 09:06 PM

just for testing pourposes I reinstalled grub4dos MBR to the Micro-SD card and added only grldr + menu.lst to the root, (also renamed my meny.lst on the PC to not load it) tried steve6375 commands from post No. 2 and also yours, only 2 commands are working:

 

map --status:

 

Floppies_orig=1, HDD_orig=2, floppies_curr=0, HDD_curr=2

 

The INT13 hook is OFF, the drive map table is currently empty

 

geometry:

 

0x80 (LBA): C/H/S=1947/4/16 Sector count /size=31268864/512

 

The geometry do not match with Micro-SD geometry checked by BootIce from Win7: 1946/255/63 total sectors: 31268864

 

If I type root (hd0,0) that drive do not exist.

 

If I type root (hd1,0) root is set to the boot partition of internal HDD.

 

alacran

Attached Thumbnails

  • MicroSD.png


#7 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 14 October 2019 - 03:37 AM

just for testing pourposes I reinstalled grub4dos MBR to the Micro-SD card and added only grldr + menu.lst to the root, (also renamed my meny.lst on the PC to not load it) tried steve6375 commands from post No. 2 and also yours, only 2 commands are working:

 

map --status:

 

Floppies_orig=1, HDD_orig=2, floppies_curr=0, HDD_curr=2

 

The INT13 hook is OFF, the drive map table is currently empty

 

geometry:

 

0x80 (LBA): C/H/S=1947/4/16 Sector count /size=31268864/512

 

The geometry do not match with Micro-SD geometry checked by BootIce from Win7: 1946/255/63 total sectors: 31268864

 

If I type root (hd0,0) that drive do not exist.

 

If I type root (hd1,0) root is set to the boot partition of internal HDD.

 

alacran

 

It doesn't matter as for the wrong CHS values, if LBA is already supported.
 



#8 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 14 October 2019 - 03:48 AM

It doesn't matter as for the wrong CHS values, if LBA is already supported.
 

 

Hi tinybit

 

Then wath do you think could be the cause of the problem?.

 

it seems to me for some extrange reazon grub4dos can't read fine the Micro-SD, (also to support this theory it gets wrong C/H/S from it), It is the only conclusion I got if menu.lst can't be found on that device.

 

alacran



#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 October 2019 - 09:03 AM

Alacran, the point is that geometry is often "a suffusion of yellow".

 

Windows NT (recent versions) will almost always use a 255/63 one.

 

Grub4dos will use whatever the BIOS sees.

 

1947/4/16=>124608 sectors

1946/255/63 => 31262490 (close enough to 31268864 , it's ok, as a SD card will rarely have a size multiple of 255/63, though a -partial - cylinder is missing, the actual CHS values for the end of the device would be 1946/101/11 so there is a partial 1947th cylinder)

 

Is it not that the device is a "superfloppy" (no partitions)?

 

What happens if you boot, then run  the commands:

1) geometry <- i know "0x80 (LBA): C/H/S=1947/4/16 Sector count /size=31268864/512"
2) root <- very likely there is no root established

 

Since the size is relatively small, and (I presume) the device is empty, set aside the grldr and menu.lst, do compress it into an archive, post it on *any* free hosting site and post a link to it and Ill have a look ay how it is partitioned/formatted.

 

:duff:

Wonko



#10 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 14 October 2019 - 02:25 PM

mmmmm.....

I'd like to get the "partition table" and "maximum sector number that BIOS could use to read sector data".

ls (hd0)/ <------ this will list the volume files in case the whole drive (hd0) begins at the BPB sector, skipped the MBR track by your BIOS.
ls (hd0,0)/ <------ try this to see if this could hold the volume data.
ls (hd0,1)/ <------ try this to see if this could hold the volume data.
ls (hd0,2)/ <------ try this to see if this could hold the volume data.
ls (hd0,3)/ <------ try this to see if this could hold the volume data.

cat --hex (hd0)+1 <------- this will show the MBR sector, including the partition table.

The following steps are to find maximum BIOS capability of reading sectors.

1. Select a large number N such that

cat --hex (hd0)N+1

fails. N is large enough. Such an N should exist.

2. find an M such that

cat --hex (hd0)M+1

succeeds. Such an M should be less than N.

3. Increase M until

cat --hex (hd0)M+1

no longer succeeds.

or,

decrease N until

cat --hex (hd0)N+1

no longer fails.

In such a way, you will get the maximum sector number that could be used for this BIOS.

Your files (menu.lst, etc.) should resides in the accessible area. If not, grub4dos will fail to find it or fail to load it.

#11 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 14 October 2019 - 04:53 PM

As said on Post No.6 only commands acepted are:

 

just for testing pourposes I reinstalled grub4dos MBR to the Micro-SD card and added only grldr + menu.lst to the root, (also renamed my meny.lst on the PC to not load it) tried steve6375 commands from post No. 2 and also yours, only 2 commands are working:

 

map --status:

 

Floppies_orig=1, HDD_orig=2, floppies_curr=0, HDD_curr=2

 

The INT13 hook is OFF, the drive map table is currently empty

 

geometry:

 

0x80 (LBA): C/H/S=1947/4/16 Sector count /size=31268864/512

 

The geometry do not match with Micro-SD geometry checked by BootIce from Win7: 1946/255/63 total sectors: 31268864

 

If I type root (hd0,0) that drive do not exist.

 

If I type root (hd1,0) root is set to the boot partition of internal HDD.

 

alacran

 

If I type root (hd0,1) that drive do not exist.  Then if I can't make root on a drive no ls command from it is posible too.

 

The SD card was initially formated by RMPrepUSB but single partition, unselecting boot as HDD, latter I installed grub4dos to the MBR by BootIce, so I have no doubt it was formated OK and 255/63 as it is allways done by RMPrepUSB, and confirmed by BootIce, see the attached picture on Post No.6

 

It was only a matter of curiosity to find the cause but now:

 

I'm totally convinced the problem is not on the SD, it is the USB connection through the cellphone what is causing all the issues when booting.

 

And there is nothing we can do to change the cellphone vehaviour.

 

I was trying to extract the SD and boot from it with an USB adapter I have used with another SD card to boot UEFI_MULTI from wimb, but unfortunatelly the phone is into an additional protective plastic cover, that used to be very soft and easy to remove, but now with age it is not soft anymore, I don't want to force it too much because it is going to break, and as this is an old device I will not find a replacement.

 

Anyway since AIO Boot with Grub 2.02 installed to MBR works very fine to boot all WimPE(s) and Linux LIve(s) at least the funtional problem is solved for the user (myself).

 

Thanks to all for your help/ideas.

 

alacran



#12 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 14 October 2019 - 05:47 PM

The map --status command shows  1 floppy and two hard disks

 

Did the system have a floppy disk?

 

Maybe the SD card is somehow double-mapped as both a floppy and hd0?

 

Can you try making the SD card with two primary partitions   (Boot as C: option in RMPrepUSB)

 

Then see if that boots to grub4dos and also do a 'map --status' command to see if you get the same result as last time?



#13 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 14 October 2019 - 10:01 PM

Another test I ran before my previous Post was edit the internal menu of grldr with BootIce (saving it as UTF-8) as follows :

pxe detect
configfile
default 0
timeout 1

title find /menu.lst, /boot/grub/menu.lst, /grub/menu.lst
errorcheck off
configfile /boot/grub/menu.lst
configfile /grub/menu.lst
if "%@root%"=="(ud)" && calc *0x82A0=*0x82b9&0xff
if "%@root:~1,1%"=="f" && find --set-root --devices=f /menu.lst && configfile /menu.lst
find --set-root /menu.lst && configfile /menu.lst
find --set-root /boot/grub/menu.lst && configfile /boot/grub/menu.lst
find --set-root /grub/menu.lst && configfile /grub/menu.lst
errorcheck on
commandline

title commandline
commandline

title reboot
reboot

title halt
halt

 Just in case the SD was seen as another type of device (CD or Floppy) with same results.

 

There is no physical Floppy or CD/DVD device on the PC, but on the phone there is an option to connect it as CD device, but connect as Mass Storage was always used, about:

 

 

Can you try making the SD card with two primary partitions   (Boot as C: option in RMPrepUSB)

 

I'm avoiding this because some Apps that Android allows me, were moved (re-maped) to it, and I will loose them.

Anyway all my USB devices with single partition (Fat-32, exFat or NTFS) and grub4dos MBR boot fine on all PCs at home, (no need to use that trick anymore here), one thing I haven't try is plugg the phone to another PC (easy to do), (for some strange reazon this PC HDD is always formated as 240/63 not the usual 255/63, as all the others are, I thing it depends of MBR Bios)

 

alacran



#14 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 14 October 2019 - 10:57 PM

The internal menu starts with

pxe detect
configfile

The command 'configfile' will try to load a menu.lst and run it (if it can find one).

 

Have you tried

 

geometry --tune (hd0)

or 

geometry --bios (hd0)

or

geometry --sync (hd0)

 

(note sync may change drive MBR and BPB!)

 

If one works, then maybe using

configfile || geometry --xxxxx (hd0) && configfile

would work?


  • tinybit likes this

#15 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 14 October 2019 - 11:52 PM

As said on Post No.6 only commands acepted are:

 

 

If I type root (hd0,1) that drive do not exist.  Then if I can't make root on a drive no ls command from it is posible too.

 

The SD card was initially formated by RMPrepUSB but single partition, unselecting boot as HDD, latter I installed grub4dos to the MBR by BootIce, so I have no doubt it was formated OK and 255/63 as it is allways done by RMPrepUSB, and confirmed by BootIce, see the attached picture on Post No.6

 

It was only a matter of curiosity to find the cause but now:

 

I'm totally convinced the problem is not on the SD, it is the USB connection through the cellphone what is causing all the issues when booting.

 

And there is nothing we can do to change the cellphone vehaviour.

 

I was trying to extract the SD and boot from it with an USB adapter I have used with another SD card to boot UEFI_MULTI from wimb, but unfortunatelly the phone is into an additional protective plastic cover, that used to be very soft and easy to remove, but now with age it is not soft anymore, I don't want to force it too much because it is going to break, and as this is an old device I will not find a replacement.

 

Anyway since AIO Boot with Grub 2.02 installed to MBR works very fine to boot all WimPE(s) and Linux LIve(s) at least the funtional problem is solved for the user (myself).

 

Thanks to all for your help/ideas.

 

alacran

 

You have not tried this one:

 

ls  (hd0)/

 

 

You have not tried this one:

 

cat  --hex  (hd0)+1

 

and these ones:

 

cat  --hex  (hd0)M+1

 

Those are essential and very very important, IMO.



#16 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 03:31 AM

@ steve6375 & @ tinybit

 

I will do some more test with the commands both of you mentioned on your posts and will let you know.

 

alacran



#17 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 06:45 AM

@ steve6375

 

Installed again grub4dos MBR, and copied grldr (original internal list) + menu.lst

 

I started runing your commands first:

 

geometry --tune (hd0) >>> Noting happend, no messages, nothing.

 

geometry --bios (hd0) >>> Noting happend, no messages, nothing.

 

geometry --sync (hd0) >>> A message appeared saying:

 

Writing MBR for drive 0X80 ...sucess.

 

Partition num: 0, active, file system Fat 32, partition type 0X0C ...

 

Then I pressed ESC key and the menu.lst was visible finally.

 

Rebooted the PC twice and menu.lst appeared inmediatly as it usually does.

 

From and the message on screen and your comment  saying:

 

 

(note sync may change drive MBR and BPB!)

 

I assumed the MBR was re-written with C/H/S=1947/4/16

 

Checked geometry and it was in fact: 0x80 (LBA): C/H/S=1947/4/16

 

But to my surprise when checked with BootIce from Win7 it still says it is XXXX/255/63

 

It is booting fine now every time, but I would like to know what this geometry --sync (hd0) command did to fix the issue.

 

@ tinybit

 

Thanks very much for your suggestions my friend, but as the issue was solved I didn't  run any of the commands on your last Post (I just forgot about them, sorry), nevertheless if you still think the info they can give could be interesting for helping some other user(s) issues, just let me know and I will do it ASAP.

 

alacran



#18 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 15 October 2019 - 07:36 AM

BootIce does not give a complete picture.

 

1. Make a 'bad' SD card

2. Run RMPrepUSB - DriveInfo - 0  and save notepad file as BAD0.txt

3. Run RMPrepUSB - DriveInfo - P1 and save notepad file as BADP1.txt

4. Boot it and run geometry --sync (hd0) and quit

5. Run RMPrepUSB - DriveInfo - 0  and save notepad file as SYNC0.txt

6. Run RMPrepUSB - DriveInfo - P1 and save notepad file as SYNCP1.txt

 

Now you can use WinMerge or similar tool to compare the files.

Please attach 4 files in next post.



#19 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 15 October 2019 - 07:59 AM

@alacran

Now that problem solved, so no need to run those test commands suggested by me.

#20 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 09:08 AM

@ steve6375

 

Requested info attached.

 

alacran

Attached Files

  • Attached File  Info.7z   3.43KB   292 downloads


#21 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 15 October 2019 - 09:54 AM

Bad0.txt is empty ???



#22 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 09:58 AM

Yes, it was, but not anymore after running geometry --sync (hd0) >>> SYNC0.txt



#23 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 15 October 2019 - 10:01 AM

You cant have an 'empty' sector!!!

It must have contained 512 bytes of data.

No - something must have gone wrong - please try again.



#24 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 10:50 AM

I ran it again and got same result see Image-1, ran it second time and then got the info, see image-2, New_BAD0.txt (the one with info) attached.

 

alacran

Attached Thumbnails

  • Image-1.png
  • Image-2.png

Attached Files



#25 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 10:57 AM

There is no diference between New_BAD0 and SYNC0, also between BADP1 and SYNCP1

 

Maybe the cause of blank info is a delay on sector 0, the SD is certainly old.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users