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

📅 2014/09/13

FreeBSD 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:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
 # 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:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>

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: <VB0250EAVER HPG9> 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: <TOSHIBA MD04ACA300 FP1A> 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

合わせて読みたい

FreeBSDのディスク追加メモ

FreeBSDのディスク追加メモ

📅 2014/05/05

FreeBSD
# camcontrol identify ada2
# gpart create -s GPT ada2
# gpart show ada2
=>        34  5860533101  ada2  GPT  (2.7T)
          34  5860533101        - free -  (2.7T)
# gpart add -b 40 -t freebsd-ufs ada2
# newfs -S 4096 /dev/ada2p1

-b 40は以下を参照

http://d.hatena.ne.jp/epy0n/20110709/1310231619

FreeBSD9.1 + RocketRAID 2720

📅 2013/04/29

FreeBSD zfs

FreeBSD9.1からはRcoketRAIDのドライバが入ってるらしい。 ローダー周りの挙動すっかり忘れたのでメモメモ。

$ ls /boot/kernel | grep hp
acpi_hp.ko
acpi_hp.ko.symbols
atahighpoint.ko
atahighpoint.ko.symbols
hpt27xx.ko
hpt27xx.ko.symbols
hptiop.ko
hptiop.ko.symbols
hptmv.ko
hptmv.ko.symbols
hptrr.ko
hptrr.ko.symbols
mxge_ethp_z8e.ko
mxge_ethp_z8e.ko.symbols
mxge_rss_ethp_z8e.ko
mxge_rss_ethp_z8e.ko.symbols

# echo 'zfs_load="YES"' >> /boot/loader.conf
# echo 'hpt27xx_load="YES"' >> boot/loader.conf


# zpool upgrade -v
This system is currently running ZFS pool version 28.

The following versions are supported:

VER DESCRIPTION
--- --------------------------------------------------------
1 Initial ZFS version
2 Ditto blocks (replicated metadata)
3 Hot spares and double parity RAID-Z
4 zpool history
5 Compression using the gzip algorithm
6 bootfs pool property
7 Separate intent log devices
8 Delegated administration
9 refquota and refreservation properties
10 Cache devices
11 Improved scrub performance
12 Snapshot properties
13 snapused property
14 passthrough-x aclinherit
15 user/group space accounting
16 stmf property support
17 Triple-parity RAID-Z
18 Snapshot user holds
19 Log device removal
20 Compression using zle (zero-length encoding)
21 Deduplication
22 Received properties
23 Slim ZIL
24 System attributes
25 Improved scrub stats
26 Improved snapshot deletion performance
27 Improved snapshot creation performance
28 Multiple vdev replacements

For more information on a particular version, including supported releases,
see the ZFS Administration Guide.

# zfs upgrade -v
The following filesystem versions are supported:

VER DESCRIPTION
--- --------------------------------------------------------
1 Initial ZFS filesystem version
2 Enhanced directory entries
3 Case insensitive and filesystem user identifier (FUID)
4 userquota, groupquota properties
5 System attributes

For more information on a particular version, including supported releases,
see the ZFS Administration Guide.

# zpool import
pool: tank
id: xxxxxxxxxxxxxxxxxxxx
state: ONLINE
status: The pool is formatted using an older on-disk version.
action: The pool can be imported using its name or numeric identifier, though
some features will not be available without an explicit 'zpool upgrade'.
config:

tank ONLINE
raidz1-0 ONLINE
da0p1 ONLINE
da1p1 ONLINE
da2p1 ONLINE
da3p1 ONLINE

# zpool import tank
# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
tank 7.25T 7.08T 172G 97% 1.00x ONLINE -

# zpool upgrade -a
This system is currently running ZFS pool version 28.

Successfully upgraded 'tank'

# zfs upgrade -a
1 filesystems upgraded

問題なくアップグレード完了。 ついでにRocket RAID2720のBIOSもup。