Thursday, March 22, 2018

XFS


Few Points on XFS:


  • Default file system on RHEL 7
  • XFS is a highly-scalable 64-bit jounraling file system that can used on a single host.
  • It supports metadata journaling which means the crash recovery is quicker.
  • Even though we can grow an XFS file system online, it is not possible to shrink.
  • No file system check at boot time
  • Can go upto 500TB filesytems and 50TB files
  • Less cpu intensive

 

Some commands...

To create an XFS file system on a newly created logical volume:
# mkfs.xfs /dev/vgxx/lvxx

To grow an XFS file system:
# xfs_growfs /mount-point -D size

To label an xfs file system:
# xfs_admin -L "label" /dev/vgxx/lvxx

To show the label of an xfs file system:
# xfs_admin -l /dev/vgxx/lvxx

To repair an XFS file system (make sure the file system is unmounted before you run the below command):
# xfs_repair /dev/vgxx/lvxx

In case of dirty log, use the following command to clear the log.
# xfs_repair -L /dev/vgxx/lvxx

To freeze an xfs file system:
# xfs_freeze -f /mount/point

To unfreeze an XFS file system:
# xfs_freeze -u /mount/point

To show the file system information:
# xfs_info /dev/vgxx/lvxx

To do a full backup a xfs file system on a tape:
# xfsdump -l 0 -f /dev/st1 /data

Here "-l" means the level of backup. 0 always mean a full backup. You may replace it with the numbers from 1 to 9 which means an incremental backup.

To do a labelled full backup:
# xfsdump -l 0 -L "/data backup on 3rd March 2018" -f /dev/st1 /data

To list the backup labels on a tape:
# xfsrestore -I -f /dev/st0

To restore a xfs backup using a label a different location:
# xfsrestore -L "/data backup on 3rd March 2018" -f /dev/st1 /data-temp

To display quota:
# xfs_quota -x -c 'report -h' /data

To set the soft and hard data(block) quota (in MB) for a user:
# xfs_quota -x -c 'limit bsoft=500m bhard=900 mark' /data/

To set soft and hard inode quota for a group:
# xfs_quota -x -c 'limit -g isoft=1000 ihard=1500 dba' /data/

No comments: