All of lore.kernel.org
 help / color / mirror / Atom feed
* mkfs command in grub
@ 2006-03-09 19:14 technologypages
  2006-03-10 21:44 ` Marco Gerards
  0 siblings, 1 reply; 11+ messages in thread
From: technologypages @ 2006-03-09 19:14 UTC (permalink / raw)
  To: grub-devel

Can someone please comment if adding filesystem creation support to grub 
is reasonable.

Please see the rationale at 
http://www.geocities.com/technologypages/grub-mkfs.txt

Will the developers consider adding this feature? It is rather easy to 
implement as far as I can see -- only glue for external filesystem 
creation code needs to be added.

Although the swap sharing use case discussed in the rationale is 
trivial, it is a common problem that may bring many multi-OS users over 
to GRUB 2 and create positive "media coverage" (if that feature will be 
added).



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
  2006-03-09 19:14 technologypages
@ 2006-03-10 21:44 ` Marco Gerards
  2006-03-11  9:10   ` Vesa Jääskeläinen
  2006-03-11 11:08   ` Yoshinori K. Okuji
  0 siblings, 2 replies; 11+ messages in thread
From: Marco Gerards @ 2006-03-10 21:44 UTC (permalink / raw)
  To: The development of GRUB 2

technologypages@yahoo.com writes:

> Can someone please comment if adding filesystem creation support to
> grub is reasonable.
>
> Please see the rationale at
> http://www.geocities.com/technologypages/grub-mkfs.txt
>
> Will the developers consider adding this feature? It is rather easy to
> implement as far as I can see -- only glue for external filesystem
> creation code needs to be added.

Personally I do not like glue code at all.  And creating the
filesystems like fat and swap is quite trivial, I think.

> Although the swap sharing use case discussed in the rationale is
> trivial, it is a common problem that may bring many multi-OS users
> over to GRUB 2 and create positive "media coverage" (if that feature
> will be added).

Right...

I think it is easy to implement this feature, and agree it might be
useful in the cases you described.  I wonder how the other developers
think about including such feature.

--
Marco




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
  2006-03-10 21:44 ` Marco Gerards
@ 2006-03-11  9:10   ` Vesa Jääskeläinen
  2006-03-11 11:08   ` Yoshinori K. Okuji
  1 sibling, 0 replies; 11+ messages in thread
From: Vesa Jääskeläinen @ 2006-03-11  9:10 UTC (permalink / raw)
  To: The development of GRUB 2

Marco Gerards wrote:
> technologypages@yahoo.com writes:
> 
>> Can someone please comment if adding filesystem creation support to
>> grub is reasonable.
>>
>> Please see the rationale at
>> http://www.geocities.com/technologypages/grub-mkfs.txt
>>
>> Will the developers consider adding this feature? It is rather easy to
>> implement as far as I can see -- only glue for external filesystem
>> creation code needs to be added.
> 
> Personally I do not like glue code at all.  And creating the
> filesystems like fat and swap is quite trivial, I think.
> 
>> Although the swap sharing use case discussed in the rationale is
>> trivial, it is a common problem that may bring many multi-OS users
>> over to GRUB 2 and create positive "media coverage" (if that feature
>> will be added).
> 
> Right...
> 
> I think it is easy to implement this feature, and agree it might be
> useful in the cases you described.  I wonder how the other developers
> think about including such feature.

Well, GRUB2 supports modules. I do not see anything wrong on supplying
mkfs<fs> module, but I would keep this out of normal file system code as
it might cause some problems with "normal" users breaking their HD
accidently.

If we one day have a GRUB rescue CD image we could include this and
perhaps other file system modification modules there.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
  2006-03-10 21:44 ` Marco Gerards
  2006-03-11  9:10   ` Vesa Jääskeläinen
@ 2006-03-11 11:08   ` Yoshinori K. Okuji
  2006-03-11 14:37     ` Marco Gerards
  1 sibling, 1 reply; 11+ messages in thread
From: Yoshinori K. Okuji @ 2006-03-11 11:08 UTC (permalink / raw)
  To: The development of GRUB 2

On Friday 10 March 2006 21:44, Marco Gerards wrote:
> I think it is easy to implement this feature, and agree it might be
> useful in the cases you described.  I wonder how the other developers
> think about including such feature.

For me, this kind of feature is an OS's task rather than a boot loader's. Boot 
loaders should concentrate on booting up operation systems, and the other 
tasks should be left to each operation system. Making a filesystem is not 
related to booting, since newly created filesystems contain no boot 
information.

Okuji



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
  2006-03-11 11:08   ` Yoshinori K. Okuji
@ 2006-03-11 14:37     ` Marco Gerards
  2006-03-11 20:28       ` Yoshinori K. Okuji
  0 siblings, 1 reply; 11+ messages in thread
From: Marco Gerards @ 2006-03-11 14:37 UTC (permalink / raw)
  To: The development of GRUB 2

"Yoshinori K. Okuji" <okuji@enbug.org> writes:

> On Friday 10 March 2006 21:44, Marco Gerards wrote:
>> I think it is easy to implement this feature, and agree it might be
>> useful in the cases you described.  I wonder how the other developers
>> think about including such feature.
>
> For me, this kind of feature is an OS's task rather than a boot loader's. Boot 
> loaders should concentrate on booting up operation systems, and the other 
> tasks should be left to each operation system. Making a filesystem is not 
> related to booting, since newly created filesystems contain no boot 
> information.

Unfortunately the rationale behind this idea was not in the original
email.

The main reason for this feature request was that swap space can be
shared between windows and GNU/Linux this way.  So you can make a fat
filesystem when booting windows and a swap filesystem when booting
GNU/Linux.  Although this is not something really important for us, I
do see the use of such feature.

--
Marco





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
  2006-03-11 14:37     ` Marco Gerards
@ 2006-03-11 20:28       ` Yoshinori K. Okuji
  2006-03-11 20:46         ` Marco Gerards
  0 siblings, 1 reply; 11+ messages in thread
From: Yoshinori K. Okuji @ 2006-03-11 20:28 UTC (permalink / raw)
  To: The development of GRUB 2

On Saturday 11 March 2006 14:37, Marco Gerards wrote:
> Unfortunately the rationale behind this idea was not in the original
> email.

I know.

> The main reason for this feature request was that swap space can be
> shared between windows and GNU/Linux this way.  So you can make a fat
> filesystem when booting windows and a swap filesystem when booting
> GNU/Linux.  Although this is not something really important for us, I
> do see the use of such feature.

So? Why does a boot loader have to deal with that? Is a swap partition 
creation critical for booting? Why don't you just make a swap partition in 
the boot process of each operation system and activate it? I really don't see 
this as a task for a boot loader.

Okuji



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
  2006-03-11 20:28       ` Yoshinori K. Okuji
@ 2006-03-11 20:46         ` Marco Gerards
  2006-03-12  0:03           ` Tomáš Ebenlendr
  2006-03-12 22:28           ` Yoshinori K. Okuji
  0 siblings, 2 replies; 11+ messages in thread
From: Marco Gerards @ 2006-03-11 20:46 UTC (permalink / raw)
  To: The development of GRUB 2

"Yoshinori K. Okuji" <okuji@enbug.org> writes:

>> The main reason for this feature request was that swap space can be
>> shared between windows and GNU/Linux this way.  So you can make a fat
>> filesystem when booting windows and a swap filesystem when booting
>> GNU/Linux.  Although this is not something really important for us, I
>> do see the use of such feature.
>
> So? Why does a boot loader have to deal with that? Is a swap partition 
> creation critical for booting? Why don't you just make a swap partition in 
> the boot process of each operation system and activate it? I really don't see 
> this as a task for a boot loader.

Heh, now I am defending a feature I don't really want, need or care
about myself.  It's just that the idea is not that bad, not that I
want it or so.

The problem of the person who proposed this, is that he can not change
some of his operating systems.  Which of course is a problem of
non-free software.

--
Marco







^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
  2006-03-11 20:46         ` Marco Gerards
@ 2006-03-12  0:03           ` Tomáš Ebenlendr
  2006-03-12 22:28           ` Yoshinori K. Okuji
  1 sibling, 0 replies; 11+ messages in thread
From: Tomáš Ebenlendr @ 2006-03-12  0:03 UTC (permalink / raw)
  To: The development of GRUB 2


On 11 Březen 2006, 21:46, Marco Gerards napsal(a):
> "Yoshinori K. Okuji" <okuji@enbug.org> writes:
>
>>> The main reason for this feature request was that swap space can be
>>> shared between windows and GNU/Linux this way.  So you can make a fat
>>> filesystem when booting windows and a swap filesystem when booting
>>> GNU/Linux.  Although this is not something really important for us, I
>>> do see the use of such feature.
>>
>> So? Why does a boot loader have to deal with that? Is a swap partition
>> creation critical for booting? Why don't you just make a swap partition
>> in
>> the boot process of each operation system and activate it? I really
>> don't see
>> this as a task for a boot loader.
>
> Heh, now I am defending a feature I don't really want, need or care
> about myself.  It's just that the idea is not that bad, not that I
> want it or so.
>
> The problem of the person who proposed this, is that he can not change
> some of his operating systems.  Which of course is a problem of
> non-free software.
>
> --
> Marco

