[Gluster-devel] Is it possible to turn an existing filesystem (with data) into a GlusterFS brick ?

Sander Eikelenboom linux at eikelenboom.it
Fri Nov 11 15:09:45 UTC 2016

Friday, November 11, 2016, 3:31:05 PM, you wrote:

> On Fri, Nov 11, 2016 at 6:24 PM, Saravanakumar Arumugam <sarumuga at redhat.com> wrote:

>  On 11/11/2016 06:03 PM, Sander Eikelenboom wrote:
>  L.S.,
>  I was wondering if it would be possible to turn an existing filesystem with data
>  (ext4 with files en dirs) into a GlusterFS brick ?
>  It is not possible, at least I am not aware about any such solution yet.
>  I can't find much info about it except the following remark at [1] which seems
>  to indicate it is not possible yet:
>          Data import tool
>          Create a tool which will allow importing already existing data in the brick
>          directories into the gluster volume.
>          This is most likely going to be a special rebalance process.
>  So that would mean i would always have to:
>  - first create an GlusterFS brick on an empty filesystem
>  - after that copy all the data into the mounted GlusterFS brick
>  - never ever copy something into the filesystem (or manipulate it otherwise)
>    used as a GlusterFS brick directly (without going through a GlusterFS client mount)
>  because there is no checking / healing between GlusterFS's view on the data and the data in the
>  underlying brick filesystem ?
>  Is this a correct view ?
>  you are right !
>  Once the data is copied into Gluster, it internally creates meta-data about data(file/dir).
>  Unless you copy it via Gluster mount point, it is NOT possible to create such meta-data.

> No, it is possible. You just need to be a bit creative.
> Could you let me know how many such bricks you have which you want to convert to glusterfs. It seems like you want replication as well. So if you give me all this information. With your help may be we can at least come up with a document on how this can be done.

Hi Saravanakumar,

Thanks for your swift reply.

Well the most achievable workflow to me seems:
1) Start with one filesystem already filled with data
2) Let glusterfs create a glusterfs volume with only that FS as brick
3) Have some tool scan that volume/brick and check / compare the filesystem data 
   with glusterfs metadata. And have a option to repair / generate the missing 
   (or wrong) glusterfs metadata based on the filesystem data
4) If whished for add other (empty) bricks 
5) Start the gluster volume and/or healing / replication

What seems to be missing is a tool for (3).
I think that could also be useful 
when trying to recover from total disaster (where glusterfs bricks are brokedown 
and you end up with lose bricks. At least you would be able to keep the 
filesystem data, remove the .glusterfs metadata dir. Then you can use low level 
filesystem tools and rebuild your glusterfs volume and brick inplace, instead of 
to move it out which could be difficult datasize wise.


>  Thanks,
>  Saravana

>  _______________________________________________
>  Gluster-devel mailing list
>  Gluster-devel at gluster.org
>  http://www.gluster.org/mailman/listinfo/gluster-devel

More information about the Gluster-devel mailing list