Rpool/var/tmp /var/tmp zfs noatime,nodev,nosuid 0 0 Rpool/var/log /var/log zfs noatime,nodev,noexec,nosuid 0 0 I’ve nuked it intentionally, you may not want to do that, so use brain and review what you need and what can/needs to be removed.ĭatasets /var/log, /var/tmp and /tmp, if you leave them to be mounted by zfs import cache, will cause issues with race conditions between order of filesystem mounting (done by zfs import service) and daemons which expect some filesystems to already be available, so the solution is to switch them to legacy mountpoint and handle them in fstab zfs set mountpoint=legacy rpool/var/log Now I had to create FS for EFI partition apt install dosfstools Without proper initramfs system would refuse to boot. Once I was there I’ve found that system wouldn’t resolve URLs (no systemd-resolved running) so I’ve just added: nameserver 8.8.8.8įrom there we had to install required packages: apt install -yes -no-install-recommends linux-image-generic With that out of the way we can start copying the files: rsync -arAXHvW /oldroot/ /mnt/ Chroot and make required changes #įirst we need to mount standard directories mount -rbind /dev /mnt/dev # Mount current root to it (You CAN do this while system is live) In this step I basically just used rsync, but I first had to mount my old systems to some new path, so I wouldn’t copy over /dev, /proc and other files as that would cause issues # Create temp folder Zfs create -o com.sun:auto-snapshot=false -o setuid=off rpool/tmp Zfs create -o com.sun:auto-snapshot=false -o mountpoint=/var/lib/docker rpool/var/docker Zfs create -o com.sun:auto-snapshot=false -o exec=on rpool/var/tmp Zfs create -o acltype=posixacl -o xattr=sa rpool/var/log Zfs create -o com.sun:auto-snapshot=false rpool/var/cache Zfs create -o canmount=off -o setuid=off -o exec=off rpool/var Zfs create -o mountpoint=/root rpool/root I’ve omitted /home as I already use other ZFS pool as my /home # Create root Once the main part is done you can create datasets. Zfs create -o canmount=noauto -o mountpoint=/ rpool/ROOT/ubuntu Zfs create -o canmount=off -o mountpoint=none rpool/ROOT # Create filesystem dataset to act as a container (like on FreeBSD) Zpool create -o ashift=12 -O atime=off -O canmount=off -O compression=lz4 -O normalization=formD -O xattr=sa -O mountpoint=/ -R /mnt rpool nvme-Force_MP500_17047932000122530589-part1 ![]() Now that the disk is prepared it is time to create ZPOOL and required filesystems on it # Create pool ![]() Create ZPOOL #Īrticle from ZFSonLinux wiki page on Github was the main guideline (basically I C/P everything from there).ĭestroy everything on the drive and create 2 partitions (EFI and partition which pool will be created sgdisk -zap-all /dev/disk/by-id/nvme-Force_MP500_17047932000122530589 ![]() Just follow the official Wiki and you’ll be good. Note that my system is using UEFI so steps regarding bootloader preparation differ from MBR boot type. This main PC has 2 NVMe drives and root was installed on only one of those, second one was basically unused for the whole time (experimentation and stuff) so I had the wiggle room to do the migration. I don’t use it everywhere (am trying to be smart about it) but I prefer to do whenever I have the chance. ZFS is my favorite FS of choice for some time now. But without digressing much, I decided it was time to move my root (/) to ZFS. To be more precise I opted out at install time to use Ubuntu Mate 18.04 but later on installed AwesomeWM and use that instead now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |