Sunday, 15 December 2019

How to Create a XFS File System on CentOS 7



A file system provides control to store, retrieve and organization of data on storage.
This article describes How to Create a XFS File System on CentOS7. New hard disk added in the VM to create xfs file system. Make sure this will destroy all the data from the hard disk or partition.

Step 1. Partition List: Run the following command to list out partition to create xfs filesystem:

[root@linuxcnf ~]# lsblk
…………………………
sdd                    8:48   0    8G  0 disk
………………………….
[root@linuxcnf ~]#

Step 2. Create File System: Run the following command to create xfs file system on a hard disk/ disk partition:

[root@linuxcnf ~]# mkfs.xfs /dev/sdd
meta-data=/dev/sdd               isize=512    agcount=4, agsize=524288 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=2097152, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@linuxcnf ~]#

Step 3. Mount a File System: Run the following command to create a directory and mount a disk/ partition into the directory:

[root@linuxcnf ~]# mkdir -p /mnt/mountpoint
[root@linuxcnf ~]# mount /dev/sdd /mnt/mountpoint/
[root@linuxcnf ~]#

Step 4. Verification: Run the following command to verify the file system:

[root@linuxcnf ~]# df -hT
Filesystem              Type      Size  Used Avail Use% Mounted on
……………………………
/dev/sdd                xfs       8.0G   33M  8.0G   1% /mnt/mountpoint
[root@linuxcnf ~]#

Done!!! XFS file system successfully created and mounted on a directory.

No comments:

Post a comment