Jump to content











Photo
- - - - -

Boot LibreElec with grub4dos from HDD


  • Please log in to reply
99 replies to this topic

#51 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 10:37 PM

system.img is a FAT32 partition image.

You can mount it with ImDisk - no need for any other tool.

 

storage.img is a EXT4 partition image.

You do need a windows driver AND a "disk" mounting tool (as opposed to a "volume" mounting tool such as ImDisk).

 

My mistake I was talking of storage.img wich in fact is ext4, but wrote the wrong name. I edited my post just now.



#52 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 15 October 2019 - 11:07 PM

Yes and no.

 

What is the requisite/goal/current topic?

 

It is seemingly a "moving target".

It started from loading the stuff from an image <- something for which I possibly found a solution and that the OP never tested, moving to "something else".

Then it moved to using partitions and changing their labels, possibly using each and every method BUT the "normal" ones.

Then it moved to creating a new EXT4 partition (again using "external" tools).

 

What I am saying is that (since we are in a multi-boot environment) and (if the issue is creating a partition with EXT4 and copying some files to it) "native" (Linux) tools can be used.

These latter tools may belong to "another" "live" (possibly coming as a .iso) Linux distro or (if the tools exist in LIBREELEC) from within LIBREELEC itself, now that we have extabliished that it boots just fine without any "storage" attached.

 

So one could:

1) boot to LIBREELEC without any storage attached
2) *somehow* create from the booted LIBREELEC a new "storage" partition/volume (or image)

3) format the above as EXT4

4) copy to it the *whatever*  files

5) re-boot the LIBREELEC with the newly created storage attached

 

If this is not possible, another (smallish, live) Linux distro could be used to:
1) boot to this "other distro" 

2) create from the booted "other distro" a new "storage" partition/volume (or image)

3) format the above as EXT4

4) copy to it the *whatever*  files

5) boot the LIBREELEC with the newly created storage attached

 

But *anything goes*.

 

@alacran

Most probably it is just me, either lacking since a few days some basic English understanding or suddenly becoming too old for this :( , but I cannot make head or tail of most of your posts lately and I just got tired of needing to solve one or more puzzles at each of your posts to maybe understand their contents. 

Anyway, if you are root to a filesystem that has a file called "system.img" in it and you pass to a kernel a parameter "SYSTEM_IMAGE=SYSTEM" how do you extect it to find "system.img"? (maybe it will look for "SYSTEM" or "system" and not for "system.img")

 

:duff:

Wonko

 

I started trying to boot this libreELEC from HDD as the title of the post says, then frist idea I had was try to boot from *.img, once it proved to be a not easy task involving imagepartitions and have free the third partition (comon on USB sticks, but not so comon on HDDs) as from steve6375 recomended link on Post No. 2

But anyway if the image partition needs to be loaded from a (fake) partition, and I'm trying to boot from internal HDD it made a lot of sence to me just making the real partitions on the HDD will be best option.

 

Of course with your and erwan.l comments and suggestions, and after some adjustments to the procedure and the menu entrances this goal was accomplished, see Post No. 23

 

Then from same steve6375 link, I also got the idea maybe a single partion Fat-32 of proper size could also content an image file of the ext4 partition and reduce the partitions required to be made on the HDD. See: http://reboot.pro/to...e-2#entry212988

 

So as you can see the initial goal was with open alternatives, and it was reached, then new idea (to say good or bad, needs to be tested), trying to improve it is under development yet.

 

About your comment, I'm sorry but yes, you are getting old, (unfortunatelly not only you but also myself) we are getting old my friend, attached picture of SYSTEM file located into (hd0,8) as said on my post.

 

 

title Start LibreELEC from HDD
find --set-root /syslinux.cfg                            >>>> This is located on (hd0,8)
kernel /kernel SYSTEM_IMAGE=SYSTEM

 

alacran

Attached Thumbnails

  • SYSTEM.png


#53 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 07:03 AM

I desinstalled Linux File Systems for Windows and rebooted installed ext2fsd and rebooted then made the following:

 

1.- On clonedisk created (on a NTFS Volume) and attached a fixed Storage vhd (but without extension) (540 MB), not partitioned or inicialized.

 

2.- Now I can see it on MiniTool Partition Wizard free 11.5, then just copied/cloned to it the ext4 from USB device. (it has to be unasigned space to do it), It is now ext4, then enlarged the System Partition on HDD (hd0,8) from 512 MB to 1080 MB, and Closed Partition Wizard.

 

3.- ext2fsd  sees the virtual disk and asigned letter H to it, but can't see anything on windows.

 

4.- Opened PartitionGuru just to verify all files folder where copied fine to the new ext4 since with this program you can see them, (all was fine), Closed PartitionGuru.

 

5.- Copied the Storage file inside System Partition on HDD and tried to boot using this entraces on my menu.lst:

title Start LibreELEC from HDD
find --set-root /syslinux.cfg
kernel /kernel boot=LABEL=System disk=LABEL=Storage tty portable quiet

title Start LibreELEC from HDD Option-2
find --set-root /syslinux.cfg
kernel /kernel boot=LABEL=System disk=LABEL=System/Storage tty portable quiet

None of them work: Can't find Storage.

 

I tested also making the ext4 Storage file (empty) with RMPrepUSB and mounted it with ArsenalImageMounterMountTool (also can't see inside it on windows) and just continued on # 2.

 

Same results.

 

How could I adapt the kernel line to load Storage from inside Sytem partition or volume (what ever it is the right word)?

 

Or is not possible to load Storage from that location, nested on System?

 

alacran



#54 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 16 October 2019 - 07:43 AM

Ok, for all that matters, I just did the following:

1) attached the (stupid) LibreELEC-Generic.x86_64-9.0.2.img to Virtualbox

2) booted from a grub4dos floppy (I used a 0.4.5c, but *any* would do)

