如何验证磁盘是否被写入

如何验证磁盘是否被写入

如何验证磁盘是否是新的并且出厂时没有写入?我有一个客户需要确保他恢复的磁盘是干净的并且从出厂到他拥有期间没有被篡改过。我拆开了一台服务器的包装(上面没有操作系统,磁盘上没有分区),这就是我看到的

root@ubuntu:~# smartctl   -l devstat /dev/sda
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-42-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

Device Statistics (GP Log 0x04)
Page  Offset Size        Value Flags Description
0x01  =====  =               =  ===  == General Statistics (rev 3) ==
0x01  0x008  4              60  ---  Lifetime Power-On Resets
0x01  0x010  4              93  ---  Power-on Hours
0x01  0x018  6      5358239516  ---  Logical Sectors Written
0x01  0x020  6         5284840  ---  Number of Write Commands
0x01  0x028  6           86108  ---  Logical Sectors Read
0x01  0x030  6            3040  ---  Number of Read Commands
0x04  =====  =               =  ===  == General Errors Statistics (rev 1) ==
0x04  0x008  4               0  ---  Number of Reported Uncorrectable Errors
0x04  0x010  4              66  ---  Resets Between Cmd Acceptance and Completion
0x05  =====  =               =  ===  == Temperature Statistics (rev 1) ==
0x05  0x008  1              26  ---  Current Temperature
0x05  0x010  1              29  ---  Average Short Term Temperature
0x05  0x018  1               -  ---  Average Long Term Temperature
0x05  0x020  1              43  ---  Highest Temperature
0x05  0x028  1              20  ---  Lowest Temperature
0x05  0x030  1              34  ---  Highest Average Short Term Temperature
0x05  0x038  1              29  ---  Lowest Average Short Term Temperature
0x05  0x040  1               -  ---  Highest Average Long Term Temperature
0x05  0x048  1               -  ---  Lowest Average Long Term Temperature
0x05  0x050  4               0  ---  Time in Over-Temperature
0x05  0x058  1              70  ---  Specified Maximum Operating Temperature
0x05  0x060  4               0  ---  Time in Under-Temperature
0x05  0x068  1               0  ---  Specified Minimum Operating Temperature
0x06  =====  =               =  ===  == Transport Statistics (rev 1) ==
0x06  0x008  4             142  ---  Number of Hardware Resets
0x06  0x010  4              60  ---  Number of ASR Events
0x06  0x018  4               0  ---  Number of Interface CRC Errors
0x07  =====  =               =  ===  == Solid State Device Statistics (rev 1) ==
0x07  0x008  1               0  ---  Percentage Used Endurance Indicator
                                    |||_ C monitored condition met
                                ||__ D supports DSN
                                |___ N normalized value

制作驱动器时会进行测试吗?如何验证我收到的磁盘是否干净且写入了 0 个字节?我理解我可以使用 Scrub(如此处所述)https://linoxide.com/linux-command/commands-wipe-disk-linux/),但如果不需要的话,我宁愿不让它磨损。

答案1

你需要指挥hdparm 开关/选项大写“i”或“I”将为您提供所需的所有信息。有一个信息提供总旋转时间。

$ sudo hdparm -I /dev/sda

相关内容