[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a patch for working with HDD images and for newer Intel cards
From: |
Sergey Babkin |
Subject: |
Re: a patch for working with HDD images and for newer Intel cards |
Date: |
Wed, 23 Apr 2003 11:06:30 -0400 |
address@hidden wrote:
>
> Sergey Babkin wrote:
> > Pádraig Brady wrote:
> >
> >>Sergey Babkin wrote:
> >>
> >>
> >>>Hi,
> >>>
> >>>I've been trying to create the images of hard disks with GRUB and
> >>>found that on Linux it wants to write to the partition as a separate
> >>>file. Which is not neccessary and just plain harmful in case if
> >>>I'm installing GRUB on a disk image. So I've made the attached a small
> >>>patch grub-0.91-hddimage.patch. The patch is made against a
> >>>Caldera-patched version of 0.91 but it applies fine to 0.93 too.
> >>>
> >>
> >>But what if the user has the partition(s) in the disk image (file)
> >>mounted seperately?
> >
> > How do you do that ? I'd like to do that too.
>
> losetup /dev/loop0 file.img
> mount -o loop,offset=123456 file.img /mnt/filesystem
>
> you can calculate the offset easily or
> use gpart to brute force it.
Thanks a lot! I did not know about that. I guess I should have read
the mount man page with more attention :-(
> > Now I just create the image of each parition separately, then
> > write these images into the image of the whole disk.
>
> I do that also, because of the bugs in linux wrt to
> the disc and filesystem caches not being coherent.
> Otherwise you have to sync all over the place.
> But my point is grub can't assume this.
I think that for an image this is not much of an issue: you can always
unmount the partition before running grub. BTW, I've found out
that sync does not help with the loopback devices: they don't write data
back into the image file on sync. The only way I know to get the image
synchronized is to unmount it.
-SB