5 Replies Latest reply on May 19, 2017 3:26 PM by Dude!

    Xfs management


      Hello everybody. I have a disk with xfs file system and it is quite big so i need to split it into two smaller xfs partitions. As i understand fdisk has nothing to do wht xfs. Could someone please give me a hand of help on the matter. I use :


      cat /etc/centos-release

      CentOS Linux release 7.3.1611 (Core)

        • 1. Re: Xfs management

          It depends what you need to accomplish. If you need to relocate existing data, you will essentially need to copy all files to another device, then erase and reparation the original device and copy the data back.


          If you "simply" need to resize your system disk:

          How to Resize LVM Root in Oracle Linux 7

          • 2. Re: Xfs management

            Thanks for replying. There is no lvm. and the disk partition is a brand new one. just want to separate different data

            • 3. Re: Xfs management

              Well, I can only know what you have or try to accomplish from the information you have provided.

              If you have a rather unusual task or setup, you will need to post more details. There is no command to split a device and file system. You will have to do it manually, for which more information will be required, such as:


              Is it a system disk? Do you need to relocate data? etc. etc.

              • 4. Re: Xfs management

                There is no information on the said disk at all. I fealt with lvm and extX before so i understand what you are writing about. I wand just remove fyle system and put there two partitions instead of one which is also should be xfs

                • 5. Re: Xfs management

                  If there's no data you need to save, then all you have to do is to re-partition the device and re-initialize the partitions with the filesystem you need.


                  You can do it with fdisk or parted. Since fdisk is an interactive tool and more complex to explain, I show you parted.


                  Open a terminal window and logon as root, or type the following into the server console.


                  Assuming the device name is sdb (your 2nd hard drive), create two partitions 50 % each, for example:


                  # parted -s /dev/sdb mklabel msdos mkpart primary 1 50%

                  # parted -s /dev/sdb mkpart primary 50% 100%


                  # parted -s /dev/sdb print

                  Number  Start   End     Size    Type     File system  Flags

                  1      1049kB  4106MB  4105MB  primary

                  2      4106MB  8212MB  4106MB  primary


                  Create the filesystems:


                  # mkfs.xfs /dev/sdb1

                  # mkfs.xfs /dev/sdb2


                  Then mount the filesystems:


                  # mkdir /home2 /home3

                  # mount /dev/sdb1 /home2

                  # mount /dev/sdb2 /home3



                  # df -h | grep sdb

                  /dev/sdb1                3.9G   33M  3.8G   1% /home2

                  /dev/sdb2                3.9G   33M  3.8G   1% /home3

                  1 person found this helpful