Legenda (oznaczenia używane w postach) czyli lets clean this burdel

Oznaczenia używane w postach

Zwykły tekst Czcionka Georgia

apt-get install -Komenda



-ryzyko uszkodzenia systemu


-skrypt w bashu
-Ważna informacja

=====
wycinek z loga konsoli
====

nano /etc/resolv.conf plik do edycji


wtorek, 12 lipca 2022

BSD zfs home na oddzielnym dysku

Going by memory since it's been a long while, this is how you do it after the fact:


zfs is datasets. the installer by default create a dataset named user/home:
zroot/usr/home 24.6G 179G 24.6G /usr/home
making sure noone is logged in or using /usr/home/username, so
as root from a console you use zfs commands to rename the existing zroot/usr/home dataset something like
zfs rename zroot/usr/home zroot/usr/home.ORIG
use zfs commands to change the mountpoint, something like
zfs set mountpoint=/usr/home.ORIG zroot/usr/home.ORIG

then assuming your second device is hooked, you use gpart to set it up, set gpt scheme on it, create a partition of type freebsd-zfs, make sure you align and label it as something like "zfs1" or something meaningful
then simply use zfs commands to create a new pool on that partition
zpool create storage gpt/zfs1 or ada1p1 (of course you use your correct label and device names)
then create your new user/home dataset:
zfs create storage/home
set the mountpoint to /usr/home
zfs set mountpoint=/usr/home storage/home

Now you have your home directories on a different device. If you have data in your existing user directories, many ways to copy it over a simple way would be to use tar piping through stdout/stdin. Or rsync or cp -R /usr/home.ORIG /usr/home.
One could also use zfs send/zfs receive if desired. I find that for a home user system with a single or couple of users, cp or tar works good enough.

The installer you would need to drop to a shell at some point and do the partitioning and zpool and dataset creation by hand, pay attention to the mount points, lots of things to keep track of.
That is why people suggested do the install on a single disk, do not create a user, simply get the system up and running. Then you do what I've outlined here, since there are no user directories yet, nothing to copy.

ZFS I learned you want to get yourself copies of the following books by Michael W Lucas:
FreeBSD Mastery: Storage Essentials
FreeBSD Mastery: ZFS (with Allan Jude)
FreeBSD Mastery: Advanced ZFS (with Allan Jude)
Pretty much any "How do I do this" question on ZFS I've ever had are answered in them.

Brak komentarzy:

Prześlij komentarz