linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Vineet Agarwal <checkout.vineet@gmail.com>
Cc: rishi agrawal <postrishi@gmail.com>,
	linux-ext4@vger.kernel.org, listar@nl.linux.org
Subject: Re: merging of two file system
Date: Mon, 28 Jul 2008 16:04:39 -0400	[thread overview]
Message-ID: <20080728200439.GL9378@mit.edu> (raw)
In-Reply-To: <425904320807281211y517f8847rc93cfa6a3a13aac3@mail.gmail.com>

On Tue, Jul 29, 2008 at 12:41:25AM +0530, Vineet Agarwal wrote:
> yeah i meant that we have to separate filesystems,
> stored for example on /dev/hda1 and /dev/hda2, and we want to combine
> the data in the two filesystems into a single filesystem /dev/hda3, or
> combining the contents of /dev/hda2 so that it is also in /dev/hda1
> 
> so is there any mechanism exist to do so either online or offline . please help

There is no direct way to do this.

How big are the filesystems involved?  The standard and easist way to
do this would be to copy /dev/hda2 to another device, then if
/dev/hda1 was created with on-line resizing inode, expanding /dev/hda1
to fill the space taken by /dev/hda2, and then simply use "cp" to copy
the contents that had previously been in /dev/hda2 into the filesystem
on /dev/hda1.

In theory it would be possible to write a program would take to
adjacent filesystems, and map out where the blocks would be once the
two partitions were combined, and then relocate blocks to make a
single filesystem.  No one has done such a thing, however, for any
filesytem.  It is definitely not a trivial thing to do, but it is not
impossible; it's not that different from some of what an off-line
resize2fs operations does, albeit maybe 3-4 times more complex.

The main thing is that no one has ever taken the time to do such a
thing, because except for truly large filesystems, it's cheaper just
to get an extra disk drive, and just copy the contents off, and then
recreate the filesystem.

							- Ted

  reply	other threads:[~2008-07-28 20:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-27 16:05 merging of two file system Vineet Agarwal
2008-07-27 22:52 ` Theodore Tso
2008-07-28 18:59   ` SandeepKsinha
     [not found]   ` <5feb302e0807281147y7362a227kb7d37d713be05296@mail.gmail.com>
2008-07-28 19:11     ` Vineet Agarwal
2008-07-28 20:04       ` Theodore Tso [this message]
2008-08-07 12:33         ` Goswin von Brederlow
2008-08-08  5:47           ` Vineet Agarwal
2008-07-27 23:19 ` Shehjar Tikoo
2008-08-07 12:12   ` Goswin von Brederlow
  -- strict thread matches above, loose matches on Subject: below --
2008-07-27 11:18 Vineet Agarwal
2008-07-27 22:51 ` Theodore Tso

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=20080728200439.GL9378@mit.edu \
    --to=tytso@mit.edu \
    --cc=checkout.vineet@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=listar@nl.linux.org \
    --cc=postrishi@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).