User Tools

Site Tools


computing:storage:disk_partitioning

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computing:storage:disk_partitioning [2011/12/01 13:55]
gcooper
computing:storage:disk_partitioning [2014/05/05 23:41] (current)
gcooper
Line 1: Line 1:
 ====== Advanced Format (4K Sector) Drive Partitioning ====== ====== Advanced Format (4K Sector) Drive Partitioning ======
  
-This information is equally or more important for SSD's as it is for spinning hard drives.+:!: If in doubt or you just don't want to read this page, start your partition at **sector 2048** (''1MiB''). 
 + 
 +**Background**: https://www.ibm.com/developerworks/linux/library/l-linux-on-4kb-sector-disks/ 
 + 
 +**Great info**: http://petersmithphotog.no-ip.biz/wiki/index.php/Partition_Alignment 
 + 
 +:!: This information is equally or more important for SSD's as it is for spinning hard drives.
  
 ===== Partition Alignment and 4K Sector Disk Drives ===== ===== Partition Alignment and 4K Sector Disk Drives =====
Line 11: Line 17:
 There may also be a label on the drive advising that it is an Advanced Format drive. There may also be a label on the drive advising that it is an Advanced Format drive.
  
-**A simple rule to go by for creating properly aligned partitions:**+**A simple rule to go by for creating properly aligned partitions on AF drives:**
  
 Verify that every partition begins on a **sector** which is a multiple of 8.  If your partitioning tool is showing **bytes**, make sure the beginning is divisible by 4096, the new Advanced Format sector size. Verify that every partition begins on a **sector** which is a multiple of 8.  If your partitioning tool is showing **bytes**, make sure the beginning is divisible by 4096, the new Advanced Format sector size.
Line 24: Line 30:
       * Use ''unit s'' to set older parted to sector-based       * Use ''unit s'' to set older parted to sector-based
   * Start first partition at ''1M'' to assure proper alignment   * Start first partition at ''1M'' to assure proper alignment
 +      * ''1M'' equals ''2048s'' with 512-byte blocks
       * Additional partitions will also be aligned       * Additional partitions will also be aligned
   * Using the graphical ''gparted'', be sure to clear the "Round to cylinders" check box in the Create New Partition dialog box   * Using the graphical ''gparted'', be sure to clear the "Round to cylinders" check box in the Create New Partition dialog box
  
 **''fdisk''** still uses cylinder-based alignment and does not support GPT partition tables. **''fdisk''** still uses cylinder-based alignment and does not support GPT partition tables.
 +
 +  * Newer versions of ''fdisk'' default to using ''2048s'' as the starting point
 +      * Creates aligned partitions
 +      * Same default as newer Windows
  
 ===== Partitions over 2TB ===== ===== Partitions over 2TB =====
 +
 +http://rainbow.chard.org/2013/01/30/how-to-align-partitions-for-best-performance-using-parted/
 +
 +http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03479326&cc=us&dlc=en&lc=en
  
 http://www.ibm.com/developerworks/linux/library/l-gpt/ http://www.ibm.com/developerworks/linux/library/l-gpt/
  
 http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html http://www.cyberciti.biz/tips/fdisk-unable-to-create-partition-greater-2tb.html
 +
 +**For RAID arrays**: http://ubuntuforums.org/archive/index.php/t-1715375.html
  
 Install ''parted'' if it's not already installed: Install ''parted'' if it's not already installed:
Line 40: Line 57:
 yum install parted yum install parted
 </file> </file>
- 
  
 ==== Display Partitions ==== ==== Display Partitions ====
Line 72: Line 88:
 You can easily check for the correct alignment in ''parted'' by using the command You can easily check for the correct alignment in ''parted'' by using the command
  
 +<file>
 (parted) align-check opt 1 (parted) align-check opt 1
 +</file>
  
 where '1' is the number of the partition you want to check for correct alignment. where '1' is the number of the partition you want to check for correct alignment.
Line 78: Line 96:
 ==== Partition the Drive ==== ==== Partition the Drive ====
  
-This partitions a 'datadrive with a single large, properly aligned, primary partition:+Common filesystems: 
 + 
 +  * ''ext3'' 
 +  * ''ext4'' 
 +  * ''xfs'' 
 + 
 +''mkpart'' command syntax:
  
 <file> <file>
-parted -a optimal /dev/sdb+mkpart PART-TYPE [FS-TYPE] START END 
 +</file> 
 + 
 +:!: Many newer partition tools make the assumption that ''2048s'' (or ''1MiB'') is fairly safe assumption to create an aligned partition.  This is not always true, but is very common.  See here for more info: https://communities.netapp.com/message/97449 
 + 
 +This partitions a 'data' drive with a single large, properly aligned, primary partition that will have an XFS filesystem: 
 + 
 +<file> 
 +parted /dev/sdb
  
 (parted) mklabel gpt (parted) mklabel gpt
Line 87: Line 119:
 (parted) u s (parted) u s
  
-(parted) mkpart primary 1 -1+(parted) mkpart primary xfs 0% 100%
  
 (parted) p (parted) p
Line 94: Line 126:
 </file> </file>
  
-==== Create the Filesystem ====+===== Create the Filesystem =====
  
 The XFS filesystem is a good choice for very large disks. The XFS filesystem is a good choice for very large disks.
  
-This example creates an XFS filesystem labelled 'backup':+This example creates an XFS filesystem labelled 'Backup':
  
 <file> <file>
-mkfs.xfs -L backup /dev/sdb1+mkfs.xfs -L Backup /dev/sdx1
 </file> </file>
  
-==== Enable XFS on CentOS ====+==== Enable XFS on CentOS ====
  
 <file> <file>
 yum --enablerepo=centosplus install kmod-xfs xfsdump xfsprogs dmapi yum --enablerepo=centosplus install kmod-xfs xfsdump xfsprogs dmapi
 +</file>
 +
 +==== Enable XFS on CentOS 6 ====
 +
 +<file>
 +yum install xfsdump xfsprogs
 </file> </file>
computing/storage/disk_partitioning.1322772942.txt.gz · Last modified: 2011/12/01 13:55 by gcooper