Thursday, October 6, 2022
Google search engine
HomeLinux TutorialsHow To Change Thin LVM to Directory Storage in Proxmox 5.x 6.x

How To Change Thin LVM to Directory Storage in Proxmox 5.x 6.x

In Proxmox 5.x-7.x LVM thin is the default local storage for VMs, However I prefer the old method of directory based storage for local storage, this article will show you How To Change Thin LVM to Directory Storage in Proxmox 5.x 6.x. You can find this information in the proxmox wiki. These are my terse notes to get the job done

To restore to old style storage like proxmox 4.2 and below. Please follow the steps below.

Change configuration settings on /etc/pve/storage.cfg

remove this line below:

dir: local
        path /var/lib/vz
        content iso,vztmpl,backup

lvmthin: local-lvm
        thinpool data
        vgname pve
        content rootdir,images

After:

dir: local
        path /var/lib/vz
        maxfiles 0
        content backup,iso,vztmpl,rootdir,images

Recreate /var/lib/vz

Type the following to set everything up

lvremove pve/data
lvcreate --name data -l +100%FREE pve
mkfs.ext4 /dev/pve/data

Result:

[email protected] ~ > lvs
  LV   VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  data pve  twi-a-tz-- 16.38g             0.00   0.49
  root pve  -wi-ao----  7.75g
  swap pve  -wi-ao----  3.88g

[email protected] ~ > lvremove pve/data
Do you really want to remove active logical volume data? [y/n]: y
  Logical volume "data" successfully removed

[email protected] ~ > lvcreate --name data -l +100%FREE pve
  Logical volume "data" created.

[email protected] ~ > mkfs.ext4 /dev/pve/data
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done
Creating filesystem with 5307392 4k blocks and 1327104 inodes
Filesystem UUID: 310d346a-de4e-48ae-83d0-4119088af2e3
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

Edit fstab

In order for the hard drive to auto mount, make the fstab first in the file /etc/fstab

/dev/pve/data /var/lib/vz ext4 defaults 0 1

Restart proxmox host. Thats it.

Reference: Proxmox Wiki

YOU CAN SUPPORT DEVNINJA WITH A CUP OF COFFEE

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online. to search or browse the published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or more ) as a token of appreciation.

Support Us

DevNinja
DevNinja
A systems engineer with experience in systems administration, cloud computing, systems deployment, virtualization, containers
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

14 − thirteen =

- Advertisment -
Google search engine

Most Popular

Recent Comments