# 建立ZFS pool

lsblk 找出所有磁碟

```
lsblk 
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0   7.5G  0 disk 
sdb                  8:16   0 223.6G  0 disk 
├─sdb1               8:17   0  1007K  0 part 
├─sdb2               8:18   0   512M  0 part /boot/efi
└─sdb3               8:19   0 223.1G  0 part 
  ├─pve-swap       253:0    0     7G  0 lvm  [SWAP]
  ├─pve-root       253:1    0  55.8G  0 lvm  /
  ├─pve-data_tmeta 253:2    0   1.5G  0 lvm  
  │ └─pve-data     253:4    0 141.4G  0 lvm  
  └─pve-data_tdata 253:3    0 141.4G  0 lvm  
    └─pve-data     253:4    0 141.4G  0 lvm  
sdc                  8:32   0   3.7T  0 disk 
sdd                  8:48   0   3.7T  0 disk 
├─sdd1               8:49   0     2G  0 part 
└─sdd2               8:50   0   3.7T  0 part 
sde                  8:64   0   3.7T  0 disk 
├─sde1               8:65   0     2G  0 part 
└─sde2               8:66   0   3.7T  0 part 
```

```
fdisk /dev/sde

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Partition number (1,2, default 2): 

Partition 2 has been deleted.

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help): 1
1: unknown command

Command (m for help): w
```

![](/files/-LpaE791-xDqmitVfDnW)

![](/files/-LpaM3Sj_E-NJu0SQZ9U)

![](/files/-LpaORQdv_7MWKWn6lc2)

ZFS本身就能提供十分強大的邏輯磁碟管理功能，可提供RAID 0、鏡像（RAID 1）、RAID Z（RAID 5）、RAID Z2（RAID 6）與RAID Z3等多種磁碟組態，以及快照、Clone等功能。

*RAID-Z* - ZFS 實作了 RAID-Z，以標準的 RAID-5 修改而來，可提供奇偶校驗 (Parity) 更佳的分散性並去除了 “RAID-5 write hole” 導致在預期之外的重啟後資料與奇偶校驗資訊不一致的問題。ZFS 支援三個層級的 RAID-Z，可提供不同程度的備援來換取減少不同程度的可用空間，類型的名稱以陣列中奇偶校驗裝置的數量與儲存池可以容許磁碟故障的數量來命名，從 RAID-Z1 到 RAID-Z3 。

**結合SSD的讀寫加速機制**

ZFS可利用SSD來搭配內建的L2ARC與ZIL兩種功能，從而有效加速存取效能。對於讀取作業可透過L2ARC快取功能，利用主記憶體外的高速儲存裝置空間（如SSD），充當第2層ARC快取緩衝區，透過增大可用的ARC快取緩衝區容量來提高快取命中率。對於寫入作業，則可將ZIL指定配置到SSD等高速媒體上，從而加速寫入作業效率。

/sbin/zpool create -o ashift=12 local-zpool raidz /dev/sdc /dev/sdd /dev/sde invalid vdev specification use '-f' to override the following errors: /dev/sdc contains a filesystem of type 'linux\_raid\_member'

清除 linux\_raid\_member

```
dd if=/dev/zero of=/dev/sdc bs=512 seek=$(( $(blockdev --getsz /dev/sdc) - 1024 )) count=1024
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/andoid-shou-ji/pomoxve/jian-li-zfs-pool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
