无法检测全新硬盘的大小

无法检测全新硬盘的大小

我今天刚买了一个8TB的硬盘。

我只是把它放在我的 USB 外壳中。

fdisk -l确实看到了设备:

Disk /dev/sdc: 1404.5 GB, 1404493455360 bytes, 2743151280 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

但是大小不对,fdisk认为只有 1.4TB。

df也无法正确识别尺寸:

$ df /dev/sdc
Filesystem     1K-blocks  Used Available Use% Mounted on
devtmpfs         8078104     0   8078104   0% /dev

然后,我sudo fdisk /dev/sdc尝试删除所有分区(但没有)并创建一个新的分区:

Command (m for help): d
No partition is defined yet!

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-2743151279, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2743151279, default 2743151279): 
Using default value 2743151279
Partition 1 of type Linux and of size 1.3 TiB is set

知道为什么丢失了 6.5TB 吗?我该如何找回它们?

谢谢!

更新 #1:按照 James 的建议,smartctl确实显示有 8TB。所以只剩下第二个问题——如何恢复它们?

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.10.0-862.2.3.el7.x86_64] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     HGST HDN728080ALE604
Serial Number:    ........
LU WWN Device Id: ........
Firmware Version: A4GNW91X
User Capacity:    8,001,563,222,016 bytes [8.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Fri Feb 15 20:29:41 2019
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x80) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (  101) seconds.
Offline data collection
capabilities:            (0x5b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    No Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    (1184) minutes.
SCT capabilities:          (0x003d) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   016    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   100   100   054    Pre-fail  Offline      -       0
  3 Spin_Up_Time            0x0007   100   100   024    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       4
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   100   100   020    Pre-fail  Offline      -       0
  9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       0
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       4
 22 Unknown_Attribute       0x0023   100   100   025    Pre-fail  Always       -       100
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       6
193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       6
194 Temperature_Celsius     0x0002   222   222   000    Old_age   Always       -       27 (Min/Max 23/33)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

更新#2:现在,我直接连接到 HDD,而不是通过 USB + 外壳。 fdisk显示正确的总大小为 8TB:

Disk /dev/sdc: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

然而,df仍然只显示1.22TB:

$ df
Filesystem           1K-blocks     Used  Available Use% Mounted on
/dev/sdc            1349915988    77848 1281242976   1% /run/media/myuser/xyz

以下是具体内容/proc/partitions

$ sudo grep sdc /proc/partitions 
   8       32 7814026584 sdc

任何想法?

答案1

您的 USB 外壳仅支持 32 位 LBA。这对于大于 2 TiB 的驱动器来说不够用。

根据smartctl,您的驱动器为 8,001,563,222,016 字节,这意味着 15,628,053,168 个 512 字节扇区。但是,您的 USB 外壳报告有 2,743,151,280 个扇区。如果我们看一下二进制表示,问题就很明显了:

15,628,053,168 = 11 1010 0011 1000 0001 0010 1010 1011 0000
 2,743,151,280 =    1010 0011 1000 0001 0010 1010 1011 0000

买一个新的、现代的 USB 外壳。固件更新可能会有所帮助,但可能没有可用的。

答案2

您需要运行smartctl来显示设备信息:

smartctl -a /dev/sdc

(如果未安装 smartctl,则需要执行yum install smartmontools

这应该向您显示包含顶部“信息部分”的输出,其中应包含(除其他外)制造商,型号和序列号 - 例如:

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Red
Device Model:     WDC WD60EFRX-68L0BN1
Serial Number:    ...elided...
LU WWN Device Id: ...elided...
Firmware Version: 82.00A82
User Capacity:    6,001,175,126,016 bytes [6.00 TB]

如果这没有显示你期望的内容,那么它要么不是一个 8TB 的硬盘,或者你可能看错了硬盘?

相关内容