新規HDD追加時に覚えておきたいコマンド

FreeBSDで新規HDD追加する度に忘れてしまうのでメモ。

/dev/ada0 => physical:512B logical:512B
/dev/ada3 => physical:4KB logical:512B

fdisk

Media sector size is 512という記述はlogical sector sizeという点に注意。
logical/physicalを見たい時は後述のコマンドを参照。

# fdisk -v /dev/ada0
******* Working on device /dev/ada0 *******
parameters extracted from in-core disklabel are:
cylinders=484521 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=484521 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 486539235 (237567 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 1023/ head 255/ sector 63
The data for partition 2 is:

The data for partition 3 is:

The data for partition 4 is:


 # fdisk -v /dev/ada3
******* Working on device /dev/ada3 *******
parameters extracted from in-core disklabel are:
cylinders=5814021 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=5814021 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 238 (0xee),(EFI GPT)
    start 1, size 4294967295 (2097151 Meg), flag 0
        beg: cyl 0/ head 0/ sector 2;
        end: cyl 1023/ head 255/ sector 63
The data for partition 2 is:

The data for partition 3 is:

The data for partition 4 is:

diskinfo

-c オプションでread/writeを見ることができる。
-v オプションはread/write抜きになる。

# diskinfo -c /dev/ada0
/dev/ada0
        512             # sectorsize
        250059350016    # mediasize in bytes (232G)
        488397168       # mediasize in sectors
        0               # stripesize
        0               # stripeoffset
        484521          # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        Z3TFKXBE        # Disk ident.

I/O command overhead:
        time to read 10MB block      0.123508 sec       =    0.006 msec/sector
        time to read 20480 sectors   2.671287 sec       =    0.130 msec/sector
        calculated command overhead                     =    0.124 msec/sector

# diskinfo -c /dev/ada3
/dev/ada3
        512             # sectorsize
        3000592982016   # mediasize in bytes (2.7T)
        5860533168      # mediasize in sectors
        4096            # stripesize
        0               # stripeoffset
        5814021         # Cylinders according to firmware.
        16              # Heads according to firmware.
        63              # Sectors according to firmware.
        34Q4K0A6FSDA    # Disk ident.

I/O command overhead:
        time to read 10MB block      0.055544 sec       =    0.003 msec/sector
        time to read 20480 sectors   1.076329 sec       =    0.053 msec/sector
        calculated command overhead                     =    0.050 msec/sector

camcontrol identify [device]

ファームウェアやシリアルナンバーなど一番細かい情報が出せるコマンド。

# camcontrol identify /dev/ada0
pass0:  ATA-8 SATA 2.x device
pass0: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)

protocol              ATA/ATAPI-8 SATA 2.x
device model          VB0250EAVER
firmware revision     HPG9
serial number         Z3XXXXX
WWN                   5000c5005005b05d
cylinders             16383
heads                 16
sectors/track         63
sector size           logical 512, physical 512, offset 0
LBA supported         268435455 sectors
LBA48 supported       488397168 sectors
PIO supported         PIO4
DMA supported         WDMA2 UDMA5
media RPM             7200

Feature                      Support  Enabled   Value           Vendor
read ahead                     yes      yes
write cache                    yes      yes
flush cache                    yes      yes
overlap                        no
Tagged Command Queuing (TCQ)   no       no
Native Command Queuing (NCQ)   yes              32 tags
SMART                          yes      yes
microcode download             yes      yes
security                       no       no
power management               yes      yes
advanced power management      no       no
automatic acoustic management  no       no
media status notification      no       no
power-up in Standby            no       no
write-read-verify              yes      no      0/0x0
unload                         no       no
free-fall                      no       no
Data Set Management (DSM/TRIM) no
Host Protected Area (HPA)      no

 # camcontrol identify /dev/ada3
pass3:  ATA-8 SATA 3.x device
pass3: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)

protocol              ATA/ATAPI-8 SATA 3.x
device model          TOSHIBA MD04ACA300
firmware revision     FP1A
serial number         3XXXXXXXXX
WWN                   500003956b883858
cylinders             16383
heads                 16
sectors/track         63
sector size           logical 512, physical 4096, offset 0
LBA supported         268435455 sectors
LBA48 supported       5860533168 sectors
PIO supported         PIO4
DMA supported         WDMA2 UDMA5
media RPM             7200

Feature                      Support  Enabled   Value           Vendor
read ahead                     yes      yes
write cache                    yes      yes
flush cache                    yes      yes
overlap                        no
Tagged Command Queuing (TCQ)   no       no
Native Command Queuing (NCQ)   yes              32 tags
SMART                          yes      yes
microcode download             yes      yes
security                       yes      no
power management               yes      yes
advanced power management      yes      yes     128/0x80
automatic acoustic management  no       no
media status notification      no       no
power-up in Standby            no       no
write-read-verify              no       no
unload                         no       no
free-fall                      no       no
Data Set Management (DSM/TRIM) no
Host Protected Area (HPA)      yes      no      5860533168/5860533168
HPA - Security                 no

合わせて読みたい

http://blog.epy0n0ff.com/archives/497