FreeBSDでgpart

DL180G6-FreeBSDでRAID6 gpartを作るメモ

■RAIDを設定
HP Smart RAID P410の設定メニューでcreate array
2TB HDD x 8をRAID6 ADGで構成
F8で保存。
そのままブートせず、一度リブートすること。

■FreeBSD gpart

svr1# gpart create -s GPT da2
da2 created
svr1# gpart show da2
=> 34 23441780845 da2 GPT (11T)
34 23441780845 - free - (11T)

svr1# gpart add -b 34 -s 23441780845 -t freebsd-ufs da2
da2p1 added
svr1# gpart show da2
=> 34 23441780845 da2 GPT (11T)
34 23441780845 1 freebsd-ufs (11T)

svr1# ls -l /dev/da2*
crw-r----- 1 root operator 0, 98 Feb 2 11:34 /dev/da2
crw-r----- 1 root operator 0, 124 Feb 2 12:00 /dev/da2p1

■FreeBSD gjournal

svr1# gjournal load
svr1# gjournal label -s 128g /dev/da2p1
svr1# ls -l /dev/da2*
crw-r----- 1 root operator 0, 99 Feb 2 12:15 /dev/da2
crw-r----- 1 root operator 0, 107 Feb 2 12:15 /dev/da2p1
crw-r----- 1 root operator 0, 113 Feb 2 12:15 /dev/da2p1.journal
svr1# gjournal list
Geom name: gjournal 2203534742
ID: 2203534742
Providers:
1. Name: da2p1.journal
Mediasize: 12001118050304 (11T)
Sectorsize: 512
Mode: r0w0e0
Consumers:
1. Name: da2p1
Mediasize: 12002191792640 (11T)
Sectorsize: 512
Mode: r1w1e1
Jend: 12002191792128
Jstart: 12001118050304
Role: Data,Journal

svr1# gjournal status
Name Status Components
da2p1.journal N/A da2p1

■FreeBSD newfs

svr1# newfs -J /dev/da2p1.journal
.....

loader.confに以下を追加
geom_journal_load="YES"

fstab
/dev/da2p1.journal /data ufs rw,async 0 0

■マウント

svr1# mount -a

■そのほか
/etc/rc.shutdownに以下の行を追加
/sbin/gjournal sync