"use client" import React, { useState } from "react" import Link from "next/link" import { Database, ArrowLeft, Copy, Check, Terminal } from "lucide-react" import { Button } from "@/components/ui/button" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion" export default function ZFSManagementPage() { const [viewMode, setViewMode] = useState<"table" | "accordion">("table") // Group commands by category for better organization const commandGroups = [ { title: "Pool Information", commands: [ { command: "zpool list", description: "List all ZFS pools" }, { command: "zpool status", description: "Show detailed pool status and health" }, { command: "zpool status -v", description: "Show verbose pool status with errors" }, { command: "zpool history", description: "Show command history for all pools" }, { command: "zpool history ", description: "Show command history for specific pool" }, { command: "zpool get all ", description: "Show all properties of a pool" }, ], }, { title: "Dataset Management", commands: [ { command: "zfs list", description: "List all ZFS datasets" }, { command: "zfs list -r ", description: "List all datasets in a pool recursively" }, { command: "zfs create /", description: "Create a new dataset" }, { command: "zfs destroy /", description: "Destroy a dataset" }, { command: "zfs rename / /", description: "Rename a dataset" }, { command: "zfs get all /", description: "Show all properties of a dataset" }, { command: "zfs set compression=on /", description: "Enable compression on a dataset" }, ], }, { title: "Snapshot Management", commands: [ { command: "zfs list -t snapshot", description: "List all snapshots" }, { command: "zfs list -t snapshot -r ", description: "List all snapshots in a pool" }, { command: "zfs snapshot /@", description: "Create a snapshot" }, { command: "zfs destroy /@", description: "Delete a snapshot" }, { command: "zfs rollback /@", description: "Rollback to a snapshot" }, { command: "zfs hold /@", description: "Place a hold on a snapshot" }, { command: "zfs release /@", description: "Release a hold on a snapshot" }, ], }, { title: "Clone and Send/Receive", commands: [ { command: "zfs clone /@ /", description: "Create a clone from a snapshot", }, { command: "zfs send /@ > backup.zfs", description: "Send a snapshot to a file" }, { command: "zfs receive / < backup.zfs", description: "Receive a snapshot from a file" }, { command: "zfs send -i /@ /@ > incr.zfs", description: "Send incremental snapshot", }, { command: "zfs send -R /@ > full-recursive.zfs", description: "Send recursive snapshot", }, ], }, { title: "Maintenance and Repair", commands: [ { command: "zpool scrub ", description: "Start a scrub operation on a pool" }, { command: "zpool scrub -s ", description: "Stop a running scrub" }, { command: "zpool clear ", description: "Clear error counts in a pool" }, { command: "zpool clear ", description: "Clear errors on a specific device" }, { command: "zpool replace ", description: "Replace a failed device" }, { command: "zpool offline ", description: "Take a device offline" }, { command: "zpool online ", description: "Bring a device online" }, ], }, { title: "Performance and Monitoring", commands: [ { command: "zpool iostat", description: "Show I/O statistics for pools" }, { command: "zpool iostat -v", description: "Show detailed I/O statistics" }, { command: "zpool iostat 5", description: "Show I/O statistics every 5 seconds" }, { command: "arc_summary", description: "Show ARC statistics (if installed)" }, { command: "zfs get compressratio /", description: "Show compression ratio" }, { command: "zfs get used,available,referenced /", description: "Show space usage" }, ], }, ] return (
Back to Help and Info

ZFS Management Commands

This section provides commands for managing ZFS file systems in Proxmox VE. Learn how to create and manage pools, datasets, snapshots, and perform maintenance operations on your ZFS storage.

{viewMode === "table" ? (
{commandGroups.map((group, index) => (

{group.title}

Command Description Action {group.commands.map((cmd, cmdIndex) => ( {cmd.command} {cmd.description} ))}
))}
) : (
{commandGroups.map((group, index) => (

{group.title}

{group.commands.map((cmd, cmdIndex) => (
{cmd.command}
{cmd.command}

{cmd.description}

))}
))}
)}

ZFS Best Practices

  • Replace <pool> with your ZFS pool name
  • Replace <dataset> with your dataset name
  • Replace <snapshot-name> with a descriptive name, often including a timestamp (e.g., daily-2023-05-01)
  • Run regular scrubs to maintain data integrity (weekly or monthly)
  • Keep at least 10-15% of pool space free for optimal performance (ZFS performance degrades significantly when pools are over 80% full)
  • Use meaningful snapshot names and consider implementing an automated snapshot rotation policy for important datasets
  • When replacing devices, always use{" "} zpool replace rather than removing and adding to preserve data redundancy
) } interface CopyButtonProps { text: string } function CopyButton({ text }: CopyButtonProps) { const [copied, setCopied] = React.useState(false) const copyToClipboard = () => { navigator.clipboard.writeText(text) setCopied(true) setTimeout(() => setCopied(false), 2000) } return ( ) }