zoukankan      html  css  js  c++  java
  • Partition does not start on physical sector boundary

    今天给一块硬盘分区,用fdisk按照默认步骤执行,遇到这个问题:

    [root@bogon ~]# fdisk /dev/sdf
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0x59c8eb29.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.

    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
             switch off the mode (command 'c') and change display units to
             sectors (command 'u').

    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-121597, default 1):
    Using default value 1
    Last cylinder, +cylinders or +size{K,M,G} (1-121597, default 121597):
    Using default value 121597

    Command (m for help): p

    Disk /dev/sdf: 1000.2 GB, 1000171331584 bytes
    255 heads, 63 sectors/track, 121597 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 262144 bytes / 262144 bytes
    Disk identifier: 0x59c8eb29

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdf1               1      121597   976727871   83  Linux
    Partition 1 does not start on physical sector boundary.

    在网上搜了一圈,说是逻辑扇区与物理扇区的大小不一样的原因。可是我这机器的逻辑扇区与物理扇区的大小是一样的啊

    Sector size (logical/physical): 512 bytes / 512 bytes

    好在还是找到了解决办法。办法有两种,一是按u切换到以扇区为单位,二是按c关闭dos兼容模式。前者最简单,如下:

    [root@bogon ~]# fdisk /dev/sdf
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0xc466de3d.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.

    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
             switch off the mode (command 'c') and change display units to
             sectors (command 'u').

    Command (m for help): u
    Changing display/entry units to sectors

    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 1
    First sector (63-1953459631, default 512): 
    Using default value 512
    Last sector, +sectors or +size{K,M,G} (512-1953459631, default 1953459631): 
    Using default value 1953459631

    Command (m for help): p

    Disk /dev/sdf: 1000.2 GB, 1000171331584 bytes
    255 heads, 63 sectors/track, 121597 cylinders, total 1953459632 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 262144 bytes / 262144 bytes
    Disk identifier: 0xc466de3d

       Device Boot      Start         End      Blocks   Id  System
    /dev/sdf1             512  1953459631   976729560   83  Linux

    Command (m for help): 

    注意到fdisk给出的默认起始扇区是512,按这个值生成的分区是对齐的。我们可以算出物理扇区大小应该是512*512=262144,为毛显示成512呢?

    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 262144 bytes / 262144 bytes

    仔细一看,I/O size显示的正好是262144。这么说物理扇区大小显示错了?不解。这个系统是64位Redhat6.4。

  • 相关阅读:
    php CURL 发送请求封装
    PHP AES加解密(兼容php5,php7)
    vscode jshint 报'import' is only available in ES6 (use 'esversion: 6'). (W119)错误
    vue-cli4 + TS构建新项目
    搭建vue项目
    分享一个自然语言汉语时间语义识别的工具类
    图像检索阶段性总结
    mysql常用操作
    javascript在页面head内动态插入style
    iScroll-5拉动刷新功能实现与iScroll-4上拉刷新的一点改进
  • 原文地址:https://www.cnblogs.com/itfat/p/8651726.html
Copyright © 2011-2022 走看看