Boot from vhd file fails (Grub4DOS) [SOLVED]

Post here if you are a new Porteus member and you're looking for some help.

Boot from vhd file fails (Grub4DOS) [SOLVED]

Postby m0dder » 17 Jan 2015, 03:31

Hi Everyone !


I would like to know if there's a way to boot Porteus from an image file (Raw IMG or VHD) with Grub4DOS.

My main OS is Windows so that's why I want to use a NTFS or FAT32 file system so that I can mount the disk image with ImDisk and have access to the Porteus file system from within Windows.

I prefer using NTFS because of the file system compression but FAT32 will do...

I used Microsoft Virtual PC 2007 to boot from the Porteus ISO file and I copied the content to the virtual Hard drive (FAT32).
Then I ran the Porteus installer from the virtual drive to make it bootable.


I closed the VM and I managed to boot the VHD file with Grub4DOS on a real machine.

Here is my Grub4DOS menu entry:

Code: Select all
title Porteus
find --set-root --ignore-floppies /BOOT.TAG
map /Porteus.vhd (hd0)
map --hook
root (hd0,0)
chainloader +1


The vhd file boots fine.
The Porteus Boot Menu appears and all goes well until Porteus starts searching for the porteus-V3.1-i486.sgn file.

It then stops on this error; :wall:

"Porteus data not found"

I wonder if I missed something.

Maybe the Grub4DOS menu entry is wrong ? :unknown:
Last edited by m0dder on 18 Jan 2015, 08:24, edited 1 time in total.
m0dder
White ninja
White ninja
 
Posts: 8
Joined: 16 Jan 2015, 22:56
Location: France
Distribution: Porteus x86

Re: Boot from vhd file fails (Grub4DOS)

Postby Ed_P » 17 Jan 2015, 06:32

I don't know about vhd files but I boot the Porteus .iso files using Grub4DOS like this:
Code: Select all
set ISO31=Porteus-LXQT-v3.1-x86_64.iso
set ISO30i=Porteus-RazorQT-v3.0.1-i486.iso
set ISO30=Porteus-RazorQT-v3.0.1-x86_64.iso
set ISO21=Porteus-RazorQT-v2.1-x86_64.iso

# menu entries

title Porteus 3.1   changes=EXIT  \n186MB\n %ISO31% 
find --set-root                       /ISOs/%ISO31%
map --heads=0 --sectors-per-track=0   /ISOs/%ISO31% (0xff)
map --hook
root (0xff)
kernel /boot/syslinux/vmlinuz    from=/ISOs/%ISO31% changes=EXIT:/porteus3.1/changes/porteussave.dat extramod=/porteus3.1/Modules volume=40 ramsize=80% 
initrd /boot/syslinux/initrd.xz

title Porteus 3.1   changes=      \n186MB\n %ISO31% 
find --set-root                       /ISOs/%ISO31%
map --heads=0 --sectors-per-track=0   /ISOs/%ISO31% (0xff)
map --hook
root (0xff)
kernel /boot/syslinux/vmlinuz    from=/ISOs/%ISO31% changes=/porteus3.1/changes/porteussave.dat extramod=/porteus3.1/Modules volume=40 ramsize=80% 
initrd /boot/syslinux/initrd.xz

title Porteus 3.1   Always Fresh  \n186MB\n %ISO31%
find --set-root                       /ISOs/%ISO31%
map --heads=0 --sectors-per-track=0   /ISOs/%ISO31% (0xff)
map --hook
root (0xff)
kernel /boot/syslinux/vmlinuz    from=/ISOs/%ISO31% volume=40 
initrd /boot/syslinux/initrd.xz

title Porteus 3.1   Always Fresh +\n186MB\n %ISO31% with networks
find --set-root                       /ISOs/%ISO31%
map --heads=0 --sectors-per-track=0   /ISOs/%ISO31% (0xff)
map --hook
root (0xff)
kernel /boot/syslinux/vmlinuz    from=/ISOs/%ISO31% extramod=/porteus3.1/modnetwork volume=40 
initrd /boot/syslinux/initrd.xz
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2802
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.* 64-bit ISO

Re: Boot from vhd file fails (Grub4DOS)

Postby m0dder » 18 Jan 2015, 03:43

Ed_P wrote:I don't know about vhd files but I boot the Porteus .iso files using Grub4DOS like this: [...]


Grub4DOS is very powerful but complex and I don't understand all it commands.
I use it mostly for booting Windows OSes and I'm having a hard time understanding the Linux universe.

You are booting read-only iso images but you're using save files ?

That's very interesting but I don't understand how that works... :pardon:

Where does it put the save file ?
m0dder
White ninja
White ninja
 
Posts: 8
Joined: 16 Jan 2015, 22:56
Location: France
Distribution: Porteus x86

Re: Boot from vhd file fails (Grub4DOS)

Postby francois » 18 Jan 2015, 04:54

You can install porteus with unetbootin on your windows ntfs partition. You will not even have to make a special partition as you will be doing a "poor man install" (see knoppix). Unetbootin is a very straighforward gui. For testimony:
http://usalug.com/phpBB3/viewtopic.php?f=2&t=15793&start=15

