bug-grub
[Top][All Lists]
Advanced

[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: P
Subject: Re: a patch for working with HDD images and for newer Intel cards
Date: Tue, 06 May 2003 11:08:45 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210

Yoshinori K. Okuji wrote:
At Wed, 23 Apr 2003 11:06:30 -0400,
Sergey Babkin wrote:

I think that for an image this is not much of an issue: you can always
unmount the partition before running grub.

I'm in favor of you, as the documentation clearly describes that you
should unmount drives.

Hmm I guess it does, pertinent bits from the docs:

"You must specify the option `--stage2' in the grub shell,
if you cannot unmount the filesystem where your stage2 file resides."

"If you can unmount drives to which GRUB may write any amount
of data, unmount them before running `grub'."

"If a drive cannot be unmounted but can be mounted with the
read-only flag, mount it in read-only mode. That should be secure."

"If a drive must be mounted with the read-write flag, make sure
that any activity is not being done on it during running the
command `grub'."

So I'd like to apply your patch. Pádraig, do you agree?

I don't agree with the patch as it treats files (disk images)
and disks differently which is confusing at best.
The exact same logic holds true for disks as files.
I.E. if you do try to open /dev/hda1 or /dev/loop1 for e.g.
in write_to_partition and it's already mounted then
disk corruption may occur.

I think the best approach is as currently documented and
implemented, with the extra validity checks in this patch:
http://www.iol.ie/~padraiga/patches/grub-0.93-write_to_partition.diff

Note also in principle I don't agree with the last documentation
point above. I.E. in what situations would you need a filesystem
mounted rw and also be sure the cache is coherent with the disk
and not being changed while grub is running. IMHO grub should
never open a mounted (rw) partition (on linux at least).
It would be nice if the linux kernel gave an error when you tried
to open(/dev/hda1,O_RDWR), but grub should probably work around
this by getting a list of mounted (rw) partitions that it can't open.

Pádraig.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]