Hello ! Interesting experiments you do here, I did similar work some weeks ago to produce a partition disk image offline.
First of all, you do not need to construct such a image with 64B fdisk data. Simple use `fdisk /tmp/<IMAGE-FILE>' and setup virtual geometry data. But I did not know, whats the problem here. Retry it with the fdisk method I described above, perhaps it helps because of the consistence geometry data. With friendly regards Christoph P. "Harmon S. Nine" wrote: > > Hi. I'm trying to install grub on a hard-drive image that is in my /tmp > directory in Debian Linux. > I construct the image by first giving it 64 blocks (of 512 bytes each), > which are meant to act as the > MBR and a blank area where e2fs_stage1_5 can be installed. > > In the "MBR", I place a bunch of zeroes in the first 446 bytes, then a > phony 64B partition table, and then > the aa55 signature. > > The phony partition table consists of all zeroes, except for the first > entry. The first entry states that the first > "partition" starts at block 64 (i.e. after the 64 blocks described > above), is of type "linux" (i.e. 0x83), and contains > however many blocks are needed by the filesystem that the partition will > contain for this particular hard-drive > image. Importantly, since the hard-drive image has no "geometry" to > speak of, I fill in the > start and end head-sector-cylinder entries with zeroes. Thus, the first > partition-table entry in the > hard-drive image looks like this (bytes are labeled -- BT = bootable, SH > = Start Head, etc.): > > BT:00 SH:00 SS:00 SC:00 PT:83 EH:00 ES:00 EC:00 SB:40 00 00 00 > NB:79 44 00 00 > > I then add however many blocks the partition is stated to have (here > 0x00004479) to the hard-drive image, > and place a filesystem and the needed files in these blocks (a loopback > device is used to do this). > > I then run "/sbin/grub", with results shown below. Up to the "install" > command, grub is quite happy with the > image, and e2fs_stage1_5 is embedded at the proper location. > Unfortunately, stage1 doesn't > want to install (I also tried --force-lba). > > What can I do about this? > > TIA > > -- Harmon S. Nine > > -------------------- OUTPUT ---------------- > GRUB version 0.90 (640K lower / 3072K upper memory) > > [ Minimal BASH-like line editing is supported. For the first word, TAB > lists possible command completions. Anywhere else TAB lists the possible > completions of a device/filename. ] > > grub> device (hd0) /tmp/HDIMAGE-ktGUc2 > > grub> root (hd0,0) > Filesystem type is ext2fs, partition type 0x83 > > grub> setup (hd0) > Checking if "/boot/grub/stage1" exists... yes > Checking if "/boot/grub/stage2" exists... yes > Checking if "/boot/grub/e2fs_stage1_5" exists... yes > Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are > embedded. succeeded > Running "install /boot/grub/stage1 d (hd0) (hd0)1+16 p > (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... failed > > Error 22: No such partition > > grub> > ---------------------END OUTPUT------------------- > > _______________________________________________ > Bug-grub mailing list > [EMAIL PROTECTED] > http://mail.gnu.org/mailman/listinfo/bug-grub -- ------------------------------------------------------- private: [EMAIL PROTECTED] company: [EMAIL PROTECTED] _______________________________________________ Bug-grub mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-grub