3) got to command line

4) made sure that the libreelec image was (hd0)

5) cat --hex --skip=24 --length=4 (hd0,0)0+1

6)got the (expected) 00000018: 00 20 04 00

7) write --offset=24 (hd0,0)0+1 \x3F\x00\xFF\x00

8) root (hd0,0)

9) kernel /KERNEL BOOT_IMAGE=KERNEL SYSTEM_IMAGE=SYSTEM boot=LABEL=LIBREELEC live quiet

10) boot

 

And the (stupid) Librelec booted just fine.

 

Then it stopped with a XORG error about GPU not supported, but that was expected:

https://forum.libree...-gpu-supported/

 

Anyway, should be an entirely different story.

 

As I cannot go further on VirtualBox, it remains to see (the second partition has seemingly a label of "STORAGE") if this works:

kernel /KERNEL BOOT_IMAGE=KERNEL SYSTEM_IMAGE=SYSTEM boot=LABEL=LIBREELEC disk=LABEL=STORAGE live quiet

 

:duff:

Wonko

 

Nice, you are actually patching the image from G4D and replacing the original (and wrong from a G4D point of view as discussed previously) "Heads" and "Sectors" values 8192/4 aka \x00\x20\x04\x00 by 255/63 aka \x3F\x00\xFF\x00.



#55 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 16 October 2019 - 08:18 AM

@erwan.l
You see? :)
 
