Skip to content
Tech Master Tech Master

OneStopTechnical Forum

  • Books
  • AI
  • Networking
  • Windows
  • Linux
  • Cloud
  • Mac
  • Active Directory
  • Azure
  • Cloud
  • Exchange
  • M365
  • Server 2025
  • Storage
  • Vsphere
  • Website
  • Database
  • Security
  • Knowledge Base
  • VPN
Tech Master
Tech Master

OneStopTechnical Forum

ZFS and Partitions

blog.payperitem.com, March 31, 2025April 2, 2025

1. ZFS and Partitions

  • ZFS is a volume manager and filesystem in one. Unlike traditional filesystems (like ext4, NTFS, or XFS) that sit on top of partitions, ZFS works directly with whole disks or disk partitions.
  • You can assign either a whole disk (e.g., /dev/sdb) or a partition (e.g., /dev/sdb1) to a ZFS pool, but whole disks are preferred since ZFS can manage them better.

2. Using Partitions with ZFS

  • If you must use partitions instead of whole disks, you can manually create them using fdisk, parted, or gpart.
  • Example of creating a ZFS pool using a partition: bashCopyEditsudo parted /dev/sdb mklabel gpt sudo parted -a optimal /dev/sdb mkpart primary 0% 100% sudo zpool create mypool /dev/sdb1

3. Why Whole Disks Are Preferred?

  • ZFS expects direct control over the storage device for features like checksumming, redundancy, and self-healing.
  • Using partitions may result in alignment issues, reduced performance, or conflicts with other tools like grub or mdadm.

Would you like help setting up ZFS with a specific partitioning scheme?

4o

You said:

setting up ZFS with a specific partitioning scheme

ChatGPT said:

If you want to set up ZFS with a specific partitioning scheme, follow these steps:


Step 1: Decide Your Partitioning Scheme

You need to decide:

  • Boot Type: UEFI (/boot/efi partition) or BIOS.
  • Swap Space: If you want a swap partition.
  • ZFS Pool Layout: Whether the entire disk or just part of it will be used for ZFS.

Example Partition Layout (GPT)

PartitionPurposeFilesystemSize
/dev/sdX1EFI Boot (if UEFI)FAT32512MB
/dev/sdX2SwapSwap8GB
/dev/sdX3ZFS PoolZFSRemaining Space

Step 2: Create Partitions

1. Identify the Disk

List available disks:

Editlsblk

Assume we are using /dev/sdb.

2. Create Partitions Using parted

Editsudo parted /dev/sdb mklabel gpt
sudo parted -a optimal /dev/sdb mkpart primary fat32 1MiB 513MiB
sudo parted -a optimal /dev/sdb mkpart primary linux-swap 513MiB 8.5GiB
sudo parted -a optimal /dev/sdb mkpart primary 8.5GiB 100%
sudo parted /dev/sdb set 1 esp on
  • ESP Partition: /dev/sdb1 (Only needed for UEFI)
  • Swap Partition: /dev/sdb2
  • ZFS Partition: /dev/sdb3

Step 3: Create Filesystems

1. Format the Boot Partition (UEFI Only)

Editmkfs.fat -F32 /dev/sdb1

2. Set Up Swap Partition

bash
mkswap /dev/sdb2
swapon /dev/sdb2

Step 4: Create ZFS Pool on Partition

Instead of using the whole disk (/dev/sdb), we use the partition (/dev/sdb3):

bashCopyEditsudo zpool create -o ashift=12 mypool /dev/sdb3

If using RAID-Z or Mirror, specify multiple partitions:

bashCopyEditsudo zpool create -o ashift=12 mypool mirror /dev/sdb3 /dev/sdc3

Step 5: Verify ZFS Pool

Check the pool status:

bash
zpool status
zfs list

Step 6: Create ZFS Datasets

You can create datasets for better organization:

bash
sudo zfs create mypool/home
sudo zfs create mypool/var
sudo zfs create mypool/data

Step 7: Mount the Filesystem

