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。

  • 相关阅读:
    poj 2485 Highways 最小生成树
    hdu 3415 Max Sum of MaxKsubsequence
    poj 3026 Borg Maze
    poj 2823 Sliding Window 单调队列
    poj 1258 AgriNet
    hdu 1045 Fire Net (二分图匹配)
    poj 1789 Truck History MST(最小生成树)
    fafu 1181 割点
    减肥瘦身健康秘方
    人生的问题
  • 原文地址:https://www.cnblogs.com/itfat/p/8651726.html
Copyright © 2011-2022 走看看