Possible: Make RAID Partition ZFS Debian 12 using Drives from Windows Server/Windows 11 with Full Write Support for NAS Setup
This article will guide you through the process of creating a RAID partition using ZFS on Debian 12, with drives from a Windows Server or Windows 11 setup. The goal is to enable full write support, which is essential for running a Network Attached Storage (NAS) setup.
What is RAID?
RAID stands for Redundant Array of Independent Disks. It is a method of storing data across multiple hard drives or solid-state drives (SSDs) to improve performance, redundancy, or both.
What is ZFS?
ZFS is a combined file system and logical volume manager designed by Sun Microsystems. It is known for its data integrity and performance features, making it ideal for NAS setups.
Prerequisites
Before proceeding, ensure the following prerequisites are met:
- Debian 12 installed on the NAS device
- Access to drives previously used by a Windows Server/Windows 11 setup
- Basic understanding of command-line interfaces
Preparing the Drives
To use the drives from a Windows Server/Windows 11 setup, you need to clean the GPT and MBR partitions. Use the gdisk tool to clean the drives:
sudo gdisk /dev/sda
Delete all partitions by typing 'd' and press enter until all partitions are deleted. Then, create a new protective MBR and exit the tool. Repeat this for all drives:
o
w
Installing ZFS
To install ZFS, add the deb-multimedia-keyring and the contrib and non-free repositories to your sources list:
sudo apt-get update
sudo apt-get install -y deb-multimedia-keyring
sudo apt-get install -y software-properties-common dirmngr
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 22D1B99B
sudo add-apt-repository -y contrib non-free
Install zfsutils-linux package:
sudoapt-get update
sudo apt-get install -y zfsutils-linux
Creating the RAID ZFS Pool
Identify the drives you want to include in the RAID ZFS pool:
ls /dev/disk/by-id/
Create a RAID-Z1 pool:
sudo zpool create -f mypool raidz /dev/disk/by-id/ /dev/disk/by-id/ /dev/disk/by-id/
Enabling Full Write Support
To enable full write support, you need to set the cache and log devices. Identify SSDs or NVMe drives:
ls /dev/nvme*
Create a ZIL (log):
sudo zpool add mypool log /dev/nvme0n1p1
Create a cache device:
sudo zpool add mypool cache /dev/nvme0n1p2
This article covered the process of creating a RAID ZFS partition using drives from a Windows Server or Windows 11 setup. Remember to:
- Clean drive
- Install ZFS
- Create a RAID ZFS
- Enable full write support with ZIL and cache