One step porteus HDD INSTALL in windows (without partitioning, using unetbootin). This is adapted from a popular old post of mine:
http://forum.porteus.org/viewtopic.php?f=81&t=4275

Unetbootin download:
http://unetbootin.sourceforge.net/unetbootin-windows-latest.exe
Porteus download:
http://dl.porteus.org/

Do the following, do no choose any other option:
Image
Select windows unetbootin download; as porteus is not an available distribution, select diskimage to get your downloaded copy of porteus; select type: hard disk drive C:: let unetbootin do the job (downloading slax); agree to reboot. After bios boot you will be offered the choice between windows and unetbootin. Choose unetbootin. Let it boot to be in the graphical environment or press tab to select amongst the usb choices, wheter it be graphical, text mode, ram or PXE.


IMPORTANT: The next reboot will be in the window environment. At the window prompt do not select remove previous installation of unetbootin. This would remove the unetbootin installation that you just have setup. At next boot, just after the bios booting, you will have two choices. Select UNETBOOTIN and slax will boot.
Voltaire: Le mieux est l'ennemi du bien.
User avatar
francois
Contributor
Contributor
 
Posts: 4718
Joined: 28 Dec 2010, 15:25
Location: C'est l'autome, en forêt les arbres d'ici nous en mettent plein la vue: les rouges, jaunes ...
Distribution: kde xfce porteus manjaro kubun

Re: Boot from vhd file fails (Grub4DOS)

Postby m0dder » 18 Jan 2015, 06:16

Thank you for explaining how to install Porteus on a Windows partition François !

But... that's not what I'm trying to do here. :)

You should know that I'm a crazy eccentric person that doesn't like folowing standard procedures. :crazy:

I always read the frickin' manual before using stuff to discover that the things I want to do are not documented (yet)... :o

I can't install Porteus on a Windows partition because I'm booting Windows from image files so there are no Windows partitions on my hard drive !

My goal: cramming all my OSes into image files so there won't be anymore partitions and folders containing OS files on my drive.

My drive contains a partition that has only image files that contain various OSes and doing things this way allow me to do some tricks that ony work with image files. :twisted:

So to make things work for me Porteus MUST be installed on a writable image file (.img , .vhd) and it MUST be booted using Grub4DOS.

Hope someone can help me to archieve this with Porteus...
m0dder
White ninja
White ninja
 
Posts: 8
Joined: 16 Jan 2015, 22:56
Location: France
Distribution: Porteus x86

Re: Boot from vhd file fails (Grub4DOS)

Postby Ed_P » 18 Jan 2015, 06:18

m0dder wrote:Grub4DOS is very powerful but complex and I don't understand all it commands.
I use it mostly for booting Windows OSes and I'm having a hard time understanding the Linux universe.

Oh, I can totally relate.

You are booting read-only iso images but you're using save files ?

That's very interesting but I don't understand how that works... :pardon:

Where does it put the save file ?

Yes, I am using save files for persistence. I allocate them on the NTFS partition that I have the ISOs on
using the Porteus SaveFile manager app.
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2802
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.* 64-bit ISO

Re: Boot from vhd file fails (Grub4DOS)

Postby Ed_P » 18 Jan 2015, 06:36

m0dder wrote:I can't install Porteus on a Windows partition because I'm booting Windows from image files so there are no Windows partitions on my hard drive !

Ok, what type of partitions do you have on your hard drive?

My goal: cramming all my OSes into image files so there won't be anymore partitions and folders containing OS files on my drive.

Well, that's not possible. There will be at least one partition on your hard drive containing your images and your images will be in at least one folder referred to as root.
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2802
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.* 64-bit ISO

Re: Boot from vhd file fails (Grub4DOS)

Postby m0dder » 18 Jan 2015, 06:48

Ed_P wrote:Yes, I am using save files for persistence. I allocate them on the NTFS partition that I have the ISOs on
using the Porteus SaveFile manager app.

For me persistence is a must and a standard HD install in a bootable VHD file with NTFS would be ideal but I understand that Porteus must use .dat files on FAT/NTFS.

Maybe I should install ext drivers in Windows and use the ext3 file system for the VHD file so I can have the best of both worlds: using a Porteus image file with a standard HD install and being able to access the Porteus file system when I'm running Windows...

On my Porteus USB install I tried to make a save file using the Porteus SaveFile manager app but Porteus doesn't seem to use it.
Nothing is saved at all ! :wall:

Maybe there's some config file I have to edit to tell Porteus where to find the save file ? :unknown:
m0dder
White ninja
White ninja
 
Posts: 8
Joined: 16 Jan 2015, 22:56
Location: France
Distribution: Porteus x86

Re: Boot from vhd file fails (Grub4DOS)

Postby m0dder » 18 Jan 2015, 07:01

Ed_P wrote:Ok, what type of partitions do you have on your hard drive?


Typically I would have 1 or 2 smallish (5-25 GB) primary FAT32 partitions and a huge NTFS extended partition that covers the remaining drive space.

Ed_P wrote: There will be at least one partition on your hard drive containing your images and your images will be in at least one folder referred to as root.


