刚开始使用fdisk 进行添加磁盘,添加了半天都加不上去,后来发现fdisk只能处理2T以下的磁盘,大于2T以上的磁盘需要使用parted进行分区。
    There are two common problems when creating partitions in Linux on big storage arrays. The first is easy,and the warning message from fdisk is a bit of a giveaway:
WARNING: The size of this disk is 8.0 TB (7970004230144 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID 
partition table format (GPT).
The answer: use parted. Don’t have it? 
    Install it!The second problem is this warning from parted:
(parted) mklabel gpt
(parted) mkpart primary 0 100%
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel?
… and no matter what combination of numbers you use,the message just keeps coming back. It’s tempting to ignore it,but don’t.
   There are a few posts on the subject,but this one from HP really gets to the guts of the problem.
   Here’s a quick step-by-step guide to aligning partitions properly. It’s just an abstraction of the HP post,but hopefully easier to follow. This will work for most arrays (in fact it works for all the arrays that I’ve seen); there are more options in HP’s post,but I’ve included the most common configuration here.
   1.Get the alignment parameters for your array (remember to replace sdb with the name of your device as seen by the kernel).
# cat /sys/block/sdb/queue/optimal_io_size
1048576
# cat /sys/block/sdb/queue/minimum_io_size
262144
# cat /sys/block/sdb/alignment_offset
0
# cat /sys/block/sdb/queue/physical_block_size
512
2.Add optimal_io_size to alignment_offset and divide the result by physical_block_size. In my case this was (1048576 + 0) / 512 = 2048.
   3.This number is the sector at which the partition should start. Your new parted command should look like
mkpart primary 2048s 100%
The trailing ‘s’ is important: it tells parted that you’re talking about sectors,not bytes or megabytes.
   4.If all went well,the partition will have been created with no warnings. You can check the alignment thusly (replacing ‘1’ with the partition number if necessary):
(parted) align-check optimal 1                                            
1 aligned
As I alluded to before,there are cases where this won’t work: if optimal_io_size is zero,for example,there are other rules to follow. Of course it would be nice if parted Could do this—the values are all available as ioctls。
   Apparently,using % causes parted to automatically align the sectors for best performance:
(parted) mkpart primary ext4 0% 100%
Also:
  Red Hat Enterprise Linux 6 - Creating a 7TB Partition Using parted Always Shows "The resulting partition is not properly aligned for best performance"
  Issue
  Trying to create a 7TB partition using parted,but parted always complains as follows:
  "The resulting partition is not properly aligned for best performance"
  Tried "parted -a optimal",but the result is same.
(parted) mkpart primary 0 7000G
Aviso: The resulting partition is not properly aligned for best performance. Descartar/Ignore/Cancelar/Cancel?
Solution
 Parted uses the following algorithm to determine optimal alignment for newly created partition. If none of the following conditions,2a,2b,or 2c are satisfied,then the warning message "The resulting partition is not properly aligned for best performance" would be displayed by parted utility.

Always use the reported alignment offset as offset.

    If optimal io size is present in the topology info,use that as grain.

    If optimal io size is not present in topology info and alignment offset is 0 and minimum io size is a power of 2,use the default optimal alignment (grain 1MiB).

    If not 2a and 2b,use the minimum io size,or if that is not defined the physical sector size as grain (iow the minimum alignment).
    In this case,the corresponding sysfs values are:
# cat /sys/block/sdb/queue/optimal_io_size
1835008
# cat /sys/block/sdb/queue/minimum_io_size
262144
# cat /sys/block/sdb/alignment_offset
0
# cat /sys/block/sdb/queue/physical_block_size
512
With a sector count of 13674214832 for the disk,13674214831 should be used as the end sector for using parted on this disk.
  With the optimal_io_size value 1835008 exceeding 1MiB,parted wants to align to the optimal_io_size. 1835008 / 512 = 3584 sectors for the optimal size in sectors. The start of a partition should be a multiple of 3584 sectors for optimal performance. To make a single partition for this disk with this alignment,the parted command:
  mkpart p ext2 3584s 13674214831s
  This should generate a partition with the optimal alignment and should avoid the warning too.
(parted) mkpart p ext2 3584s 13674214831s
Warning: You requested a partition from 1835kB to 7001GB
The closest location we can manage is 1835kB to 7001GB
Is this still acceptable to you? Yes/No? Yes

(parted) unit s p
Model: HP LOGICAL VOLUME (scsi)
disk /dev/sdb: 13674214832s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size Filesystem Name Flags 1 3584s 13674214798s 13674211215s p

参考:http://rainbow.chard.org/2013/01/30/how-to-align-partitions-for-best-performance-using-parted/
http://h20564.www2.hpe.com/hpsc/doc/public/display?docId=emr_na-c03479326&DocLang=en&docLocale=en_US&jumpid=reg_r11944_uken_c-001_title_r0001

CentOS 7.2新增物理磁盘以及使用parted对齐分区以得到最优性能的更多相关文章

  1. nsmutablearray – Sprite Kit iOS7 – SKNode UserData属性不存储值

    谢谢解决方法userData属性最初为零.您必须先创建一个字典并进行分配:

  2. ios – NSGenericException reason Collection

    这是我在出现SKScene时看到的错误,此错误随机发生,无法复制*由于未捕获的异常’NSGenericException’而终止应用程序,原因:’*Collection在被列举时发生了变异.发生了什么?

  3. ios – 如何在Xcode堆栈跟踪中查找NSInternalInconsistencyException的来源

    我没有在此堆栈跟踪中的任何位置看到任何可识别的文件名,方法调用或行号.或者,如果不是简单地读取堆栈跟踪并且涉及其他技术,那么开发人员应该采取哪些适当的下一步来追踪此类错误的来源?

  4. ios – NSURLConnectionLoader线程中的奇怪崩溃

    我们开始看到我们的应用启动时发生的崩溃.我无法重现它,它只发生在少数用户身上.例外情况是:异常类型:EXC_BAD_ACCESS代码:KERN_INVALID_ADDRESS位于0x3250974659崩溃发生在名为com.apple.NSURLConnectionLoader的线程中在调用时–[NSBlockOperationmain]这是该线程的堆栈跟踪:非常感谢任何帮助,以了解可能导致这种崩

  5. ios – 为什么不保留__block变量(在非ARC环境中)?

    我正在阅读__blockvariables上的文档,并考虑我使用__block的情况.对我来说,似乎我需要两种情况:>在块中使用时将变量标记为读写>在块内引用self时避免保留周期从表面上看,这两件事似乎并不相关.我认为__block变量没有被保留为更多的技巧我需要记住避免保留周期的特定用例.我想知道,为什么不能保留它们是否有更重要的建筑理由?

  6. ios – 崩溃错误代码:-1001错误:NSURLErrorTimedOut

    我遇到以下事故:崩溃只出现在iOS9上,没有在iOS8上,但这可能只是巧合.我也通过Crittercism面包屑看到这个:我也使用了后台提取,它打到了网络层.任何想法为什么这是打嗝?

  7. ios – CGContextSaveGState:应用启动时的无效上下文0x0

    FWW我的应用程序大多是用Swift2.0编写的,在iOS9上使用Xcode7b6.解决方法我遇到同样的问题,其原因是,我正在为不同的屏幕设置不同的状态栏样式.因此,我需要在plist中添加“查看基于控制器的状态栏外观”键.如果我删除此键,警告消失.

  8. 使用ShareKit ios的链接器错误

    我花了3天时间来搜索解决方案.我不知道该怎么做…

  9. 当Xcode 4.6打开故事板时,ios – Xcode 5崩溃

    我从2个月前开始使用Xcode4.6的项目,现在我想发送给我的应用程序一切都可以,但是当我尝试在iOS7上运行应用程序时,我看到一些错误;所以我已经下载了新的Xcode5以查看错误在哪里,但是发生了什么事情是当我尝试打开与IBXcode崩溃的故事板.我试图在互联网上看到如何解决这个问题,但我没有找到任何关于这一点.此外,当我尝试使用iOS7在设备上运行应用程序时,Xcode给我的错误是:解决方法问

  10. ios – __copy_helper_block_在AVFoundation中崩溃

    我的视频处理应用程序中发生了一次奇怪的崩溃.它使用AVFoundation处理视频和视频.用于过滤的音频和GPUImage.我自己从未遇到过这个问题,但在将它发布到AppStore之后,它经常出现在Crashlytics中.这是崩溃的日志:这就是我将AVFoundation连接到GPUImage的方法:任何想法我的代码有什么问题?

随机推荐

  1. 在airgapped(离线)CentOS 6系统上安装yum软件包

    我有一个CentOS6系统,出于安全考虑,它已经被空气泄漏.它可能从未连接到互联网,如果有,它很长时间没有更新.我想将所有.rpm软件包放在一个驱动器上,这样它们就可以脱机安装而无需查询互联网.但是,我在测试VM上遇到的问题是,即使指定了本地路径,yum仍然会挂起并尝试从在线存储库进行更新.另外,有没有办法使用yum-utils/yumdownloader轻松获取该包的所有依赖项和所有依赖项?目前

  2. centos – 命名在日志旋转后停止记录到rsyslog

    CentOS6.2,绑定9.7.3,rsyslog4.6.2我最近设置了一个服务器,我注意到在日志轮换后,named已停止记录到/var/log/messages.我认为这很奇怪,因为所有日志记录都是通过rsyslog进行的,并且named不会直接写入日志文件.这更奇怪,因为我在更新区域文件后命名了HUPed,但它仍然没有记录.在我停止并重新启动命名后,记录恢复.这里发生了什么?

  3. centos – 显示错误的磁盘大小

    对于其中一个磁盘,Df-h在我的服务器上显示错误的空白区域:Cpanel表明它只有34GB免费,但还有更多.几分钟前,我删除了超过80GB的日志文件.所以,我确信它完全错了.fdisk-l/dev/sda2也显示错误:如果没有格式化,我该怎么做才能解决这个问题?并且打开文件描述符就是它需要使用才能做到这一点.所以…使用“lsof”并查找已删除的文件.重新启动写入日志文件的服务,你很可能会看到空间可用.

  4. 如何在centos 6.9上安装docker-ce 17?

    我目前正在尝试在centOS6.9服务器上安装docker-ce17,但是,当运行yuminstalldocker-ce时,我收到以下错误:如果我用跳过的标志运行它我仍然得到相同的消息,有没有人知道这方面的方法?

  5. centos – 闲置工作站的异常负载平均值

    我有一个新的工作站,具有不寻常的高负载平均值.机器规格是:>至强cpu>256GB的RAM>4x512GBSSD连接到LSI2108RAID控制器我从livecd安装了CentOS6.564位,配置了分区,网络,用户/组,并安装了一些软件,如开发工具和MATLAB.在启动几分钟后,工作站负载平均值的值介于0.5到0.9之间.但它没有做任何事情.因此我无法理解为什么负载平均值如此之高.你能帮我诊断一下这个问题吗?

  6. centos – Cryptsetup luks – 检查内核是否支持aes-xts-plain64密码

    我在CentOS5上使用cryptsetupluks加密加密了一堆硬盘.一切都很好,直到我将系统升级到CentOS6.现在我再也无法安装磁盘了.使用我的关键短语装载:我收到此错误:在/var/log/messages中:有关如何装载的任何想法?找到解决方案问题是驱动器使用大约512个字符长的交互式关键短语加密.出于某种原因,CentOS6中的新内核模块在由旧版本创建时无法正确读取512个字符的加密密钥.似乎只会影响内核或cryptsetup的不同版本,因为在同一系统上创建和打开时,512字符的密钥将起作用

  7. centos – 大量ssh登录尝试

    22个我今天登录CentOS盒找到以下内容这是过去3天内的11次登录尝试.WTF?请注意,这是我从我的提供商处获得的全新IP,该盒子是全新的.我还没有发布任何关于此框的内容.为什么我会进行如此大量的登录尝试?是某种IP/端口扫描?基本上有4名匪徒,其中2名来自中国,1名来自香港,1名来自Verizon.这只发生在SSH上.HTTP上没有问题.我应该将罪魁祸首子网路由吗?你们有什么建议?

  8. centos – kswap使用100%的CPU,即使有100GB的RAM也可用

    >Linux内核是否应该足够智能,只需从内存中清除旧缓存页而不是启动kswap?

  9. centos – Azure将VM从A2 / 3调整为DS2 v2

    我正在尝试调整前一段时间创建的几个AzureVM,从基本的A3和标准A3到标准的DS2v2.我似乎没有能力调整到这个大小的VM.必须从头开始重建服务器会有点痛苦.如果它有所不同我在VM中运行CentOS,每个都有一个带有应用程序和操作系统的磁盘.任何人都可以告诉我是否可以在不删除磁盘的情况下删除VM,创建新VM然后将磁盘附加到新VM?

  10. centos – 广泛使用RAM时服务器计算速度减慢

    我在非常具体的情况下遇到服务器速度下降的问题.事实是:>1)我使用计算应用WRF>2)我使用双XeonE5-2620v3和128GBRAM(NUMA架构–可能与问题有关!

返回
顶部