> ## Content Index
> Fetch the complete content index at: https://ostreff.info/llms.txt
> Use this file to discover other available public pages before exploring further.

# Procedure to replace a zfs on root disk (zroot)
- URL: https://ostreff.info/procedure-to-replace-a-zfs-on-root-disk-zroot/
- Published: 2021-01-27T18:21:37.000Z
- Updated: 2024-05-06T05:53:43.000Z
- Author: Jordan Ostreff
- Tags: FreeBSD, ZFS

# Редактиране на публикация

Switch to draftПрегледОбновяванеДобавяне на заглавие

The procedure, as typed, for replacing ada2 with ada8:

`# gpart backup ada2 | gpart restore -F ada8`

`# zpool replace zroot /dev/ada2p3 /dev/ada8p3 (wait for resilver` checking via "zpool status")

`# swapoff /dev/ada2p2`

`# swapon /dev/ada8p2` ( verify via swapinfo )

If the size of the new disk is different it is better instead of gpart backup/restore step do:

`# zpool set autoexpand=on zroot`

`# gpart show`

`# gpart create -s gpt ada8`

`# gpart add -a 4k -s 512k -t freebsd-boot -l gptboot2 ada8`

`# gpart add -a 4k -s ‪4G ‬ -t freebsd-swap -l zfs2 ada8`

`# gpart add -a 4k -t freebsd-zfs -l zfs2 ada8`