# 刪除內建的 LVM thin:local-lvm，改用ZFS

<div align="left"><img src="/files/-Lqxmaow3DIj7-Chy0JR" alt=""></div>

1. 查看硬碟的分割狀態

   **lvs**

```
LV                     VG  Attr       LSize    Pool Origin        Data%  Meta%  Move Log Cpy%Sync Convert
  base-101-disk-0        pve Vri---tz-k    8.00g data                                                      
  data                   pve twi-aotz-- <151.63g                    11.24  1.66                            
  root                   pve -wi-ao----   59.25g                                                           
  snap_vm-104-disk-0_org pve Vri---tz-k   50.00g data vm-104-disk-0                                        
  swap                   pve -wi-ao----    8.00g                                                           
  vm-100-disk-0          pve Vwi-a-tz--   32.00g data               3.80                                   
  vm-104-disk-0          pve Vwi-a-tz--   50.00g data               21.05                                  
  vm-105-disk-0          pve Vwi-a-tz--   32.00g data               4.07                                   

```

1. 移除 local-lvm(/dev/pve/data)

   **lvremove /dev/pve/data**

   Removing pool "data" will remove 5 dependent volume(s). Proceed? \[y/n]:y\
   Logical volume "data" successfully removed

vgdisplay | grep Free

Free PE / Size 43705 / 170.72 GiB

使用 gparted live cd 調整lvm大小

![](/files/-Lqxu2ht5jTBdi-SuVUe)

使用文字指令parted

```
parted /dev/sdj
GNU Parted 3.2
Using /dev/sdj
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA INTEL SSDSC2BX40 (scsi)
Disk /dev/sdj: 400GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  1049kB  1031kB                     bios_grub
 2      1049kB  538MB   537MB   fat32              boot, esp
 3      538MB   400GB   400GB                      lvm

(parted) res
rescue      resize      resizepart
(parted) res
rescue      resize      resizepart
(parted) resizepart
Partition number? 3
End?  [400GB]? 150G
Warning: Shrinking a partition can cause data loss, are you sure you want to
continue?
Yes/No? Yes
(parted) print
Model: ATA INTEL SSDSC2BX40 (scsi)
Disk /dev/sdj: 400GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  1049kB  1031kB                     bios_grub
 2      1049kB  538MB   537MB   fat32              boot, esp
 3      538MB   150GB   149GB                      lvm

```

fdisk /dev/sdj 建立sdj4分割區

zpool create zfs /dev/sdj4

![](/files/-LqxxF8HlucBKgnMutPC)

zpool list&#x20;

進入資料中心，加入zfs 的儲存

![](/files/-LqxxfKyAf0Gt7NYCbIu)

<div align="left"><img src="/files/-LqxxpMeIvb8iDDSQa79" alt=""></div>


---

# 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/fu-lu/shan-chu-nei-jian-de-lvm-thinlocallvm.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.
