Skip to content

Creating an XFS Partition

Steps for creating an XFS partition on /dev/sdc which encompasses the entire disk. (LVM is not used in this example. Post written using Scientific Linux 5.3, but should be relevant to any RHEL clone with XFS support.)

Partition the disk using fdisk; we want the standard Linux partition id of “83″, so no need to modify that here:

# /sbin/fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 1305.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1305, default 1): (press enter to accept default)
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1305, default 1305): (press enter to accept default)
Using default value 1305
Command (m for help): p
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 1305 10482381 83 Linux

On VMware, align the partition:

Command (m for help): x
Expert command (m for help): b
Partition number (1-4): 1
New beginning of data (63-83875364, default 63): 128

Write the partition table out to disk:


Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Format the partition as XFS, using the defaults:

# /sbin/mkfs.xfs /dev/sdc1
meta-data=/dev/sdc1 isize=256 agcount=16, agsize=163787 blks
= sectsz=512 attr=0
data = bsize=4096 blocks=2620592, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=4096
log =internal log bsize=4096 blocks=2560, version=1
= sectsz=512 sunit=0 blks, lazy-count=0
realtime =none extsz=4096 blocks=0, rtextents=0

The XFS partition is now set for use:

# mount /dev/sdc1 /depot

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*