Инструменты пользователя

Инструменты сайта


wiki:technical:ds:zfs_raid1
no way to compare when less than two revisions

Различия

Показаны различия между двумя версиями страницы.


Предыдущая версия
Следующая версия
wiki:technical:ds:zfs_raid1 [2017/04/07 22:51] – внешнее изменение 127.0.0.1
Строка 1: Строка 1:
 +====== Замена диска в RAID1 под FreeBSD ======
 +Смотрим состояние массива:
 +<code>
 +# zpool status
 +  pool: tank
 + state: DEGRADED
 +status: One or more devices could not be opened.  Sufficient replicas exist for
 + the pool to continue functioning in a degraded state.
 +action: Attach the missing device and online it using 'zpool online'.
 +   see: http://illumos.org/msg/ZFS-8000-2Q
 +  scan: resilvered 10.5G in 0h9m with 0 errors on Mon Feb  1 09:49:38 2016
 +config:
 +
 + NAME                     STATE     READ WRITE CKSUM
 + tank                     DEGRADED             0
 +   mirror-0               DEGRADED             0
 +     ada1p3               ONLINE               0
 +     9066085129501579450  UNAVAIL      0          was /dev/ada0p3
 +
 +errors: No known data errors
 +</code>
 +Копируем разметку с рабочего диска:
 +<code>
 +# gpart backup ada1 | gpart restore -F /dev/ada0
 +</code>
 +Монтируем:
 +<code>
 +# zpool import -o altroot=/mnt tank
 +</code>
 +Добавляем:
 +<code>
 +# zpool replace tank 9066085129501579450 ada0p3
 +Make sure to wait until resilver is done before rebooting.
 +
 +If you boot from pool 'tank', you may need to update
 +boot code on newly attached disk 'ada0p3'.
 +
 +Assuming you use GPT partitioning and 'da0' is your new boot disk
 +you may use the following command:
 +
 + gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
 +
 +</code>
 +Ставим загрузчик:
 +<code>
 +# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
 +bootcode written to ada0
 +</code>
 +Проверяем:
 +<code>
 +# zpool status
 +  pool: tank
 + state: DEGRADED
 +status: One or more devices is currently being resilvered.  The pool will
 + continue to function, possibly in a degraded state.
 +action: Wait for the resilver to complete.
 +  scan: resilver in progress since Tue May 10 22:34:44 2016
 +        1.08G scanned out of 196G at 8.42M/s, 6h35m to go
 +        1.07G resilvered, 0.55% done
 +config:
 +
 + NAME                       STATE     READ WRITE CKSUM
 + tank                       DEGRADED             0
 +   mirror-0                 DEGRADED             0
 +     ada1p3                 ONLINE               0
 +     replacing-1            UNAVAIL      0         0
 +       9066085129501579450  UNAVAIL      0          was /dev/ada0p3/old
 +       ada0p3               ONLINE                block size: 512B configured, 4096B native  (resilvering)
 +
 +errors: No known data errors
 +</code>
  
wiki/technical/ds/zfs_raid1.txt · Последнее изменение: 2022/12/08 15:38 — Diman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki