Differences

This shows you the differences between two versions of the page.


mkfs.xfs [2015/06/04 17:46] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== mkfs.xfs ======
  
 +  * [[XFS]]
 +  * [[mount]]
 +  * [[xfs_info]]
 +
 +  * [[http://oss.sgi.com/projects/xfs/training/xfs_slides_04_mkfs.pdf|XFS Overview & Internals: mkfs]]
 +  * [[http://oss.sgi.com/projects/xfs/training/xfs_slides_05_mount.pdf|XFS Overview & Internals: mount]]
 +  * [[http://oss.sgi.com/projects/xfs/training/xfs_lab_02_mkfs.pdf|XFS Practical Exercises: mkfs & mount]]
 +
 +Creating an XFS filesystem can use a partition or the logical device directly.
 +
 +<code>
 +mkfs.xfs /dev/sda1
 +mkfs.xfs /dev/sdb
 +</code>
 +
 +Do a dry-run and see what filesystem attributes it would set:
 +
 +<code>
 +mkfs.xfs -N /dev/sda1
 +</code>
 +
 +If the device already has another filesystem, mkfs will stop.  You can safely force it to run:
 +
 +<code>
 +mkfs.xfs -Nf /dev/sda1
 +</code>
 +
 +==== Performance ====
 +
 +For the sake of clarity (and not making mistakes) when using additional arguments, use ''mkfs.xfs -d name=/dev/sda'' syntax when creating filesystems instead of ''mkfs.xfs /dev/sda''
 +
 +=== External Log ===
 +
 +The journal log can be put on a separate device to improve performance.
 +
 +<code>
 +mkfs.xfs -d name=/dev/sda -l logdev=/dev/sdb
 +mount -o logdev=/dev/sdb /dev/sda /mnt/xfs
 +</code>
 +
 +=== External Metadata ===
 +
 +In addition to having the journal log on a separate device, the metadata and file data can be split up as well.
 +
 +Create the new XFS filesystem and separate log journal at the same time:
 +
 +<code>
 +mkfs.xfs -d name=/dev/sda -l logdev=/dev/sdb -r rtdev=/dev/sdc
 +mount -o logdev=/dev/sdb,rtdev=/dev/sdc /dev/sda /mnt/xfs
 +</code>
 +
 +=== Internal Log Block Sizes ===
 +
 +In both cases, the logdev option will want a block size.  See ''man mkfs.xfs'' for syntax, suggestions.
 +
 +Alternatively, see what ''mkfs.xfs'' would use by default, and use that:
 +
 +<code>
 +mkfs.xfs -Nf -d name=/dev/sda
 +</code>
 +
 +<code>
 +meta-data=/dev/sda               isize=256    agcount=4, agsize=524288 blks
 +                               sectsz=512   attr=2, projid32bit=1
 +                               crc=0        finobt=0
 +data                           bsize=4096   blocks=2097152, imaxpct=25
 +                               sunit=0      swidth=0 blks
 +naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
 +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
 +</code>
 +
 +<code>
 +mkfs.xfs -d name=/dev/sda -l logdev=/dev/sdb,size=2560b
 +</code>

Navigation
QR Code
QR Code mkfs.xfs (generated for current page)