All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinz Mauelshagen <mauelsha@ez-darmstadt.telekom.de>
To: adilger@enel.ucalgary.ca
Cc: linux-lvm@msede.com, mge@u9ete.ez-darmstadt.telekom.de
Subject: Re: [linux-lvm] lvm-0.6, Linux 2.2.9
Date: Fri, 25 Jun 1999 10:48:51 METDST	[thread overview]
Message-ID: <199906250851.AA10655@mailgate1b.telekom.de> (raw)
In-Reply-To: <199906250609.AAA09300@webber.adilger.net>; from "Andreas Dilger" at Jun 25, 99 12:09 (midnight)

> 
> Rolf writes:
> > thanks for the link. Maybe we should bring the code to the author of
> > ext2resize. A combination of both approaches may be what we are (or at
> > least I am) looking for.
> 
> I had a closer look at the ext2-volume code today.  There are two parts -
> 1) a program (e2extend) to take a newly mke2fs'd device and increment the
>    inode block numbers and the group descriptor block counts in the new
>    device by the number of blocks in the original fs.
> 2) a kernel patch to ext2 code which will handle the fact that we need to
>    look at multiple devices when accessing different parts of the fs.  One
>    interesting thing is that it never modifies the original fs data, only
>    the in-kernel representation by totalling the blocks, groups, inodes
>    as each extension filesystem is mounted...  It may do something in
>    addition to this but I couldn't see it.
> 
> What I don't understand (since I haven't really looked at ext2 internals
> before), is what is different about the above scheme compared to running
> "mke2fs -S" on the LVM-enlarged LV?  According to Theodore, the "mke2fs -S"
> method will corrupt the fs if it is enlarged past a 250MB? boundary because
> an ext2 sturcture (superblock?, bitmap?, anyone know?) will grow and
> overwrite other data on the filesystem.

It's the block group descriptor table (GDT).

A block group descriptor is a structure 32 bytes in size to describe
the location of block bitmap, inode bitmaps, inode tables and so on
(see /usr/src/linux/include/linux/ext2_fs.h;
 definition of struct ext2_group_desc)

If you have a regular block size of 1k, 32 of these fit into one block.
Groups have a size of 8m --> 8M times 32 = 256M.
IOW: "ext2fs size in megabyte module 256m + 1" equals the amount of
     block group descriptor blocks at mke2fs time.

So...

If you want to resize an ext2fs which is smaller than 256M to a size > 256M
you have to play around remapping the structures which follow the group
descriptor block like inodes etc.
Same remapping stuff takes place with n * 256M (n=1 to verybig 8*) )
resizing start sizes.

> 
> I haven't yet looked at ext2resize to see what it does to overcome this
> issue,

AFAI saw it does remapping.

> and I don't know enough about ext2 to know what it is myself.
> Otherwise, 90% of the ext2-volume patch to the kernel can be discarded
> because LVM makes the enlarged LV appear to be a single device to the
> kernel, and "all" we need to do is have mke2fs create only the ext2
> structures on the newly extended part of the LV, and then go back to
> the ext2 superblock(s) to update the data there.  According to
> ext_update_summary() in the ext2-multi-device.diff we would need to update:
> blocks_count, free_blocks_count, r_blocks_count, free_inodes_count,
> inodes_count, groups_count
> in the superblock, and then remount the filesystem.  There are no doubt
> issues about flushing in-kernel fs metadata to disk before we update the
> on-disk structures.  It may be better to update the in-kernel metadata
> like the ext2-volume patch does, and then when the filesystem is unmounted
> (or remounted?) it will update the data on disk, or we could force a flush
> to disk somehow.
> 

Good ideas.

More people out there to dig into this?


Regards,
Heinz

--

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Systemmanagement C/S                             Deutsche Telekom AG
                                                 Entwicklungszentrum Darmstadt
Heinz Mauelshagen                                Otto-Roehm-Strasse 71c
Senior Systems Engineer                          Postfach 10 05 41
                                                 64205 Darmstadt
mge@ez-darmstadt.telekom.de                      Germany
                                                 +49 6151 886-425
                                                          FAX-386
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  reply	other threads:[~1999-06-25  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-25  6:09 [linux-lvm] lvm-0.6, Linux 2.2.9 Andreas Dilger
1999-06-25  8:48 ` Heinz Mauelshagen [this message]
     [not found] <199906180613.AAA27434@webber.adilger.net>
1999-06-18 19:06 ` Rolf Jakob
1999-06-21 17:51   ` Andreas Dilger
1999-06-23  0:26     ` Rolf Jakob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199906250851.AA10655@mailgate1b.telekom.de \
    --to=mauelsha@ez-darmstadt.telekom.de \
    --cc=adilger@enel.ucalgary.ca \
    --cc=linux-lvm@msede.com \
    --cc=mge@u9ete.ez-darmstadt.telekom.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.