@alacran
Let us assume for one moment that (as already said http://reboot.pro/to...m-hdd/?p=212934 ) a parameter like:
disk=LABEL=Storage
actually means:
"look for all accessible volumes and find one with label "Storage"
 
Does it surprise you that since no volume with label storage is available the Storage is not found? :frusty:
 
(no, no need to reply, that is only a rhetorical question)
 
There are (here and there) some hints that something *like* 
disk=FILE=storage
might work, but no idea nor any way to test. 
 
:duff:
Wonko

#56 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 12:23 PM

Tried:

 

title Start LibreELEC from HDD
find
--set-root /syslinux.cfg
kernel
/kernel boot=LABEL=System disk=FILE=Storage tty portable quiet

 

Can't find Storage



#57 steve6375

steve6375

    Platinum Member

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

Posted 16 October 2019 - 12:36 PM

What is the Volume Label of the storage volume (it is case sensitive)?

STORAGE

Storage

storage

 

or does it even have a volume label?

There needs to be a partition on the disk with volume label of 'Storage' for linux to find it.

If you have a free primary partition, you could use partnew to make one from storage.img and it could have a type of 0.

e.g.  Using recent  grub4dos 0.4.6a (replace X with your disk number - make sure 4th primary partition is free!

find --set-root /syslinux.cfg
vol
echo ls /storage.img || pause ERROR: File /storage.img not on this partition!
echo PARTITION TYPE (MUST BE 0x00)!!!!
parttype (hdX,3)
pause Volumes shown before partnew command - press a key to run partnew only if type = 0x00...
partnew (hdX,3) 0x83 /storage.img
vol
pause Check STORAGE volume exists now
parttype (hdX,3) 0
kernel /kernel boot=LABEL=System disk=LABEL=STORAGE tty portable quiet

Edited by steve6375, 16 October 2019 - 01:00 PM.


#58 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 16 October 2019 - 12:47 PM

What is the Volume Label of the storage volume (it is case sensitive)?

STORAGE

Storage

storage

 

or does it even have a volume label?

 

STORAGE (capital letters).

See screeshots in this post (hexa edition) or here (7zip edition).



#59 steve6375

steve6375

    Platinum Member

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

Posted 16 October 2019 - 12:59 PM

previous post edited...



#60 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 16 October 2019 - 01:06 PM

STORAGE (capital letters).

See screeshots in this post (hexa edition) or here (7zip edition).

Yep, but in the case of disk=FILE= (which again may or may not work) what counts is not the label, but rather the filename (and of course the file needs to exist, and it has to be seen if it need to be a volume - or superfloppy - image or a disk image containing a partition).

 

See what has to write about it Steve6375 himself:

http://rmprepusb.blogspot.com/2013/10/

 

 

If you have a FAT32 E2B USB drive, then download the appropriate version (I used Generic i386 Version 3.2.2) and extract the KERNEL and SYSTEM files from the target folder and place them in the root of your E2B drive (actually you could move the KERNEL file if you changed the path in the .mnu file).

Then make a .mnu file for E2B as follows:

title OpenELEC
uuid () > nul
set UUID=%?%
kernel /KERNEL boot=UUID=%UUID% disk=FILE=STORAGE,512

This will cause OpenELEC to make a 512MB ext4 file called STORAGE on the root of the E2B USB drive when it first boots. This is used to hold all the OpenELEC downloaded files, changes, etc.

 

I found some (BTW "vague") references about the same working for LIBREELEC (but of course it may not be or it may apply only to some vesions and not to the one at hand.

 

:duff:

Wonko



#61 erwan.l

erwan.l

    Platinum Member

  • Developer
  • 3041 posts
  • Location:Nantes - France
  •  
    France

Posted 16 October 2019 - 01:15 PM

Yep, but in the case of disk=FILE= (which again may or may not work) what counts is not the label, but rather the filename (and of course the file needs to exist, and it has to be seen if it need to be a volume - or superfloppy - image or a disk image containing a partition).

 

Correct, I was merely replying to the question "What is the Volume Label of the storage volume?".

One should definitely make a distinction between the volume name and the file name.

Being in a linux world here, case sensitivity should not be overlooked, in both cases.

 

By now (3 pages thread) we have probably lost lots of readers but hopefully Alacran will follow :)



#62 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 03:24 PM

@ steve6375

Wonko is testing to boot directly from downloaded LibreELEC-Generic.x86_64-9.0.2.img

If you open it with 7-zip you will see the partition .img(s) names are system.img and storage.img

In my case the name is Storage.

Because I installed it first on USB-1 made by LibreELEC installer tool and used for some time and configured it to my preferences, then from USB-1 was installed to USB-2 making a real final install and restored the backup (no more install, live or run availables on the new created syslinux.cfg), just straight boot, and during install it used then System and Storage (no user options) for the labels.

Anyway I don't think it is case sensitive, since I have kernel and it is in fact KERNEL and it works fine, see following title.

This works great for both partitions (cloned from USB-2 to keep all my configurations) on the HDD:

title Start LibreELEC from HDD
find --set-root /syslinux.cfg
kernel /kernel boot=LABEL=System disk=LABEL=Storage tty portable quiet

But in following case this is an Storage ext4 file (inside is cloned Storage partition from USB-2, located into a bigger (1 GB Fat-32) System partition, trying to use only one partition for LibreELEC, (if possible, it is under test to verify it), thanks for your suggestion but I'm trying to do not use image partitions or maping as Partnew since they need an empty fourth partition, very common to have it available on USB sticks, but not so frequent on HDs.

title Start LibreELEC from HDD
find --set-root /syslinux.cfg
kernel /kernel boot=LABEL=System disk=FILE=Storage tty portable quiet

This faills: Can't find Storage. Any suggestion is wellcome. And I will test it ASAP.

alacran



#63 steve6375

steve6375

    Platinum Member

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

Posted 16 October 2019 - 03:58 PM

OK

What is the name of the file?

Storage? storage? Storage.img? storage.img?

 

and where is it located?

same drive as syslinux.cfg ? In root of that drive?

 

I think the file needs to be in the 'System' volume.

 

why not add some commands and see?

title Start LibreELEC from HDD
find --set-root /syslinux.cfg
vol
ls /
pause Is there a file called 'Storage' listed (same case and spelling)?
kernel /kernel boot=LABEL=System disk=FILE=Storage tty portable quiet


#64 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 04:11 PM

 

What is the name of the file?

Storage? storage? Storage.img? storage.img?

 

and where is it located?

same drive as syslinux.cfg ? In root of that drive?

 

I think the file needs to be in the 'System' volume.

 

I have all tree now on System volume.



#65 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 04:45 PM

With no doubt the file is there see Picture No.1, then when trying to mount it said:

error in mount_storage: mount_part: Unknown filesystem File=storage. Picture No. 2

 

But if you see Picture Storage all seems to be fine with the file.

 

EDIT: For this picture it was mounted as RO.

 

alacran

Attached Thumbnails

  • 1.jpg
  • 2.jpg
  • Storage.png


#66 steve6375

steve6375

    Platinum Member

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

Posted 16 October 2019 - 04:53 PM

Hmmm - unknown filesystem tends to imply that it found the file but did not like what was inside it.

Either that or maybe it does not understand FILE= syntax?

If you mis-spell the filename - e.g. FILE=xxx   does it give a different error message or the same 'unknown filesystem' message?

Please show at least last 8 lines of any error message and in focus too (it helps to see where error has occurred).



#67 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 05:17 PM

Hmmm - unknown filesystem tends to imply that it found the file but did not like what was inside it.

Either that or maybe it does not understand FILE= syntax?

If you mis-spell the filename - e.g. FILE=xxx   does it give a different error message or the same 'unknown filesystem' message?

Please show at least last 8 lines of any error message and in focus too (it helps to see where error has occurred).

 

The message:

error in mount_storage: mount_part: Unknown filesystem File-storage.

was just as in the picture, no more lines before or after, been so long if was difficult to focus it fine then I typed it for you.

 

When the name is wrong it says: Could not mount XXXXXX, I have a previous picture made when using UUID (not LABELS) it was wrong, not in focus too, then for this not attached.



#68 steve6375

steve6375

    Platinum Member

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

Posted 16 October 2019 - 05:28 PM

OK

so when the name is wrong we get a different message.

So this proves that DISK= is working and it does find the file and mounts it but it does not recognise the contents as being valid.

 

So, why not change the kernel line to  DISK=XXX,512

and it should make a 512MB DATA file called XXX

 

then compare XXX with Storage - are they both ext4? Do they have the same volume label? 

Using a hex editor, do the first few sectors look similar?



#69 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 05:41 PM

Sorry to make you got to wrong conclusions, after making my previous post I tought maybe the message for FILE could be different, and decided to test it to see, then just changed the kernell line to: kernel /kernel boot=LABEL=System disk=FILE=xxxx tty portable quiet   (xxxx file do not exist)

 

The message I got was:

error in mount_storage: mount_part: Unknown filesystem File=xxxx

 

Same as the message for file Storage, so when not find it says Unknown filesystem File=Whatever you put as name/label.

 

Wich is very different than when dealing with UUID

 

alacran

Attached Thumbnails

  • xxxx.jpg


#70 steve6375

steve6375

    Platinum Member

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

Posted 16 October 2019 - 05:50 PM

OK - but it important that you follow instructions EXACTLY and report what you see accurately.

You are wasting a lot of my time and other peoples time by not following instructions and by not reporting what you see.

 

Now  you still need to do the  DISK=XXX,50  test  (use 50 as we don't care about the size now - just where it will be made).

Then see where the file XXX is made.

 

S



#71 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 05:56 PM

OK, doing it.



#72 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 06:20 PM

Used title:

 

title Start LibreELEC from HDD Option-3
find --set-root /syslinux.cfg
kernel /kernel boot=LABEL=System disk=XXX,50 tty portable quiet

 

Faills with following message:

 

error in mount_storage: mount_part: Unknown filesystem xxx/50

 

No file xxx file or folder was created on any partition including System partition Fat-32 of LibreELEC (hd0,8), checked carefully on this partition, and also with SwiftSearch on all NTFS partitions including Windows System Reserved partition (hd0,0)



#73 steve6375

steve6375

    Platinum Member

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

Posted 16 October 2019 - 06:28 PM

The correct syntax is

 

disk=FILE=XXX,512

 

Did you use that ?



#74 alacran

alacran

    Platinum Member

  • .script developer
  • 2710 posts
  •  
    Mexico

Posted 16 October 2019 - 07:49 PM

No, I did exactly as said:

 

OK - but it important that you follow instructions EXACTLY and report what you see accurately.

You are wasting a lot of my time and other peoples time by not following instructions and by not reporting what you see.

 

Now  you still need to do the  DISK=XXX,50  test  (use 50 as we don't care about the size now - just where it will be made).

Then see where the file XXX is made.

 

S

 

Now tested this:

 

The correct syntax is

 

disk=FILE=XXX,512

 

Did you use that ?

 

Used this menu entrance:

title Start LibreELEC from HDD Option-3
find --set-root /syslinux.cfg
kernel /kernel boot=LABEL=System disk=FILE=XXX,512 tty portable quiet

Faill with followin message:

error in mount_storage: mount_part: Unknown filesystem File=XXX,512     NO XXX file was created on any partition.

Also made another test with Storage file copied on (hd0,7) and made a fresh System libreELECT partion (hd0,8), cloning it from the USB again, no Storage file into it now.

title Start LibreELEC from HDD Option-2
find --set-root /syslinux.cfg
kernel /kernel boot=LABEL=System disk=FILE=Storage tty portable quiet

 

Message:
error in mount_storage: mount_part: Unknown filesystem File=Storage

It seems it is not able to find the file wherever I put it.

 

Anymore ideas or ready to give up?

 

Remember I can return to have 2 real partitions on HDD, wich works fine, and forget about the idea of have all in only one partition, it is up to you, I can make all test you want if you decide to continue.

 

alacran
 



#75 steve6375

steve6375

    Platinum Member

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

Posted 16 October 2019 - 08:08 PM

yes, sorry, my bad! I didn't give you an exact menu command and I just assumed you would use the correct syntax as I used a kind of 'shorthand'.

 

Well, I give up!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users