bash
zfs set mountpoint=/mnt/mypool mypool

For a permanent mount on boot, add to /etc/fstab:

bash
echo "mypool /mnt/mypool zfs defaults 0 0" | sudo tee -a /etc/fstab

That’s It!

Your ZFS setup with a partitioning scheme is complete.

Cloud Storage #Azure#BSOD#CentOS#CloudComputing#CloudHosting#Colocation#CyberSecurity#CyberSecurity #WindowsSecurity #PrivacyMatters #Firewall #EndpointSecurity#DataCenter#DDoSProtection#DebianServer#DedicatedServer#DirectX#ESXi#FibreChannel#Firewall#GameOptimization#HyperV#IntrusionDetection#iSCSI#ITInfrastructure#ITPro#KVM#LinuxServer#ManagedHosting#NASStorage#Networking#NVMe#PCGaming#PCIssues#PowerShell#Proxmox#RAID#RedHat#SANStorage#Server#ServerRoom#ServerSecurity#SIEM#SSDServers#SysAdmin#SysAdminLife#TaskScheduler#TechSupport#UbuntuServer#VMware#VPSHosting#vSAN#vSphere#WindowsAutomation#WindowsDebugging#WindowsFix#WindowsGaming#WindowsServerEnterprise & HostingSecurity & MonitoringStorage & PerformanceVirtualization & Hypervisors

Post navigation

Previous post
Next post

Related Posts

Installing PartKeepr on an Ubuntu Server

April 7, 2025

✅ Step-by-Step Installation of PartKeepr on Ubuntu Server 1. System Preparation bashsudo apt update && sudo apt upgrade -ysudo apt install unzip curl git -y 2. Install Apache, PHP, and MariaDB bashsudo apt install apache2 mariadb-server mariadb-client -y Install PHP and required extensions: bashsudo apt install php php-mysql php-gd php-intl…

Read More

Comparison Matrix O365 Enterprise Plan

April 8, 2025

Here’s a clean feature comparison matrix of the Microsoft 365 Enterprise plans — E1, E3, E5, and F3 — as of 2025. This helps quickly visualize the capabilities across plans: ✅ Microsoft 365 Enterprise Feature Comparison Category F3 E1 E3 E5 Core Apps & Services Web & Mobile Office Apps…

Read More

System Details Script for ConnectWise Automate (PowerShell)

March 31, 2025April 2, 2025

System Details Script for ConnectWise Automate (PowerShell) powershell$SystemDetails = @{}# Get Computer Name$SystemDetails[“ComputerName”] = $env:COMPUTERNAME# Get OS Info$OS = Get-CimInstance Win32_OperatingSystem$SystemDetails[“OS”] = “$($OS.Caption) ($($OS.BuildNumber))”$SystemDetails[“OS_Arch”] = $OS.OSArchitecture$SystemDetails[“Uptime_Days”] = [math]::Round((Get-Date) – $OS.LastBootUpTime).TotalDays# Get CPU Info$CPU = Get-CimInstance Win32_Processor$SystemDetails[“CPU”] = “$($CPU.Name) – $($CPU.NumberOfCores) Cores / $($CPU.NumberOfLogicalProcessors) Threads”# Get RAM Info$RAM = Get-CimInstance Win32_ComputerSystem$SystemDetails[“RAM_GB”]…

Read More

Recent Posts

  • List of AD Schema Versions
  • OldNewExplorer Free Download For Windows 11, 10, 8 and 7 [Latest Version]
  • How to Get the Classic (old) Context Menu on Windows 11
  • BitLocker Recovery Keys
  • Active Directory and Server hardening

Recent Comments

No comments to show.
June 2025
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« May    
Log in
©2025 Tech Master | WordPress Theme by SuperbThemes
  • Login
  • Sign Up
Forgot Password?
Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.
body::-webkit-scrollbar { width: 7px; } body::-webkit-scrollbar-track { border-radius: 10px; background: #f0f0f0; } body::-webkit-scrollbar-thumb { border-radius: 50px; background: #dfdbdb }