7/14/2023 0 Comments Bzflag for raspberry piIn this example I have used the (WWN) World-Wide-Names but serial numbers and UUIDs should also work. This is done to prevent issues in loading the array should the OS change the names of the drives if the drives are moved around. Then build the pool and define the drives using the info from above in your layout. Lrwxrwxrwx 1 root root 9 Dec 15 12:57 ata-SanDisk_SSD_PLUS_240GB_# ->. You never build MD raid devices or ZFS arrays that way, you should always use fixed identifiers. "sudo zpool create zfspool raidz1 sda sdb sdc sdd sde -f" , in the background it will still be ZFS ( for example as swap, either as a file or "partition" ) Upon creation it can be labelled as a block device, and exported for example via iSCSI / formatted with another FS etc. think of datasets as a kind of partition, but one thats spans disks.Įach dataset can use the whole pool, and datasets can be mounted, snapshotted and send. One should create datasets as mountpoints like so, datasets will inherit the above settings. Most importantly, everyone except for a couple of niche cases where you have lots ( really a lot ) of ECC RAM, you should always disable ZFS deduplication.Īnd enable (LZ4) compression, which is extremely lightweigt, and will increase your thruput. This tutorial is far from complete, one shouldn't mount and use the complete pool as such. Make sure you're deleting the right pool and don't have any data inside that you care about. Note: This will wipe out the pool and lead to data loss. If you no longer like swimming in the waters of ZFS, you can destroy the pool you created with: $ sudo zpool destroy zfspool Verify the pool is set up correctly: $ zfs listĪnd make sure it was mounted so Linux can see it: $ df -h The specific structure you should use depends on how many and what type of drives you have, as well as your performance and redundancy needs. The following command will create a zpool with all the block devices listed: $ sudo zpool create zfspool raidz1 sda sdb sdc sdd sde -fįor production use, you should really read up on the benefits and drawbacks of different RAID levels in ZFS, and how to structure zpools and vdevs. Looking good, time to start building the array! Create a RAIDZ1 zpool It doesn't zero the data, so technically it could still be recovered at this point!Ĭheck to make sure nothing's mounted (and make sure you have removed any of the drives you'll use in the array from /etc/fstab if you had persistent mounts for them in there!): $ lsblk If you didn't realize it yet, this wipes everything. $ sudo umount /dev/sdb? sudo wipefs -all -force /dev/sdb? sudo wipefs -all -force /dev/sdbĭo that for each of the drives. We should make sure all the drives that will be part of the array are partition-free: $ sudo umount /dev/sda? sudo wipefs -all -force /dev/sda? sudo wipefs -all -force /dev/sda I noticed sda already has a partition and a mount. I want to put sda through sde into the RAIDZ1 volume. List all the devices on your system: $ lsblk And make sure you don't care about anything on them. You should have at least three drives set up and ready to go. If not, it might not have loaded correctly. ZFS: Loaded module v2.0.2-1~bpo10+1, ZFS pool version 5000, ZFS filesystem version 5 $ sudo apt install zfs-dkms zfsutils-linux Since ZFS is not bundled with other Debian 'free' software (because of licensing issues), you need to install the kernel headers, then install two ZFS packages: $ sudo apt install raspberrypi-kernel-headers No guarantees under other configurations. ![]() ![]() I have also only tested ZFS on 64-bit Raspberry Pi OS, on Compute Modules with 4 or 8 GB of RAM. I wouldn't really recommend ZFS for the Pi 4 model B or other Pi models that can't use native SATA, NVMe, or SAS drives.įor my own testing, I am using a Raspberry Pi Compute Module 4, and there are a variety of PCI Express storage controller cards and carrier boards with integrated storage controllers that make ZFS much happier. ZFS does not enjoy USB drives, though it can work on them. ![]() In it, I'm going to document how I set up a ZFS zpool in RAIDZ1 in Linux on a Raspberry Pi. This is a simple guide, part of a series I'll call 'How-To Guide Without Ads'.
0 Comments
Leave a Reply. |