ansitest/proxmox/proxmox-create-lvm-thin.sh

25 lines
599 B
Bash
Raw Permalink Normal View History

2024-09-13 08:58:42 -06:00
#!/bin/bash
2024-12-30 17:59:53 -07:00
# this create an lvm-thin with the same naming scheme the proxmox installer uses
2024-09-13 08:58:42 -06:00
# xxx TODO EDITME
target=/dev/sda4
2024-12-30 17:59:53 -07:00
echo '*** YOU NEED TO EDIT THIS SCRIPT BEFORE RUNNING IT ***'
echo '*** AUTHOR IS NOT RESPONSIBLE FOR DATA LOSS!! ***'
echo ''
echo "About to create lvm-thin on $target - Enter to continue or ^C"
read
2024-09-13 08:58:42 -06:00
pvcreate $target
vgcreate -A y pve $target
#lvcreate -L 100G -n data pve
lvcreate -A y --readahead auto \
--name data --extent 99%FREE pve
lvconvert --type thin-pool pve/data
(pvs; vgs; lvs) |tee >/root/lvminfo.txt
echo "Define storage in pve GUI as local-lvm"