I don't mind having some folders with image files on my FAT32 partitions and some small config and boot files, but the OSes must be contained in image files.

Image files are nice.
They can contain thousands of small files and you can still copy them fast unto slow flash memory media. :D
m0dder
White ninja
White ninja
 
Posts: 8
Joined: 16 Jan 2015, 22:56
Location: France
Distribution: Porteus x86

Re: Boot from vhd file fails (Grub4DOS)

Postby Ed_P » 18 Jan 2015, 07:04

m0dder wrote:Maybe there's some config file I have to edit to tell Porteus where to find the save file ? :unknown:

Yes, see the changes= parameter in my Grub4DOS menus.
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2802
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.* 64-bit ISO

Re: Boot from vhd file fails (Grub4DOS)

Postby m0dder » 18 Jan 2015, 07:15

Ed_P wrote:
m0dder wrote:Maybe there's some config file I have to edit to tell Porteus where to find the save file ? :unknown:

Yes, see the changes= parameter in my Grub4DOS menus.


I see...
The changes= parameter points to a relative path on the boot drive ? :)
m0dder
White ninja
White ninja
 
Posts: 8
Joined: 16 Jan 2015, 22:56
Location: France
Distribution: Porteus x86

Re: Boot from vhd file fails (Grub4DOS)

Postby Ed_P » 18 Jan 2015, 08:07

m0dder wrote:The changes= parameter points to a relative path on the boot drive ? :)

In a manner of speaking.

/mnt/sda3/ = c:\

c:\grldr
c:\menu.lst
etc.

/mnt/sda5/ = d:\

d:\ISOs
d:\Porteus2.1\
etc
d:\Porteus3.0\
etc
d:\Porteus3.1\
d:\Porteus3.1\changes\porteussave.dat
d:\Porteus3.1\Modules\
d:\Porteus3.1\modnetwork\
etc

So it points to the drive that Grub4DOS found the porteus iso file on.
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2802
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.* 64-bit ISO

Re: Boot from vhd file fails (Grub4DOS)

Postby Ed_P » 18 Jan 2015, 08:19

m0dder wrote:Typically I would have 1 or 2 smallish (5-25 GB) primary FAT32 partitions and a huge NTFS extended partition that covers the remaining drive space.

I prefer 3 partitions but for different reasons. The C: is the booting partition and is Windows based . The 2nd is for DATA files; pictures, documents, favorites, utilities, isos, etc., and the last is for Backups, system image type. All are NTFS and when possible all are Primary. Some systems come with hidden recovery partitions.

Ed_P wrote: I don't mind having some folders with image files on my FAT32 partitions and some small config and boot files, but the OSes must be contained in image files.

Image files are nice.
They can contain thousands of small files and you can still copy them fast unto slow flash memory media. :D

Same with ISOs. :wink:
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2802
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.* 64-bit ISO

Re: Boot from vhd file fails (Grub4DOS) [SOLVED]

Postby m0dder » 18 Jan 2015, 08:30

SOLVED ! :Yahoo!: :Yahoo!: :Yahoo!:

Booting Porteus image file now works without flaws !

The save file is stored INSIDE the vhd file and changes are saved ! :Yahoo!:

Code: Select all
title Porteus
find --set-root --ignore-floppies /BOOT.TAG!
map /Porteus.vhd (hd0)
map --hook
root (hd0,0)
kernel /boot/syslinux/vmlinuz    changes=/porteus/save.dat 
initrd /boot/syslinux/initrd.xz


Wow !

I'm impressed....
Porteus is the best lightweight Linux distro I found. :D
m0dder
White ninja
White ninja
 
Posts: 8
Joined: 16 Jan 2015, 22:56
Location: France
Distribution: Porteus x86

Re: Boot from vhd file fails (Grub4DOS)

Postby m0dder » 18 Jan 2015, 08:56

Ed_P wrote:I prefer 3 partitions but for different reasons. The C: is the booting partition and is Windows based . The 2nd is for DATA files; pictures, documents, favorites, utilities, isos, etc., and the last is for Backups, system image type. All are NTFS and when possible all are Primary. Some systems come with hidden recovery partitions.

No hidden recovery partitions for me.
I keep backups of my OS image files and I don't repair broken installations.
I just replace the broken image with a backup...

Windows XP is still my main OS but it is hardened and "semi-virtualized".
I'm running it in ramdisk mode and the source image file is not accessible when XP is online so it can not be infected by malware.
Stateless computing without running additional software sucking up resources... 8)

I hate regular OS partitions and I will try to find a way to use all my drives with a single VFAT or NTFS partition.
Partitions suck because I keep resizing them all the time and that's too risky. :evil:

Ed_P wrote:
Same with ISOs. :wink:


Sure... but ISOs are read-only.
Kinda sucks when you want to add modules to your installation and stuff.
But I guess you could add things to the save file to circumvent the problem... ?

Anyway, thanks for your help... :D
m0dder
White ninja
White ninja
 
Posts: 8
Joined: 16 Jan 2015, 22:56
Location: France
Distribution: Porteus x86


Return to Newbie questions



Who is online

Users browsing this forum: No registered users and 3 guests