Procedure to replace a zfs on root disk (zroot)

FreeBSD Jan 27, 2021

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

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


Jordan Ostreff

2G/3G/4G/NSA-5G/SA-5G Mobile Packet Core, Telco Clouds, Ericsson CEE, OpenStack, NFV, Orchestration, SDN, Containerisation, Networking IPv4/IPv6, Industrial Computer Networks, Mathematics, Engineering

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.
Share with Me via Nextcloud