How to format a gluster brick using the same xfs parameters
Issue
In some scenarios we may want to reuse the bricks that belong to a gluster volume, and we need to recreate a new xfs filesystem on the existing brick using the same parameters as when the brick was initially created.
Note1 This document assume the data on the gluster volume is not valid, and that the gluster volume can be deleted.
Note2 The deletion of the volume does not destroy the data on the bricks.
Note3Formating the brick will destroy all the existing data on that brick.
On this example we will format brick1 of the following volume:
Volume Name: myvol
Type: Replicate
Volume ID: 33364d5d-de3d-4290-b73c-a2b344188432
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 3 = 3
Transport-type: tcp
Bricks:
Brick1: gluster-0:/mnt/data1/1
Brick2: gluster-1:/mnt/data1/1
Brick3: gluster-2:/mnt/data1/1
The brick filesystem based on device /dev/mapper/vg1-lv1
is mounted on /mnt/data1
as here:
[root@gluster-0 ~]# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg1-lv1 10418176 33956 10384220 1% /mnt/data1
If we try to format the brick with parameters that are not the same as the used initially to create the brick, we may get an error like this:
[root@gluster-0 ~]# mkfs.xfs -f -i size=512 -n size=8192 -d su=128k,sw=10 /dev/mapper/vg1-lv1
mkfs.xfs: Specified data stripe unit 256 is not the same as the volume stripe unit 512
mkfs.xfs: Specified data stripe width 2560 is not the same as the volume stripe width 512
meta-data=/dev/mapper/vg1-lv1 isize=512 agcount=16, agsize=162944 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=2607104, imaxpct=25
= sunit=32 swidth=320 blks
naming =version 2 bsize=8192 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=32 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@gluster-0 ~]#
Environment
Red Hat Gluster Storage 3.X
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.