Coder Social home page Coder Social logo

lvm-helper's Introduction

How to convert proxmox xfs/ext4 Install to raid5

Note

In this tutorial let's use:

  • /dev/sdX for the proxmox installed disk
  • /dev/sdY and /dev/sdZ for the other 2 disks for raid 5

you may use this tutorial for other raid levels (like raid1, raid6, raid0, etc...), but I only tested in raid5, so good luck

Copy Partition Table

Get the /dev/sdX partition table to a file

$ sfdisk -d /dev/sdX > table

Restore the partition table to /dev/sdY and /dev/sdZ

$ sfdisk /dev/sdY < table
$ sfdisk /dev/sdZ < table

Clone BIOS and UEFI partitions

$ dd if=/dev/sdX1 of=/dev/sdY1
$ dd if=/dev/sdX1 of=/dev/sdZ1
$ dd if=/dev/sdX2 of=/dev/sdY2
$ dd if=/dev/sdX2 of=/dev/sdZ2

Install Grub

$ grub-install /dev/sdY
$ grub-install /dev/sdZ

Convert Proxmox Logical volumes to raid5

Extend Volume group

$ vgextend pve /dev/sdY3 /dev/sdZ3

Recreate data Logical Volume

Based

Remove data lvm

$ lvremove pve/data

Create metadata logical volume

$ lvcreate -n meta_data --type raid5 -L 256M pve

Create data logical volume

$ lvcreate -n data --type raid5 --nosync -L 500G pve

Now let's convert to a Thinpool

$ lvconvert --thinpool pve/data --poolmetadata meta_data

Convert root and swap Logical volumes

First you need to convert from linear to raid1

$ lvconvert --type raid1 pve/root
$ lvconvert --type raid1 pve/swap

Wait the raid1 sync and convert to a raid5

$ lvconvert --type raid5 pve/root
$ lvconvert --stripes 2 pve/root

$ lvconvert --type raid5 pve/swap
$ lvconvert --stripes 2 pve/swap

Wait for sync and enjoy your raid5 in proxmox :)

(Optional) Grow root Logical Volume

$ xfs_growfs /dev/pve/root

lvm-helper's People

Contributors

mrninso avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.