5 Replies Latest reply on May 20, 2020 5:40 PM by Wagnerm25

    How to expand a OCFS2 filesystem

    Wagnerm25

      Dear friends,

       

      Since OCFS2 does not support LVM structure, how to expand a OCFS2 filesystem?

       

      Right now, we have the structure below:

       

      [root@SPDTEC01 /]# mounted.ocfs2 -f

      Device              Stack  Cluster  F  Nodes

      /dev/sdb            o2cb               spdtec02, spdtec01

      /dev/sdx            o2cb               spdtec02, spdtec01

      /dev/mapper/mpathx  o2cb               spdtec02, spdtec01

       

      Filesystem OCFS2 is named "deposito_new" as below:

       

      Filesystem                    Size  Used   Avail   Use%     Mounted on

      /dev/mapper/mpathx    2.1T  1.5T    601G    71%      /deposito_new

       

      Is a 2TB disk, shared with 2 servers. We need resize this OCFS2 filesystem by adding a new 2TB disk. I did a extense research over several docs, but I don't have a clear procedure to follow.

       

      We need to destroy current OCFS2 filesystem and rebuild with a 4TB disk? We can't add a new 2TB disk in current stucture?

       

      Thanks for any tip.

       

      Wagner

        • 1. Re: How to expand a OCFS2 filesystem
          Dude!

          Is a 2TB disk, shared with 2 servers.

          You mean a cluster with 2 nodes? Can you use OCFS2 for the purpose to share disk space between 2 servers without running a cluster?

           

          If you run a cluster you can't just be using a local hard drive. You need some storage controller that allows to share disk space. Most modern storage controllers allow to manage allocated storage space dynamically and increase the size of partitions or LUN's. Unless you use some conventional RAID solution which requires to re-initialize the storage.

           

          Creating OCFS2 volumes on logical volumes (LVM) is not supported, but why LVM, instead of resizing the storage at your storage controller? You can resize an OCFS2 volume using "tunefs.ocfs2 -S", but the volume must not be mounted by any node in the cluster.

          • 2. Re: How to expand a OCFS2 filesystem
            Wagnerm25

            Sorry.

             

            Yes, it's a storage LUN shared between a two servers cluster using OCFS2 filesystem. So, my two servers can see same files placed there.

             

            Based in your last paragraph, I need to unmount OCFS2 filesystem and them go to my Hitachi storage and resize the lun from 2TB to 4TB. Then, i need to run "tunefs.ocfs2 -S /dev/xxxx".

             

            That's all?

             

            Thanks for your patiente.

             

            Wagner

            • 3. Re: How to expand a OCFS2 filesystem
              Dude!

              Yep, as far as I know. As always, make a backup first.

              • 4. Re: How to expand a OCFS2 filesystem
                Wagnerm25

                Thanks,

                 

                I will try it and report here the results.

                 

                Thanks again

                • 5. Re: How to expand a OCFS2 filesystem
                  Wagnerm25

                  Here's the end of story.

                   

                  Our OCFS2 filesytem is mounted over a single 2TB Hitachi storage LUN.

                   

                  The LUN wich needed to be expanded from 2TB to 4TB were located in a storage disk pool which had no more space, so I can't resize it.

                   

                  Well... we did a backup of LUN data, unmount OCFS2 filesystem and (via hitachi software) we delete the LUN paths. Also we delete LUN multipath identifiers (multipath -f mpathXX).

                   

                  Then we choose another storage disk pool with sufficient space (4TB) and we create a new 4TB LUN. Map it to server and rebuild OCFS2 over this new LUN.

                   

                  Works fine.

                   

                  Thanks for tips DUDE!