gmirror †# 前提 GPTで4分割パーテーション # 1.freebsd-boot # 2.freebsd-ufs # 3.freebsd-swap # 4.freebsd-ufs(デュアルブート用) gpart backup ada0 > ada0.gpt gpart restore -F /dev/ada1 < ada0.gpt gpart show gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada1 kldload geom_mirror gmirror label -vb round-robin p1 /dev/ada0p1 gmirror label -vb round-robin p4 /dev/ada0p4 gpart set -a bootonce -i 4 ada0 # ミラー設定のため起動パーテーションを一時変更 mount /dev/mirror/p4 /mnt echo 'geom_mirror_load="YES"' >> /mnt/boot/loader.conf cp /mnt/etc/fstab /mnt/etc/fstab.org sed s/'ada0'/'mirror\/'/ < /mnt/etc/fstab.org > /mnt/etc/fstab shutdown -r now gmirror label -vb round-robin p2 /dev/ada0p2 mount /dev/mirror/p2 /mnt echo 'geom_mirror_load="YES"' >> /mnt/boot/loader.conf cp /mnt/etc/fstab /mnt/etc/fstab.org sed s/'ada0'/'mirror\/'/ < /mnt/etc/fstab.org > /mnt/etc/fstab shutdown -r now gmirror insert p1 /dev/ada1p1 gmirror insert p2 /dev/ada1p2 gmirror insert p4 /dev/ada1p4 gmirror status kldload geom_stripe.ko gstripe label -v p3 ada0p3 ada1p3 gstripe status echo 'geom_stripe_load="YES"' >> /boot/loader.conf echo 'kern.geom.label.gptid.enable=0' >> /boot/loader.conf # 意味不明 dmesgのエラー回避 echo '/dev/stripe/p3 none swap sw 0 0' >> /etc/fstab echo 'daily_status_gmirror_enable="YES"' >> /etc/periodic.conf echo 'daily_status_gstripe_enable="YES"' >> /etc/periodic.conf 解除方法 gmirror deactivate -v p2 ada0p2 ada1p2 |