But he can use swapfile that is already created on that filesystem for
linux. As windoze need no checksum or magic identifying a swapfile, he
needs only to run mkswap on that file on each boot. (This is the way I
solved this problem. But I think that windoze should support swap
partition, because I can't make them to stop displaying warnings about
small amount of free space on partition with swap file. Or I have lot of
unused space on that partition.)

-- 
                                            Tomas 'Ebi' Ebenlendr
                                            http://get.to/ebik




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
  2006-03-11 20:46         ` Marco Gerards
  2006-03-12  0:03           ` Tomáš Ebenlendr
@ 2006-03-12 22:28           ` Yoshinori K. Okuji
  1 sibling, 0 replies; 11+ messages in thread
From: Yoshinori K. Okuji @ 2006-03-12 22:28 UTC (permalink / raw)
  To: The development of GRUB 2

On Saturday 11 March 2006 20:46, Marco Gerards wrote:
> Heh, now I am defending a feature I don't really want, need or care
> about myself.  It's just that the idea is not that bad, not that I
> want it or so.

Interesting. :)

BTW, if one really wants to implement fancy partition manipulation features, 
the right way would be to use libparted. This was discussed for GRUB Legacy 
in the past, but I don't remember the conclusion.

Okuji



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
@ 2006-03-13 13:54 technologypages
  2006-03-28 16:04 ` Marco Gerards
  0 siblings, 1 reply; 11+ messages in thread
From: technologypages @ 2006-03-13 13:54 UTC (permalink / raw)
  To: grub-devel

Tomáš, unfortunately your solution to the swap sharing problem is 
suboptimal -- swapping through filesystem code to a file in a VFAT 
filesystem will quite likely be a order of magnitude slower than raw 
partition access. It's OK if you are a casual Linux user, but not 
acceptable if you are a casual Windows user like me :).

Okuji, it's a matter of theoretical purism vs pragmatical problem 
solving. As Marco already said, we can't change the behaviour of 
non-free software. Hence we need to manipulate the swap partition before 
booting Windows in this particular (and very common) use-case. Preparing 
the swap partition for Windows is possible from a Linux shutdown script, 
but this solution is fragile (one can imagine plenty of cases when the 
script will not be run), and is not really Linux's responsibility 
(preparing a partition for another OS). Which brings us back to the fact 
that in this particular case it is the bootloader's responsibility. I 
agree that this functionality should not be part of the core, but as 
GRUB 2 is supposedly modular (haven't seen the code though), it should 
be available as a module.

Could someone who knows the code please envisage what should be done in 
order to implement the mkfs module?



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: mkfs command in grub
  2006-03-13 13:54 mkfs command in grub technologypages
@ 2006-03-28 16:04 ` Marco Gerards
  0 siblings, 0 replies; 11+ messages in thread
From: Marco Gerards @ 2006-03-28 16:04 UTC (permalink / raw)
  To: The development of GRUB 2

technologypages@yahoo.com writes:

> Could someone who knows the code please envisage what should be done
> in order to implement the mkfs module?

First of all, I would not call the command mkfs.  Better just restrict
the functionality to swap, that can give you some assertions to begin
with.

First just have a look at the hello command and how it is implemented.
Have a look at hello.c, for example.  After that, study some of the
more fancy commands and how to read from and write to disk.

I think you can make a simple command like:

mkswap
 --linux-swap
 --fat

And an argument for the disk, so you can have:
mkswap --linux-swap (hd0,2)
or:
mkswap --fat (hd0,2)

I think creating the swap filesystem is rather trivial.  For linux
swap it might be just a single block you have to write.  For fat it is
just a few and this might be less trivial.

By assuming it is just used for swap, you can make sure mkswap can not
erase the wrong partition.  It happens that some BIOSes swap disk
numbers, you certainly do not want to erase data from the wrong disk.
So I think you can better check if it is a swap partition you are
erasing.  So either one of these two checks have to be true:

- The partition is linux swap.
- The partition is fat and has a certain label ("swap", for example).

I have no idea if this will work.  For example, you might have to
change the partition type too.

Besides all this, this is not a guarantee that if you implement such
feature, it will make it into GRUB.  But I am certainly willing to
answer your questions.

--
Marco




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-03-28 16:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-13 13:54 mkfs command in grub technologypages
2006-03-28 16:04 ` Marco Gerards
  -- strict thread matches above, loose matches on Subject: below --
2006-03-09 19:14 technologypages
2006-03-10 21:44 ` Marco Gerards
2006-03-11  9:10   ` Vesa Jääskeläinen
2006-03-11 11:08   ` Yoshinori K. Okuji
2006-03-11 14:37     ` Marco Gerards
2006-03-11 20:28       ` Yoshinori K. Okuji
2006-03-11 20:46         ` Marco Gerards
2006-03-12  0:03           ` Tomáš Ebenlendr
2006-03-12 22:28           ` Yoshinori K. Okuji

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.