{"id":4234,"date":"2015-02-14T23:53:08","date_gmt":"2015-02-14T15:53:08","guid":{"rendered":"http:\/\/rmohan.com\/?p=4234"},"modified":"2015-02-15T00:40:21","modified_gmt":"2015-02-14T16:40:21","slug":"centos-fedora-rhel-7-xfs-file-system","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=4234","title":{"rendered":"CENTOS , FEDORA , RHEL  7 XFS FILE SYSTEM"},"content":{"rendered":"<p><strong>XFS File System<\/strong><\/p>\n<p>What is XFS?<\/p>\n<p>XFS is a highly scalable, high-performance file journalling file system which was originally designed at Silicon Graphics, Inc in 1993. Originally XFS was used on Silicon Graphics Inc&#8217;s own operating system Irix, however, it was later ported to the Linux kernel in 2001. Today XFS is supported by most Linux distributions and has now become the default filesystem on RHEL (Red Hat Enterprise Linux), Oracle Linux 7, CentOS 7 and many other distributions. Originally XFS was created to support extremely large filesystems with sizes of up to 16 exabytes and file sizes of up to 8 exabytes.<\/p>\n<p>XFS supports metadata journalling allowing for quicker recovery after a system crash. The XFS file system can also be de-fragmented and enlarged while mounted and active. The XFS file system can not be reduced in size !<\/p>\n<p>XFS features the following allocation schemes:<\/p>\n<p>Extent based allocation<br \/>\nStripe-aware allocation policies<br \/>\nDelayed allocation<br \/>\nSpace pre-allocation<br \/>\nDelayed allocation and other performance optimizations affect XFS the same way that they do ext4. Namely, a program&#8217;s writes to a an XFS file system are not guaranteed to be on-disk unless the program issues an fsync() call afterwards.<\/p>\n<p>The XFS file system also supports the following:<\/p>\n<p>Extended attributes (xattr), which allows the system to associate several additional name\/value pairs per file.<br \/>\nQuota journalling, which avoids the need for lengthy quota consistency checks after a crash.<br \/>\nProject\/directory quotas, allowing quota restrictions over a directory tree.<br \/>\nSubsecond timestamps<\/p>\n<p>Creating a XFS File System<\/p>\n<p>To create a XFS file system, you can use the command mkfs.xfs \/dev\/device.<\/p>\n<p>When using mkfs.xfs on a block device containing an existing file system, you should use the -f option to force an overwrite of that file system.<\/p>\n<p>Below is an example of the mkfs.xfs command being issued on a CentOS 7 server. Once the command has run successfully,<\/p>\n<p>we issued the mount command. In this example, we are using a mount point of &#8220;xfs_test&#8221;.<\/p>\n<p>This was created by issuing the command &#8220;mkdir \/xfs_test&#8221;. (see output below)<\/p>\n<p>fdisk -l \/dev\/sdb<\/p>\n<p>Disk \/dev\/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors<br \/>\nUnits = sectors of 1 * 512 = 512 bytes<br \/>\nSector size (logical\/physical): 512 bytes \/ 512 bytes<br \/>\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<br \/>\nDisk label type: dos<br \/>\nDisk identifier: 0xf478ffab<\/p>\n<p>Device Boot\u00a0\u00a0\u00a0\u00a0\u00a0 Start\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 End\u00a0\u00a0\u00a0\u00a0\u00a0 Blocks\u00a0\u00a0 Id\u00a0 System<br \/>\n\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2048\u00a0\u00a0\u00a0 41943039\u00a0\u00a0\u00a0 20970496\u00a0\u00a0 83\u00a0 Linux<\/p>\n<p>Disk \/dev\/mapper\/centos-swap: 4294 MB, 4294967296 bytes, 8388608 sectors<br \/>\nUnits = sectors of 1 * 512 = 512 bytes<br \/>\nSector size (logical\/physical): 512 bytes \/ 512 bytes<br \/>\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<\/p>\n<p>Disk \/dev\/mapper\/centos-root: 38.1 GB, 38126223360 bytes, 74465280 sectors<br \/>\nUnits = sectors of 1 * 512 = 512 bytes<br \/>\nSector size (logical\/physical): 512 bytes \/ 512 bytes<br \/>\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<\/p>\n<p>[root@centos7server ~]# mkfs.xfs \/dev\/sdb1<br \/>\nmeta-data=\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=4, agsize=1310656 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=5242624, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal log\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=2560, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nrealtime =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<\/p>\n<p>mkdir \/xfs_test<\/p>\n<p>[root@centos7server ~]# mkdir \/xfs_test<br \/>\n[root@centos7server ~]# mount \/dev\/sdb1 \/xfs_test<br \/>\n[root@centos7server ~]# df -TH<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/centos-root xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 39G\u00a0 1.1G\u00a0\u00a0 38G\u00a0\u00a0 3% \/<br \/>\ndevtmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devtmpfs\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev\/shm<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0 9.0M\u00a0 3.0G\u00a0\u00a0 1% \/run<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 521M\u00a0 147M\u00a0 374M\u00a0 29% \/boot<br \/>\n\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 22G\u00a0\u00a0 34M\u00a0\u00a0 22G\u00a0\u00a0 1% \/xfs_test<\/p>\n<p>Using LVM (Logical Volume Manager) to add space to an XFS file system<\/p>\n<p>Generally to increase space you would use LVM (Logical Volume Manager. In the following example we will create a partition with a type of &#8220;8e&#8221; which denotes LVM. We will create a PV with the pvcreate command, create a VolumeGroup and define a LV. Next we will generate an XFS filesystem on the Logical Volume. For more information regarding LVM, follow the LVM link: Introduction to LVM<\/p>\n<p>An overview of the basic process involved can be seen below:<\/p>\n<p>Create a Partition using fdisk<\/p>\n<p>In this example, we are going to create a partition using the disk partitioning tool &#8220;fdisk&#8221;. The commands used to create the partition can be seen in the output below:<\/p>\n<p>[root@centos7server ~]# fdisk \/dev\/sdb<br \/>\nWelcome to fdisk (util-linux 2.23.2).<\/p>\n<p>Changes will remain in memory only, until you decide to write them.<br \/>\nBe careful before using the write command.<\/p>\n<p>Command (m for help): n<br \/>\nPartition type:<br \/>\np\u00a0\u00a0 primary (0 primary, 0 extended, 4 free)<br \/>\ne\u00a0\u00a0 extended<br \/>\nSelect (default p): p<br \/>\nPartition number (1-4, default 1): 1<br \/>\nFirst sector (2048-41943039, default 2048):<br \/>\nUsing default value 2048<br \/>\nLast sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):<br \/>\nUsing default value 41943039<br \/>\nPartition 1 of type Linux and of size 20 GiB is set<\/p>\n<p>Command (m for help): t<br \/>\nSelected partition 1<br \/>\nHex code (type L to list all codes): 8e<br \/>\nChanged type of partition &#8216;Linux&#8217; to &#8216;Linux LVM&#8217;<\/p>\n<p>Command (m for help): w<br \/>\nThe partition table has been altered!<\/p>\n<p>Calling ioctl() to re-read partition table.<br \/>\nSyncing disks.<br \/>\n[root@centos7server ~]#<\/p>\n<p>Create Logical Volume Manager Components: PV, VG and LV<\/p>\n<p>Our next step is to create a Physical Volume comprising of the \/dev\/sdb1 partition.<br \/>\nNext we then create a Volume Group called &#8220;vg01&#8221; and finally we create a Logical Volume that will use all available space within our Volume Group.<br \/>\nThe commands issued can be seen in the output below:<\/p>\n<p>[root@centos7server ~]# pvcreate \/dev\/sdb1<br \/>\nWARNING: xfs signature detected on \/dev\/sdb1 at offset 0. Wipe it? [y\/n] y<br \/>\nWiping xfs signature on \/dev\/sdb1.<br \/>\nPhysical volume &#8220;\/dev\/sdb1&#8221; successfully created<br \/>\n[root@centos7server ~]# vgcreate vg01 \/dev\/sdb1<br \/>\nVolume group &#8220;vg01&#8221; successfully created<br \/>\n[root@centos7server ~]# lvcreate -n lv01 -l 100%VG vg01<br \/>\nLogical volume &#8220;lv01&#8221; created<br \/>\n[root@centos7server ~]#<br \/>\n[root@centos7server ~]# pvs<br \/>\nPV\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 VG\u00a0\u00a0\u00a0\u00a0 Fmt\u00a0 Attr PSize\u00a0 PFree<br \/>\n\/dev\/sda2\u00a0 centos lvm2 a&#8211;\u00a0 39.51g\u00a0\u00a0\u00a0 0<br \/>\n\/dev\/sdb1\u00a0 vg01\u00a0\u00a0 lvm2 a&#8211;\u00a0 20.00g\u00a0\u00a0\u00a0 0<br \/>\n[root@centos7server ~]# vgs<br \/>\nVG\u00a0\u00a0\u00a0\u00a0 #PV #LV #SN Attr\u00a0\u00a0 VSize\u00a0 VFree<br \/>\ncentos\u00a0\u00a0 1\u00a0\u00a0 2\u00a0\u00a0 0 wz&#8211;n- 39.51g\u00a0\u00a0\u00a0 0<br \/>\nvg01\u00a0\u00a0\u00a0\u00a0 1\u00a0\u00a0 1\u00a0\u00a0 0 wz&#8211;n- 20.00g\u00a0\u00a0\u00a0 0<br \/>\n[root@centos7server ~]# lvs<br \/>\nLV\u00a0\u00a0 VG\u00a0\u00a0\u00a0\u00a0 Attr\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 LSize\u00a0 Pool Origin Data%\u00a0 Move Log Cpy%Sync Convert<br \/>\nroot centos -wi-ao&#8212;- 35.51g<br \/>\nswap centos -wi-ao&#8212;-\u00a0 4.00g<br \/>\nlv01 vg01\u00a0\u00a0 -wi-a&#8212;&#8211; 20.00g<br \/>\n[root@centos7server ~]#<\/p>\n<p>[root@centos7server ~]# mkfs.xfs \/dev\/vg01\/lv01<br \/>\nmeta-data=\/dev\/vg01\/lv01\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=4, agsize=1310464 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=5241856, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal log\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=2560, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nrealtime =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<br \/>\n[root@centos7server ~]#<\/p>\n<p>[root@centos7server ~]# mount \/dev\/vg01\/lv01 \/xfs_test<br \/>\n[root@centos7server ~]# df -TH<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/centos-root xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 39G\u00a0 1.1G\u00a0\u00a0 38G\u00a0\u00a0 3% \/<br \/>\ndevtmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devtmpfs\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev\/shm<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0 9.0M\u00a0 3.0G\u00a0\u00a0 1% \/run<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 521M\u00a0 147M\u00a0 374M\u00a0 29% \/boot<br \/>\n\/dev\/mapper\/vg01-lv01\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 22G\u00a0\u00a0 34M\u00a0\u00a0 22G\u00a0\u00a0 1% \/xfs_test<\/p>\n<p>Attaching a new Disk for \/dev\/sdc<\/p>\n<p>Disk \/dev\/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors<br \/>\nUnits = sectors of 1 * 512 = 512 bytes<br \/>\nSector size (logical\/physical): 512 bytes \/ 512 bytes<br \/>\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<\/p>\n<p>[root@centos7server ~]# fdisk \/dev\/sdc<br \/>\nWelcome to fdisk (util-linux 2.23.2).<\/p>\n<p>Changes will remain in memory only, until you decide to write them.<br \/>\nBe careful before using the write command.<\/p>\n<p>Device does not contain a recognized partition table<br \/>\nBuilding a new DOS disklabel with disk identifier 0x3ea192fa.<\/p>\n<p>Command (m for help): n<br \/>\nPartition type:<br \/>\np\u00a0\u00a0 primary (0 primary, 0 extended, 4 free)<br \/>\ne\u00a0\u00a0 extended<br \/>\nSelect (default p): p<br \/>\nPartition number (1-4, default 1): 1<br \/>\nFirst sector (2048-41943039, default 2048):<br \/>\nUsing default value 2048<br \/>\nLast sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):<br \/>\nUsing default value 41943039<br \/>\nPartition 1 of type Linux and of size 20 GiB is set<\/p>\n<p>Command (m for help): w<br \/>\nThe partition table has been altered!<\/p>\n<p>Calling ioctl() to re-read partition table.<br \/>\nSyncing disks.<br \/>\n[root@centos7server ~]# fdisk \/dev\/sdc<br \/>\nWelcome to fdisk (util-linux 2.23.2).<\/p>\n<p>Changes will remain in memory only, until you decide to write them.<br \/>\nBe careful before using the write command.<\/p>\n<p>Command (m for help):<br \/>\nCommand (m for help):<br \/>\nCommand (m for help): p<\/p>\n<p>Disk \/dev\/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectors<br \/>\nUnits = sectors of 1 * 512 = 512 bytes<br \/>\nSector size (logical\/physical): 512 bytes \/ 512 bytes<br \/>\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<br \/>\nDisk label type: dos<br \/>\nDisk identifier: 0x3ea192fa<\/p>\n<p>Device Boot\u00a0\u00a0\u00a0\u00a0\u00a0 Start\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 End\u00a0\u00a0\u00a0\u00a0\u00a0 Blocks\u00a0\u00a0 Id\u00a0 System<br \/>\n\/dev\/sdc1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2048\u00a0\u00a0\u00a0 41943039\u00a0\u00a0\u00a0 20970496\u00a0\u00a0 83\u00a0 Linux<\/p>\n<p>Command (m for help): t<br \/>\nSelected partition 1<br \/>\nHex code (type L to list all codes): 8e<br \/>\nChanged type of partition &#8216;Linux&#8217; to &#8216;Linux LVM&#8217;<\/p>\n<p>Command (m for help): w<br \/>\nThe partition table has been altered!<\/p>\n<p>Calling ioctl() to re-read partition table.<br \/>\nSyncing disks.<\/p>\n<p>Create a new Physical Volume<\/p>\n<p>Next we create a new PV (Physical Volume using the device &#8220;\/dev\/sdc1&#8221;.<\/p>\n<p>[root@centos7server ~]# pvcreate \/dev\/sdc1<br \/>\nPhysical volume &#8220;\/dev\/sdc1&#8221; successfully created<\/p>\n<p>Add the new Physical Volume to an existing Volume Group<\/p>\n<p>Here we are adding our new space to the existing Volume Group &#8220;vg01&#8221;.<br \/>\nThis extra space will be then available to our Logical Volume. The command to add the new partition to our Volume Group is &#8220;vgextend&#8221;.<\/p>\n<p>Check PV and VG<\/p>\n<p>If we now issue the &#8220;pvs&#8221; and vgs&#8221; commands again, we will now see the new additions:<\/p>\n<p>[root@centos7server ~]# pvs<br \/>\nPV\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 VG\u00a0\u00a0\u00a0\u00a0 Fmt\u00a0 Attr PSize\u00a0 PFree<br \/>\n\/dev\/sda2\u00a0 centos lvm2 a&#8211;\u00a0 39.51g\u00a0\u00a0\u00a0\u00a0 0<br \/>\n\/dev\/sdb1\u00a0 vg01\u00a0\u00a0 lvm2 a&#8211;\u00a0 20.00g\u00a0\u00a0\u00a0\u00a0 0<br \/>\n\/dev\/sdc1\u00a0 vg01\u00a0\u00a0 lvm2 a&#8211;\u00a0 20.00g 20.00g<br \/>\n[root@centos7server ~]# vgs<br \/>\nVG\u00a0\u00a0\u00a0\u00a0 #PV #LV #SN Attr\u00a0\u00a0 VSize\u00a0 VFree<br \/>\ncentos\u00a0\u00a0 1\u00a0\u00a0 2\u00a0\u00a0 0 wz&#8211;n- 39.51g\u00a0\u00a0\u00a0\u00a0 0<br \/>\nvg01\u00a0\u00a0\u00a0\u00a0 2\u00a0\u00a0 1\u00a0\u00a0 0 wz&#8211;n- 39.99g 20.00g<\/p>\n<p>From the above &#8220;pvs&#8221; command we can see that the new PV has been added with 508MB of space. The &#8220;vgs&#8221; command is now indicating that there are now two Physical Volumes associated with the Volume Group &#8220;vg01&#8221;.<\/p>\n<p>Extend a Logical Volume<\/p>\n<p>To extend the Logical Volume, we are going to use the &#8220;lvextend command. In the example below we are extending the Logical Volume by 500MB. The file system will be automatically resized because we are using the &#8220;-r&#8221; option.<\/p>\n<p>[root@centos7server ~]# vgextend vg01 \/dev\/sdc1<br \/>\nVolume group &#8220;vg01&#8221; successfully extended<\/p>\n<p>[root@centos7server ~]# lvextend \/dev\/vg01\/lv01 -L +500M -r<br \/>\nPhase 1 &#8211; find and verify superblock&#8230;<br \/>\nPhase 2 &#8211; using internal log<br \/>\n&#8211; scan filesystem freespace and inode maps&#8230;<br \/>\n&#8211; found root inode chunk<br \/>\nPhase 3 &#8211; for each AG&#8230;<br \/>\n&#8211; scan (but don&#8217;t clear) agi unlinked lists&#8230;<br \/>\n&#8211; process known inodes and perform inode discovery&#8230;<br \/>\n&#8211; agno = 0<br \/>\n&#8211; agno = 1<br \/>\n&#8211; agno = 2<br \/>\n&#8211; agno = 3<br \/>\n&#8211; process newly discovered inodes&#8230;<br \/>\nPhase 4 &#8211; check for duplicate blocks&#8230;<br \/>\n&#8211; setting up duplicate extent list&#8230;<br \/>\n&#8211; check for inodes claiming duplicate blocks&#8230;<br \/>\n&#8211; agno = 0<br \/>\n&#8211; agno = 1<br \/>\n&#8211; agno = 2<br \/>\n&#8211; agno = 3<br \/>\nNo modify flag set, skipping phase 5<br \/>\nPhase 6 &#8211; check inode connectivity&#8230;<br \/>\n&#8211; traversing filesystem &#8230;<br \/>\n&#8211; traversal finished &#8230;<br \/>\n&#8211; moving disconnected inodes to lost+found &#8230;<br \/>\nPhase 7 &#8211; verify link counts&#8230;<br \/>\nNo modify flag set, skipping filesystem flush and exiting.<br \/>\nExtending logical volume lv01 to 20.48 GiB<br \/>\nLogical volume lv01 successfully resized<br \/>\nmeta-data=\/dev\/mapper\/vg01-lv01\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=4, agsize=1310464 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=5241856, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=2560, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nrealtime =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<br \/>\ndata blocks changed from 5241856 to 5369856<\/p>\n<p>[root@centos7server ~]# lvextend \/dev\/vg01\/lv01 -L +1000M -r<br \/>\nExtending logical volume lv01 to 21.95 GiB<br \/>\nLogical volume lv01 successfully resized<br \/>\nmeta-data=\/dev\/mapper\/vg01-lv01\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=5, agsize=1310464 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=5497856, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=2560, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nrealtime =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<br \/>\ndata blocks changed from 5497856 to 5753856<br \/>\n[root@centos7server ~]# df -TH<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/centos-root xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 39G\u00a0 1.1G\u00a0\u00a0 38G\u00a0\u00a0 3% \/<br \/>\ndevtmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devtmpfs\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev\/shm<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0 9.0M\u00a0 3.0G\u00a0\u00a0 1% \/run<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 521M\u00a0 147M\u00a0 374M\u00a0 29% \/boot<br \/>\n\/dev\/mapper\/vg01-lv01\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 24G\u00a0\u00a0 34M\u00a0\u00a0 24G\u00a0\u00a0 1% \/xfs_test<\/p>\n<p>[root@centos7server ~]# lvextend \/dev\/vg01\/lv01 -L +1000M -r<br \/>\nPhase 1 &#8211; find and verify superblock&#8230;<br \/>\nPhase 2 &#8211; using internal log<br \/>\n&#8211; scan filesystem freespace and inode maps&#8230;<br \/>\nsb_fdblocks 5367272, counted 5751272<br \/>\n&#8211; found root inode chunk<br \/>\nPhase 3 &#8211; for each AG&#8230;<br \/>\n&#8211; scan (but don&#8217;t clear) agi unlinked lists&#8230;<br \/>\n&#8211; process known inodes and perform inode discovery&#8230;<br \/>\n&#8211; agno = 0<br \/>\n&#8211; agno = 1<br \/>\n&#8211; agno = 2<br \/>\n&#8211; agno = 3<br \/>\n&#8211; agno = 4<br \/>\n&#8211; process newly discovered inodes&#8230;<br \/>\nPhase 4 &#8211; check for duplicate blocks&#8230;<br \/>\n&#8211; setting up duplicate extent list&#8230;<br \/>\n&#8211; check for inodes claiming duplicate blocks&#8230;<br \/>\n&#8211; agno = 0<br \/>\n&#8211; agno = 1<br \/>\n&#8211; agno = 2<br \/>\n&#8211; agno = 3<br \/>\n&#8211; agno = 4<br \/>\nNo modify flag set, skipping phase 5<br \/>\nPhase 6 &#8211; check inode connectivity&#8230;<br \/>\n&#8211; traversing filesystem &#8230;<br \/>\n&#8211; traversal finished &#8230;<br \/>\n&#8211; moving disconnected inodes to lost+found &#8230;<br \/>\nPhase 7 &#8211; verify link counts&#8230;<br \/>\nNo modify flag set, skipping filesystem flush and exiting.<br \/>\nFilesystem check failed.<\/p>\n<p>[root@centos7server ~]# xfs_growfs \/dev\/vg01\/lv01<br \/>\nxfs_growfs: \/dev\/vg01\/lv01 is not a mounted XFS filesystem<br \/>\n[root@centos7server ~]# df -TH<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/centos-root xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 39G\u00a0 1.1G\u00a0\u00a0 38G\u00a0\u00a0 3% \/<br \/>\ndevtmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devtmpfs\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev\/shm<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0 9.1M\u00a0 3.0G\u00a0\u00a0 1% \/run<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 521M\u00a0 147M\u00a0 374M\u00a0 29% \/boot<br \/>\n[root@centos7server ~]# mount \/dev\/vg01\/lv01 \/xfs_test\/<br \/>\n[root@centos7server ~]#<br \/>\n[root@centos7server ~]# xfs_growfs \/dev\/vg01\/lv01<br \/>\nmeta-data=\/dev\/mapper\/vg01-lv01\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=5, agsize=1310464 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=5753856, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=2560, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nrealtime =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<\/p>\n<p>[root@centos7server ~]# df -TH<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/centos-root xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 39G\u00a0 1.1G\u00a0\u00a0 38G\u00a0\u00a0 3% \/<br \/>\ndevtmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devtmpfs\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev\/shm<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0 9.1M\u00a0 3.0G\u00a0\u00a0 1% \/run<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 521M\u00a0 147M\u00a0 374M\u00a0 29% \/boot<br \/>\n\/dev\/mapper\/vg01-lv01\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 24G\u00a0\u00a0 34M\u00a0\u00a0 24G\u00a0\u00a0 1% \/xfs_test<\/p>\n<p>[root@centos7server ~]# lvextend \/dev\/vg01\/lv01 -L +1000M -r<br \/>\nExtending logical volume lv01 to 22.93 GiB<br \/>\nLogical volume lv01 successfully resized<br \/>\nmeta-data=\/dev\/mapper\/vg01-lv01\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=5, agsize=1310464 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=5753856, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=2560, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nrealtime =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<br \/>\ndata blocks changed from 5753856 to 6009856<br \/>\n[root@centos7server ~]# xfs_growfs \/dev\/vg01\/lv01<br \/>\nmeta-data=\/dev\/mapper\/vg01-lv01\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=5, agsize=1310464 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=6009856, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=2560, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nrealtime =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<br \/>\n[root@centos7server ~]# df -TH<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/centos-root xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 39G\u00a0 1.1G\u00a0\u00a0 38G\u00a0\u00a0 3% \/<br \/>\ndevtmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devtmpfs\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/dev\/shm<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0 9.1M\u00a0 3.0G\u00a0\u00a0 1% \/run<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 3.0G\u00a0\u00a0\u00a0\u00a0 0\u00a0 3.0G\u00a0\u00a0 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 521M\u00a0 147M\u00a0 374M\u00a0 29% \/boot<br \/>\n\/dev\/mapper\/vg01-lv01\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 25G\u00a0\u00a0 34M\u00a0\u00a0 25G\u00a0\u00a0 1% \/xfs_test<\/p>\n<p>We can now see from the above output that we have 2.5GB of space now available to our xfs file system.<\/p>\n<p>Important: You can not reduce a XFS filesystem, if you try you will get the following message:<\/p>\n<p>[root@centos7server ~]# lvreduce \/dev\/vg01\/lv01 -L -500M -r<br \/>\nfsadm: Xfs filesystem shrinking is unsupported<br \/>\nfsadm failed: 1<br \/>\nFilesystem resize failed.<br \/>\n[root@centos7server ~]#<\/p>\n<p>Method 2 for extending a XFS File System using the utility xfs_growfs<\/p>\n<p>The following method allows you to extend the file system by using the &#8220;xfs_growfs&#8221; command. The xfs_growfs command is used to increase the size of a mounted XFS file system only if there is space on the underlying devices to accommodate the change. The xfs_growfs command does not require LVM to extend the file system as per the previous example.<\/p>\n<p>The mount point argument that is passed is the pathname to the directory where the filesystem is mounted. The xfs filesystem must be mounted first before it can be grown. The contents of the file system are undisturbed, and the added space is then made available for additional file storage.<\/p>\n<p>In the following example I am using a CentOS 7 server running in VirtualBox. Initially the disk used &#8220;\/dev\/sdb&#8221; is set to a size of 500MB. Our next step is to then create a XFS file system by issuing the &#8220;mkfs.xfs&#8221; command. The resulting file system can be seen after issuing the &#8220;df -hT&#8221; command. (The -h option displays a human readable format in MB, GB etc.. and the -T option displays the type of file system (XFS in this example).<\/p>\n<p>After the file system was initially created, I then increased the size of the underlying disk by using the following VirtualBox command:<\/p>\n<p>VBoxManage modifyhd &#8220;\/home\/mohan\/VirtualBox VMs\/CentOS_7\/CentOS7_XFS_Test1.vdi&#8221; &#8211;resize 2048<\/p>\n<p>An outline of the steps involved for this example are below:<\/p>\n<p>Create xfs file system on a 500MB Disk<\/p>\n<p>Create the xfs file system using the &#8220;mkfs.xfs&#8221; command:<\/p>\n<p>[root@centos07a \/]# mkfs.xfs \/dev\/sdb1<br \/>\nmeta-data=\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=4, agsize=32000 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=128000, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal log\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=853, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nreal-time =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<\/p>\n<p>Mount File System<\/p>\n<p>Next we need to mount the file system using the mount command (syntax: mount \/dev\/device \/mount_point)<\/p>\n<p>[root@centos07a \/]# mount \/dev\/sdb1 xfs_test\/<\/p>\n<p>Display XFS File System information<\/p>\n<p>We can use the &#8220;df&#8221; command again to look at the size of our mounted xfs file system:<\/p>\n<p>[root@centos07a \/]# df -hT<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/centos-root xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6.7G\u00a0 1.1G\u00a0 5.7G\u00a0 16% \/<br \/>\ndevtmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devtmpfs\u00a0 492M\u00a0\u00a0\u00a0\u00a0 0\u00a0 492M\u00a0\u00a0 0% \/dev<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 498M\u00a0\u00a0\u00a0\u00a0 0\u00a0 498M\u00a0\u00a0 0% \/dev\/shm<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 498M\u00a0 6.6M\u00a0 491M\u00a0\u00a0 2% \/run<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 498M\u00a0\u00a0\u00a0\u00a0 0\u00a0 498M\u00a0\u00a0 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 497M\u00a0 100M\u00a0 398M\u00a0 20% \/boot<br \/>\n\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 497M\u00a0\u00a0 26M\u00a0 472M\u00a0\u00a0 6% \/xfs_test<\/p>\n<p>We can now see that our file system is mounted at mount point \/xfs_test. You may wish to add your disk\/filesystem into &#8220;\/etc\/fstab&#8221; so that it will be automatically mounted at system reboot. To do this, simply add a line similar to the one below into the file &#8220;\/etc\/fstab&#8221;.<\/p>\n<p>Example \/etc\/fstab entry<\/p>\n<p>\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/xfs_test\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0 defaults\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0 0<\/p>\n<p>Shutdown Partition and Increase underlying Disk size<\/p>\n<p>As we are using Oracle&#8217;s VirtualBox software, we need to shutdown the partition first to increase the under lying disk. The shutdown command &#8220;shutdown -h now&#8221; can be used to cleanly shutdown your partition. Unfortunately, VirtualBox only allows the disk to be increased when it is not in use. The following command will be issued from the host computer. The &#8220;host&#8221; computer is the computer that is running the VirtualBox software.<\/p>\n<p>VirtualBox &#8211; Increase Disk Size<\/p>\n<p>The following command is issued to the host computer.<\/p>\n<p>$ VBoxManage modifyhd &#8220;\/home\/mohan\/VirtualBox VMs\/CentOS_7\/CentOS7_XFS_Test1.vdi&#8221; &#8211;resize 2048<br \/>\n0%&#8230;10%&#8230;20%&#8230;30%&#8230;40%&#8230;50%&#8230;60%&#8230;70%&#8230;80%&#8230;90%&#8230;100%<\/p>\n<p>The above command has now resized the virtual disk &#8220;CentOS7_XFS_Test1.vdi&#8221; to a size of 2GB. Notice the double quotes around the path name. Double quotes are needed as there are spaces within the path name name. If you are unsure of the name of the Virtualdisk that you created originally for your partition, you can &#8220;right click&#8221; on the name of your VM in the VirtualBox manager and select the option to &#8220;Show in file manager&#8221;. Here you will see a list of all the virtual disks that have been allocated to your server.<\/p>\n<p>Restart Server and Delete Original Partition<\/p>\n<p>Once we have increased the under lying disk space, we will need to restart our server. Next we are going to use fdisk to delete our original partition and then recreate it again with more space. The disk in the example is known as &#8220;\/dev\/sdb&#8221;.<\/p>\n<p>Below are the steps taken using fdisk to accomplish the above task.<\/p>\n<p>[root@centos07a \/]# umount \/xfs_test<\/p>\n<p>[root@centos07a \/]# fdisk \/dev\/sdb<br \/>\nWelcome to fdisk (util-linux 2.23.2).<\/p>\n<p>Changes will remain in memory only, until you decide to write them.<br \/>\nBe careful before using the write command.<\/p>\n<p>Command (m for help): p<\/p>\n<p>Disk \/dev\/sdb: 2147 MB, 2147483648 bytes, 4194304 sectors<br \/>\nUnits = sectors of 1 * 512 = 512 bytes<br \/>\nSector size (logical\/physical): 512 bytes \/ 512 bytes<br \/>\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<br \/>\nDisk label type: dos<br \/>\nDisk identifier: 0x340b4c69<\/p>\n<p>Device Boot\u00a0\u00a0\u00a0\u00a0\u00a0 Start\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 End\u00a0\u00a0\u00a0\u00a0\u00a0 Blocks\u00a0\u00a0 Id\u00a0 System<br \/>\n\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2048\u00a0\u00a0\u00a0\u00a0 1026047\u00a0\u00a0\u00a0\u00a0\u00a0 512000\u00a0\u00a0 83\u00a0 Linux<\/p>\n<p>Command (m for help): d<br \/>\nSelected partition 1<br \/>\nPartition 1 is deleted<\/p>\n<p>Command (m for help): n<br \/>\nPartition type:<br \/>\np\u00a0\u00a0 primary (0 primary, 0 extended, 4 free)<br \/>\ne\u00a0\u00a0 extended<br \/>\nSelect (default p): p<br \/>\nPartition number (1-4, default 1):<br \/>\nFirst sector (2048-4194303, default 2048):<br \/>\nUsing default value 2048<br \/>\nLast sector, +sectors or +size{K,M,G} (2048-4194303, default 4194303):<br \/>\nUsing default value 4194303<br \/>\nPartition 1 of type Linux and of size 2 GiB is set<\/p>\n<p>Command (m for help): w<br \/>\nThe partition table has been altered!<\/p>\n<p>Calling ioctl() to re-read partition table.<br \/>\nSyncing disks.<\/p>\n<p>Remount xfs File System<\/p>\n<p>Before we can increase a xfs file system, it needs to be mounted first.<\/p>\n<p>[root@centos07a \/]# mount \/dev\/sdb1 \/xfs_test<\/p>\n<p>We can issue the &#8220;df&#8221; command again to display our file system information.<\/p>\n<p>[root@centos07a \/]# df -hT<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/centos-root xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6.7G\u00a0 1.1G\u00a0 5.7G\u00a0 16% \/<br \/>\ndevtmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devtmpfs\u00a0 492M\u00a0\u00a0\u00a0\u00a0 0\u00a0 492M\u00a0\u00a0 0% \/dev<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 498M\u00a0\u00a0\u00a0\u00a0 0\u00a0 498M\u00a0\u00a0 0% \/dev\/shm<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 498M\u00a0 6.6M\u00a0 491M\u00a0\u00a0 2% \/run<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 498M\u00a0\u00a0\u00a0\u00a0 0\u00a0 498M\u00a0\u00a0 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 497M\u00a0 100M\u00a0 398M\u00a0 20% \/boot<br \/>\n\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 497M\u00a0\u00a0 26M\u00a0 472M\u00a0\u00a0 6% \/xfs_test<\/p>\n<p>From the above we can see that the file system on &#8220;xfs_test&#8221; is still indicating its original size.<\/p>\n<p>Issue xfs_growfs against mount point<\/p>\n<p>Next we are going to issue the &#8220;xfs_growfs&#8221; command:<\/p>\n<p>[root@centos07a \/]# xfs_growfs xfs_test\/<br \/>\nmeta-data=\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=4, agsize=32000 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=128000, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=853, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nreal-time =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<br \/>\ndata blocks changed from 128000 to 524032<\/p>\n<p>The important information to look for when you issue this command can be found within the last line of the output. You are looking for an increase in size relating to data blocks. We can now issue the &#8220;df&#8221; command again to verify that the xfs_growfs command was successful:<\/p>\n<p>[root@centos07a \/]# df -hT<br \/>\nFilesystem\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Type\u00a0\u00a0\u00a0\u00a0\u00a0 Size\u00a0 Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/centos-root xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 6.7G\u00a0 1.1G\u00a0 5.7G\u00a0 16% \/<br \/>\ndevtmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 devtmpfs\u00a0 492M\u00a0\u00a0\u00a0\u00a0 0\u00a0 492M\u00a0\u00a0 0% \/dev<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 498M\u00a0\u00a0\u00a0\u00a0 0\u00a0 498M\u00a0\u00a0 0% \/dev\/shm<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 498M\u00a0 6.6M\u00a0 491M\u00a0\u00a0 2% \/run<br \/>\ntmpfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tmpfs\u00a0\u00a0\u00a0\u00a0 498M\u00a0\u00a0\u00a0\u00a0 0\u00a0 498M\u00a0\u00a0 0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 497M\u00a0 100M\u00a0 398M\u00a0 20% \/boot<br \/>\n\/dev\/sdb1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 xfs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2.0G\u00a0\u00a0 26M\u00a0 2.0G\u00a0\u00a0 2% \/xfs_test<\/p>\n<p>This time we can see that the file system is now 2GB in size.<\/p>\n<p>Overview of Options that can be passed to the xfs_growfs utility<\/p>\n<p>SYNOPSIS<br \/>\nxfs_growfs\u00a0 [\u00a0 -dilnrx\u00a0 ] [ -D size ] [ -e rtextsize ] [ -L size ] [ -m<br \/>\nmaxpct ] [ -t mtab ] [ -R size ] mount-point<br \/>\nxfs_growfs -V<\/p>\n<p>xfs_info [ -t mtab ] mount-point<br \/>\nxfs_info -V<\/p>\n<p>Options that can be passed to the xfs_growfs utility<\/p>\n<p>d | -D size<\/p>\n<p>The &#8220;-d or -D&#8221; option is used to specify that the data section of the filesystem should be grown. If the &#8220;-D&#8221; size option is passed, then the data section is grown to the specified size. The &#8220;-d&#8221; option specifies that the data section is grown to the largest possible size. The size is specified in file system blocks.<\/p>\n<p>-e<\/p>\n<p>Allows the real-time extent size to be specified. This can also be specified with the mkfs.xfs command with the specified option of &#8220;-r extsize=nnnn&#8221;.<\/p>\n<p>-l | -L size<\/p>\n<p>Specifies that the log section of the filesystem should be grown, shrunk, or moved. If the -L size option is given, the log section is changed to be that size, if possible. The size is expressed in file system blocks. The size of an internal log must be smaller than the size of an allocation group (this value is printed at mkfs time). If neither -i nor -x is given with -l, the log continues to be internal or external as it was before. [NOTE: These options are not implemented]<\/p>\n<p>-m<\/p>\n<p>Specify a new value for the maximum percentage of space in the file system that can be allocated as inodes. In mkfs.xfs(8) this is specified with -i maxpct=nn.<\/p>\n<p>-n<\/p>\n<p>Specifies that no change to the filesystem is to be made. The file system geometry is printed, and argument checking is performed, but no growth occurs.<\/p>\n<p>-r | -R size<\/p>\n<p>Specifies that the real time section of the file system should be grown. If the -R size option is given, the real time section is grown to that size, otherwise the real time section is grown to the largest size possible with the -r option. The size is expressed in filesystem blocks. The filesystem does not need to have contained a real time section before the xfs_growfs operation.<\/p>\n<p>-t<\/p>\n<p>Specifies an alternate mount table file.<\/p>\n<p>-V<\/p>\n<p>Prints the version number and exits. The mount point argument is not required with -V.<\/p>\n<p>Summary of resizing a XFS file system<\/p>\n<p>Although both of the methods used allowed you to increase the size of the XFS file system. Neither of the methods allowed us to reduce the size. The most common method of resizing a file system is to use the LVM (Logical Volume Manager) approach. LVM gives you the advantage of being able to add additional disk easily to an existing Volume Group and then use the lvextend command to increase the size of your filesystem.<\/p>\n<p>Overview of other xfs Utilities<\/p>\n<p>Repairing a XFS File System with xfs_repair<\/p>\n<p>Basic Syntax:<\/p>\n<p>xfs_repair \/dev\/device<\/p>\n<p>The xfs_repair utility is designed to repair file systems whether small or large very quickly. Unlike other file system repair tools, xfs_repair does not run at system boot time. xfs_repair replays its logs at mount time to ensure a consistent file system. If xfs_repair encounters a dirty log, then it will not be able to repair the file system. To rectify the file system, you will need to first clear the relevant log, mount and then unmount the xfs file system. You may use the option &#8220;-L&#8221; to force log zeroing if the log file is corrupt and can not be replayed successfully. The command to issue for zeroing the log is as follows:<\/p>\n<p>xfs_repair -L \/dev\/device<\/p>\n<p>For full details regarding the xfs_repair utility, please consult the relevant man pages: man xfs_repair<\/p>\n<p>XFS Quota Management &#8211; xfs_quota<\/p>\n<p>xfs_quota gives the administrator the ability to manage limits on disk space. XFS quotas can control or report usage on users, groups or directory project level. XFS quotas are enabled at mount time. You may specify the &#8220;noenforce&#8221; option which allows reporting of usage, however, it does not enforce any limits. For full details of XFS quotas see the relevant man page: man xfs_quota<\/p>\n<p>Suspending a XFS File System with xfs_freeze<\/p>\n<p>The command to suspend access or resume write activity to a xfs file system is &#8220;xfs_freeze&#8221;. Generally this option is used for suspending write activity thus allowing hardware based device snapshots to be used to capture the file system in a consistent state.<\/p>\n<p>The xfs_freeze utility is provided by the package &#8220;xfsprogs&#8221;, note, this is only available to x86_64 architecture.<\/p>\n<p>To freeze a XFS file system the basic syntax is:<\/p>\n<p>xfs_freeze -f \/mount\/point<\/p>\n<p>The -f flag requests that the specified XFS filesystem should be set to a state of frozen, immediately stopping any modifications from being made. When this option is selected, all ongoing transactions in the file system are allowed to complete. Any new write system calls are halted.<\/p>\n<p>To unfreeze a XFS file system the basic syntax is:<\/p>\n<p>xfs_freeze -u \/mount\/point<\/p>\n<p>The -u flag is used to unfreeze the file system and allow operations to continue again. Any file system modifications that were blocked by the freeze option are unblocked and allowed to complete.<\/p>\n<p>If you are taking a LVM snapshot, then it is not necessary to run the &#8220;xfs_freeze&#8221; utility as the LVM utility will automatically suspend the relevant xfs file system.<\/p>\n<p>You can also use the &#8220;xfs_freeze&#8221; utility to freeze or unfreeze an ext3, ext4 and btrfs, file system.<\/p>\n<p>xfs_copy<\/p>\n<p>Copy the contents of a XFS file system. xfs_copy should only be used to copy unmounted file systems, read-only mounted file systems, or file systems that have been frozen with the xfs_freeze utility. The basic syntax of the utility is as follows:<\/p>\n<p>xfs_copy [ -bd ] [ -L log ] source target1 [ target2 &#8230; ]<\/p>\n<p>OPTIONS<br \/>\n-d\u00a0\u00a0\u00a0\u00a0 Create a duplicate (true clone) filesystem. This should be done<br \/>\nonly if the new filesystem will be used as a replacement for the<br \/>\noriginal filesystem (such as in the case of disk replacement).<\/p>\n<p>-b\u00a0\u00a0\u00a0\u00a0 The buffered option can be\u00a0 used\u00a0 to ensure direct IO is not<br \/>\nattempted to any of the target files. This is\u00a0 useful\u00a0 when\u00a0 the<br \/>\nfilesystem holding the target file does not support direct IO.<\/p>\n<p>-L log Specifies\u00a0 the\u00a0 location\u00a0 of\u00a0 the log if the default location of<br \/>\n\/var\/tmp\/xfs_copy.log.XXXXXX is not desired.<\/p>\n<p>-V\u00a0\u00a0\u00a0\u00a0 Prints the version number and exits.<\/p>\n<p>xfs_fsr &#8211; File System re-organizer for XFS<\/p>\n<p>The &#8220;xfs_fsr&#8221; utility is used to defragment mounted XFS file systems. The reorganization algorithm operates on one file at a time, compacting or otherwise improving the layout of the file extents (contiguous blocks of file data). When invoked with out any arguments, xfs_fsr will defragment all regular files in all mounted xfs file systems. xfs_fsr uses the file &#8220;\/etc\/mtab&#8221; as its source of mounted file systems. The xfs_fsr utility also allows a user to suspend a defragmentation process at a specified time and then resume from where it last left off. The current position of the defragmentation process is stored in the file:<\/p>\n<p>\/var\/tmp\/.fsrlast_xfs<\/p>\n<p>xfs_fsr can also be invoked to work with a single file:<\/p>\n<p>xfs_fsr \/path\/to\/file<\/p>\n<p>When xfs_fsr is invoked, it will require sufficient free space to be available as each file is copied to a temporary location whilst it is processed. A warning message will be displayed if sufficient space is not available.<\/p>\n<p>xfs_bmap<\/p>\n<p>Prints the map of disk blocks used by files in an XFS filesystem. The map lists each extent used by the file, as well as regions in the file with no corresponding blocks.<\/p>\n<p>Each line of the listing takes the following form: extent: [startoffset..endoffset]: startblock..endblock<\/p>\n<p>[root@centos07a xfs_test]# xfs_bmap test.file<br \/>\ntest.file:<br \/>\n0: [0..7]: 96..103<\/p>\n<p>[root@centos07a xfs_test]# xfs_bmap -v test.file<br \/>\ntest.file:<br \/>\nEXT: FILE-OFFSET\u00a0\u00a0\u00a0\u00a0\u00a0 BLOCK-RANGE\u00a0\u00a0\u00a0\u00a0\u00a0 AG AG-OFFSET\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TOTAL<br \/>\n0: [0..7]:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 96..103\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0 (96..103)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8<\/p>\n<p>For further information regarding this utility, please consult the relevant man page: man xfs_bmap<\/p>\n<p>xfs_info<\/p>\n<p>To view your XFS file system information, the command &#8220;xfs_info&#8221; can be issued:<\/p>\n<p>[root@centos07a \/]# xfs_info \/dev\/sdc1<br \/>\nmeta-data=\/dev\/sdc1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 isize=256\u00a0\u00a0\u00a0 agcount=17, agsize=32704 blks<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 attr=2, projid32bit=1<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 crc=0<br \/>\ndata\u00a0\u00a0\u00a0\u00a0 =\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=524032, imaxpct=25<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sunit=0\u00a0\u00a0\u00a0\u00a0\u00a0 swidth=0 blks<br \/>\nnaming\u00a0\u00a0 =version 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 ascii-ci=0 ftype=0<br \/>\nlog\u00a0\u00a0\u00a0\u00a0\u00a0 =internal\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize=4096\u00a0\u00a0 blocks=853, version=2<br \/>\n=\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sectsz=512\u00a0\u00a0 sunit=0 blks, lazy-count=1<br \/>\nreal-time =none\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 extsz=4096\u00a0\u00a0 blocks=0, rtextents=0<\/p>\n<p>xfs_admin<\/p>\n<p>The xfs_admin command allows an administrator to changes parameters of a XFS file system. The xfs_admin utility can only modify parameters of unmounted devices\/file systems. (Mounted devices can not be modified).<\/p>\n<p>For a full list of parameters that can be changed, please consult the relevant man page: man xfs_admin<br \/>\nxfs_metadump<\/p>\n<p>xfs_metadump is a debugging tool that copies XFS file system metadata to a file. The xfs_metadump utility should only be used to copy unmounted, read-only, or frozen\/suspended file systems; otherwise, generated dumps could be corrupted or inconsistent. For a full list of available option please consult the relevant man page: man xfs_metadump<\/p>\n<p>xfs_mdrestore<\/p>\n<p>xfs_mdrestore is used to restore a XFS metadump image to a filesystem image. The source argument specifies the location of the metadump image and the target argument specifies the destination for the filesystem image. The target can be either a file or a device.<\/p>\n<p>xfs_mdrestore [ -g ] source target<\/p>\n<p>The &#8220;-g&#8221; parameter shows the restore progress on stdout.<\/p>\n<p>xfs_db<\/p>\n<p>A utility that can be used to debug a XFS file system. For further information, please consult the relevant man page: man xfs_db.<\/p>\n<p>xfs_estimate<\/p>\n<p>The xfs_estimate utility is used to estimate the amount of space that a xfs file system will take.<\/p>\n<p>[root@centos07a xfs_test]# xfs_estimate \/var\/tmp<br \/>\n\/var\/tmp will take about 4.4 megabytes<\/p>\n<p>[root@centos07a xfs_test]# xfs_estimate -v \/var\/tmp<br \/>\ndirectory\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 bsize\u00a0\u00a0 blocks\u00a0\u00a0\u00a0 megabytes\u00a0\u00a0\u00a0 logsize<br \/>\n\/var\/tmp\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4096\u00a0\u00a0\u00a0\u00a0 1138\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4.4MB\u00a0\u00a0\u00a0 4096000<\/p>\n<p>xfs_estimate parameters:<\/p>\n<p>[root@centos07a xfs_test]# xfs_estimate -h<br \/>\nUsage: xfs_estimate [opts] directory [directory &#8230;]<br \/>\n-b blocksize (fundamental filesystem blocksize)<br \/>\n-i logsize (internal log size)<br \/>\n-e logsize (external log size)<br \/>\n-v prints more verbose messages<br \/>\n-V prints version and exits<br \/>\n-h prints this usage message<\/p>\n<p>Note:\u00a0\u00a0 \u00a0blocksize may have &#8216;k&#8217; appended to indicate x1024<br \/>\nlogsize may also have &#8216;m&#8217; appended to indicate (1024 x 1024)<\/p>\n<p>xfs_mkfile<\/p>\n<p>xfs_mkfile is used to create a xfs file. The file is padded with zeroes by default. The default size is in bytes, but it can be flagged as kilobytes, blocks, megabytes, or gigabytes with the k, b, m, or g suffixes respectively.<\/p>\n<p>Syntax: xfs_mkfile [ -v ] [ -n ] [ -p ] size[k|b|m|g] filename<\/p>\n<p>Options that can be passed:<\/p>\n<p>-v\u00a0\u00a0\u00a0\u00a0 Verbose. Report the names and sizes of the created files.<\/p>\n<p>-n\u00a0\u00a0\u00a0\u00a0 No bytes. Create a holey file &#8211; that is, do not write out any<br \/>\ndata, just seek to the end of the file and write a block.<\/p>\n<p>-p\u00a0\u00a0\u00a0\u00a0 Preallocate.\u00a0 The file is preallocated, then overwritten with<br \/>\nzeroes, it is then truncated to the desired size.<\/p>\n<p>-V\u00a0\u00a0\u00a0\u00a0 Prints the version number and exits.<\/p>\n<p>xfs_io<\/p>\n<p>xfs_io is a debugging tool similar to the utility xfs_db, but is aimed at examining the regular file I\/O paths rather than the raw XFS volume itself. For a full list of all the parameters\/options that can be passed, please consult the relevant man page: man xfs_io<\/p>\n<p>xfs_logprint<\/p>\n<p>xfs_logprint prints the log of a XFS file system. The device argument is the pathname of the partition or logical volume containing the filesystem. The device can be a regular file if the &#8220;-f&#8221; option is used. The contents of the file system remain undisturbed.<\/p>\n<p>There are two major modes of operation in xfs_logprint:<\/p>\n<p>One mode is better for filesystem operation debugging. It is called the transactional view and is enabled through the &#8220;-t&#8221; option. The transactional view prints only the portion of the log that pertains to recovery. In other words, it prints out complete transactions between the tail and the head. This view tries to display each transaction without regard to how they are split across log records.<\/p>\n<p>The second mode starts printing out information from the beginning of the log. Some error blocks might print out in the beginning because the last log record usually overlaps the oldest log record. A message is printed when the physical end of the log is reached and when the logical end of the log is reached. A log record view is displayed one record at a time. Transactions that span log records may not be decoded fully.<\/p>\n<p>Syntax: xfs_logprint [ options ] device<\/p>\n<p>Options that can be passed:<\/p>\n<p>-b\u00a0\u00a0\u00a0\u00a0 Extract and print buffer information. Only used in transactional<br \/>\nview.<\/p>\n<p>-c\u00a0\u00a0\u00a0\u00a0 Attempt to continue when an error is detected.<\/p>\n<p>-C filename<br \/>\nCopy\u00a0 the log from the filesystem to the file filename.\u00a0 The log<br \/>\nitself is not printed.<\/p>\n<p>-d\u00a0\u00a0\u00a0\u00a0 Dump the log from front to end, printing where each\u00a0 log\u00a0 record<br \/>\nis located on disk.<\/p>\n<p>-D\u00a0\u00a0\u00a0\u00a0 Do not decode anything; just print data.<\/p>\n<p>-e\u00a0\u00a0\u00a0\u00a0 Exit\u00a0 when\u00a0 an error is found in the log. Normally, xfs_logprint<br \/>\ntries to continue and unwind from bad logs.\u00a0 However,\u00a0 sometimes<br \/>\nit\u00a0 just\u00a0 dies\u00a0 in\u00a0 bad\u00a0 ways.\u00a0\u00a0 Using this option prevents core<br \/>\ndumps.<\/p>\n<p>-f\u00a0\u00a0\u00a0\u00a0 Specifies that the filesystem image to be processed is stored in<br \/>\na\u00a0 regular\u00a0 file at device (see the mkfs.xfs(8) -d file option).<br \/>\nThis might happen if an image copy of a filesystem has been made<br \/>\ninto an ordinary file with xfs_copy(8).<\/p>\n<p>-l logdev<br \/>\nExternal\u00a0 log\u00a0 device.\u00a0 Only\u00a0 for those filesystems which use an<br \/>\nexternal log.<\/p>\n<p>-i\u00a0\u00a0\u00a0\u00a0 Extract and print inode information. Only used in\u00a0 transactional<br \/>\nview.<\/p>\n<p>-q\u00a0\u00a0\u00a0\u00a0 Extract\u00a0 and print quota information. Only used in transactional<br \/>\nview.<\/p>\n<p>-n\u00a0\u00a0\u00a0\u00a0 Do not try and interpret log data;\u00a0 just\u00a0 interpret\u00a0 log\u00a0 header<br \/>\ninformation.<\/p>\n<p>-o\u00a0\u00a0\u00a0\u00a0 Also\u00a0 print\u00a0 buffer\u00a0 data in hex.\u00a0 Normally, buffer data is just<br \/>\ndecoded, so better information can be printed.<br \/>\n-s start-block<br \/>\nOverride any notion of where to start printing.<\/p>\n<p>-t\u00a0\u00a0\u00a0\u00a0 Print out the transactional view.<\/p>\n<p>-v\u00a0\u00a0\u00a0\u00a0 Print &#8220;overwrite&#8221; data.<\/p>\n<p>-V\u00a0\u00a0\u00a0\u00a0 Prints the version number and exits.<\/p>\n<p>xfs_rtcp<\/p>\n<p>xfs_rtcp copies a file to the real-time partition on a XFS file system. If there is more than one source and target, the final argument (the target) must be a directory which already exists.<\/p>\n<p>Syntax: xfs_rtcp [ -e extsize ] [ -p ] source &#8230; target<\/p>\n<p>Options that can be used:<\/p>\n<p>OPTIONS<br \/>\n-e extsize<br \/>\nSets the extent size of the destination real-time file.<\/p>\n<p>-p\u00a0\u00a0\u00a0\u00a0 Use\u00a0 if\u00a0 the\u00a0 size of the source file is not an even multiple of<br \/>\nthe block size of the destination filesystem. When -p is\u00a0 speci-<br \/>\nfied\u00a0 xfs_rtcp\u00a0 will pad the destination file to a size which is<br \/>\nan even multiple of the filesystem block size.\u00a0 This\u00a0 is\u00a0 neces-<br \/>\nsary since the real-time file is created using direct I\/O and the<br \/>\nminimum I\/O is the filesystem block size.<\/p>\n<p>-V\u00a0\u00a0\u00a0\u00a0 Prints the version number and exits.<\/p>\n<p>xfs_ncheck<\/p>\n<p>The utility xfs_ncheck is used to generate a list of inode numbers along with path names.<\/p>\n<p>Syntax: xfs_ncheck [ -i ino ] &#8230; [ -f ] [ -s ] [ -l logdev ] device<\/p>\n<p>Options:<\/p>\n<p>-f\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Specifies that the filesystem image to be processed is\u00a0 stored<br \/>\nin a regular file at device (see the mkfs.xfs -d file option).<br \/>\nThis might happen if an image copy of a\u00a0 filesystem\u00a0 has\u00a0 been<br \/>\nmade into an ordinary file.<\/p>\n<p>-l logdev<br \/>\nSpecifies\u00a0 the\u00a0 device\u00a0 where\u00a0 the\u00a0 filesystem&#8217;s\u00a0 external log<br \/>\nresides.\u00a0 Only for those filesystems\u00a0 which\u00a0 use\u00a0 an\u00a0 external<br \/>\nlog.\u00a0 See\u00a0 the\u00a0 mkfs.xfs\u00a0 -l option, and refer to xfs(5) for a<br \/>\ndetailed description of the XFS log.<\/p>\n<p>-s\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Limits the report to special files and\u00a0 files\u00a0 with\u00a0 setuserid<br \/>\nmode.\u00a0\u00a0 This\u00a0 option may be used to detect violations of secu-<br \/>\nrity policy.<\/p>\n<p>-i ino\u00a0\u00a0 Limits the report to only those files whose inode numbers fol-<br \/>\nlow.\u00a0\u00a0 May\u00a0 be\u00a0 given\u00a0 multiple times to select multiple inode<br \/>\nnumbers.<\/p>\n<p>-V\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Prints the version number and exits.<\/p>\n<p>xfsdump<\/p>\n<p>xfsdump is a file system incremental dump utility that is used in conjunction with xfsrestore. xfsdump backs up files and their attributes in a xfs file system. The files can be dumped to storage media, a regular file, or to standard output. Various dump options allow the administrator to create a full dump or an incremental dump. You may also specify a path to limit the files that are dumped.<\/p>\n<p>To use the xfsdump utility, you first have to install it. This can be easily achieved by issuing the following command:<\/p>\n<p>yum install xfsdump<\/p>\n<p>xfsrestore<\/p>\n<p>xfsrestore restores filesystems from dumps produced by xfsdump. For a full list of all available parameters and options available to xfsdump and xfsrestore, please consult the relevant man pages<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>XFS File System<\/p>\n<p>What is XFS?<\/p>\n<p>XFS is a highly scalable, high-performance file journalling file system which was originally designed at Silicon Graphics, Inc in 1993. Originally XFS was used on Silicon Graphics Inc&#8217;s own operating system Irix, however, it was later ported to the Linux kernel in 2001. Today XFS is supported by most [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,17,50],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4234"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4234"}],"version-history":[{"count":4,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4234\/revisions"}],"predecessor-version":[{"id":4238,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/4234\/revisions\/4238"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}