Files
zfs/docs/migrate-zfs-root-pool-and-boot-system-to-new-disk.md
Márcio Fernandes 2a3ee411ef modified: README.md
new file:   docs/migrate-zfs-root-pool-and-boot-system-to-new-disk.md
2025-11-01 20:53:23 +00:00

57 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# How to Migrate a ZFS Root Pool and Boot System to a New Disk
🪛 Goal
Migrate boot system and ZFS root pool from one disk to another, preserving bootability and data integrity.
Dont forget to Keep a rescue USB handy in case you need to recover the bootloader.
**1. Partition the New Disk:**
*Identify disks using lsblk or fdisk -l. and recreate partitions.*
**2. Format the EFI Partition:**
if using UEFI boot:
*Exemple using proxmox host os:*
``` bash
proxmox-boot-tool format /dev/sdY2*
```
**3. Attach New Disk to ZFS Pool:**
*This will mirror the pool temporarily:*
``` bash
zpool attach rpool /dev/sdX3 /dev/sdY3
```
**4. Wait for Resilvering:**
*Monitor progress:*
``` bash
zpool status rpool
```
**5. Detach Old Disk:**
``` bash
zpool detach rpool /dev/sdX3
```
**5. Update Boot Order:**
*Ensure your BIOS/UEFI is set to boot from the new disk.*
🧠 Notes
If you dont want to mirror temporarily, you can also:
- Create a new ZFS pool on the new disk.
- Use zfs send | zfs receive to migrate datasets.
- Reconfigure bootloader manually.