Reply to this topic
 grub4dos can not access hard disk image in ext2 partition ?, same HDD image in FAT32 partition works fine
post Jan 29 2010, 10:25 AM
Post #1
hcchen5600
  
Group: Members

  Joined: 29-January 10
Posts: 3
Thank(s): 0


Taiwan


I have a 8G USB drive with a type=83h Linux ext2 file system partition. It boots to Puppy Linux normally.

But I need to boot to DOS sometimes and I need a hard disk for this case.
So I put a floppy image and a qemu raw hard disk image in the root directory of this USB storage. Then

I wish that I can use grub4dos (version 0.4.4) to boot from the floppy image with the hard disk image available for usages.

I found _2_ problems.

1.
Hard disk image file in ext2 file system directory (in USB drive or in hard disk) never work.
When boot from the hard disk image, I got "Invalid partition table" error. According to my checks, I think the hard disk image is not accessed correctly by grub4dos, data corrupted to grub4dos' viewpoint.

Same grub4dos, same menu.lst (shown below) but simply move the hard disk image to a FAT32 folder (USB drive ok, HDD ok). Everything works fine.

2.
How to make image files "contiguous" in ext2 file system? grub4dos requires "contiguous" if we need to write something into the image file. In FAT32 file system this is easy. But I found even as small as a 1M bytes image file will be separated into pieces in ext2. (checked by grub4dos blocklist command).

----- menu.lst --------
title boot from DOS Hard disk image 1m.img
map (hd0) (hd1) <========== physical hd0 is the USB drive
map --heads=16 --sectors-per-track=63 (hd1,0)/1m.img (hd0) <==== need --mem when image in ext2 folder
map --hook
chainloader (hd0)+1
rootnoverify (hd0)
boot
----------------------------------


+Quote Post
post Jan 29 2010, 03:08 PM
Post #2
Icecube
Silver Member   ****
Group: Advanced user

  Joined: 7-September 08
Posts: 641
Thank(s): 172


Belgium


Making image files "contiguous" on an ext2 file system isn't possible (due to design of ext2). In ext4 contiguous files are supported.

The Ext2 Filesystem Utilities (e2fsprogs ) also contain a defragger for ext4 (e4defrag).
Grub4dos supports ext4.

Did you try to load the image with MEMDISK?
CODE
title Boot Hard disk image with MEMDISK
kernel /memdisk
initrd /1m.img

You can add 'harddisk' to the kernel line if MEMDISK doesn't detect the disk as hard disk.
Optionally:
QUOTE
You can also specify the geometry manually with the following command
line options:

c=# Specify number of cylinders (max 1024[*])
h=# Specify number of heads (max 256[*])
s=# Specify number of sectors (max 63)


--------------------
+Quote Post
post Jan 30 2010, 08:15 AM
Post #3
hcchen5600
  
Group: Members

  Joined: 29-January 10
Posts: 3
Thank(s): 0


Taiwan


Thank you soooooo much. I found that you foresee all the problems I will see when trying memdisk. Cool !!

My steps are:
1. search the net for "memdisk". I found it's a module in syslinux that can be found here. I copy the "memdisk" to my "(hd0,5)/" which is the root directory of a Linux ext2 partition.
2. copy my DOS boot-able QEMU hard disk image 1m.img to "(hd0,5)/" also.
3. Turn on the computer (Ubuntu 904), press ESC when grub (it's not grub4dos, it came with Ubuntu) starts up > press 'c' to get to grub command prompt.
4. type grub commands ....
kernel (hd0,5)/memdisk h=16 s=63 harddisk
initrd (hd0,5)/1m.img
boot
5. It works !! shooooo finally thank you thank you very much

the memdisk switch h=N and s=N is my "1m.img" image's parameters. "h=16 s=63 harddisk" are necessary, or memdisk will make incorrect guess that can be easily noticed by its messages. It thinks the image is a floppy for example and memdisk's CHS guess is wrong also.

Now I wish grub4dos can be ok by this way too . . . .
+Quote Post

Reply to this topic
1 User(s) are reading this topic ()



Collapse

  Topic Replies Topic Starter Views Last Action
No New Posts Grub4dos iso Size Limit?
1 sara - pmedia 106 Yesterday, 08:31 AM
Last post by: Wonko the Sane
No new Topic has attachmentsInstall Windows 7/Vista From USB Drive
Very simple
71 Nuno Brito 35,954 1st September 2010 - 02:34 PM
Last post by: ps2_hacker
No New Posts Intel 82577LM not auto detected / HP 8540w
4 spiffywiffy 148 1st September 2010 - 12:29 PM
Last post by: dera
No New Posts internet problems
1 rjp54 104 30th August 2010 - 02:48 PM
Last post by: Wonko the Sane
No new grub4dos booting ubuntu iso
29 mipstien 12,435 27th August 2010 - 10:27 AM
Last post by: Wonko the Sane