Migrating UFS filesystem from one disk to another
I needed to migrate an UFS filesystem from one disk to another. I had several options including using two tar processes in a pipeline or using dump and restore in a pipeline. I opted for the latter to make sure everything got preserved during the transfer.
Here’s the sequence of commands where /dev/gpt/nroot0 is the GPT label of the new filesystem and / is the donor filesystem:
newfs /dev/gpt/nroot0 mount /dev/gpt/nroot0 /mnt cd /mnt rmdir .snap dump -0LaP 'restore -rf -' / cd / umount /mnt