how to btrfs setup storage on Proxmox VE?

why-be-banned

Member
Apr 4, 2023
61
8
13
I have a new disk, I want to use it for pve storage.
This is what I did:

Code:
#Ignore encrypted disk code here
cryptsetup open /dev/sdaX new-disk
mkfs.btrfs /dev/mapper/new-disk
mkdir -p /mnt/new-disk
mount /dev/mapper/new-disk /mnt/new-disk
#Should I manually create a subvolume for PVE storage? Or just use the root volume?
btrfs subvolume create /mnt/new-disk/pve-storage

批注 2025-02-17 113213.png

Is this operation method correct?

---------------------------------------------------------------------------------

Then I looked at this document:

批注 2025-02-17 114350.png

The documentation says "if a BTRFS file system is mounted at /mnt/data2 and its pve-storage/ subdirectory (which may be a snapshot, which is recommended)...",
What does "which may be a snapshot" mean? /mnt/data2/pve-storage/ should it be a snapshot of BTRFS? why not subvolume?

Here's the example from the documentation:
Code:
btrfs: data2
        path /mnt/data2/pve-storage
        content rootdir,images
        is_mountpoint /mnt/data2

Here's my config file:
Code:
root@oect:~# cat /etc/pve/storage.cfg
dir: local
    path /var/lib/vz
    content snippets,backup,rootdir,images,vztmpl,iso
    prune-backups keep-all=1

btrfs: data
    path /mnt/new-disk/pve-storage
    content images,rootdir,backup,iso,snippets,vztmpl
    preallocation off
    prune-backups keep-all=1

After comparing this I realized that my config file is missing "is_mountpoint ......", should I add this line of config code manually?
 
Last edited:
Hi!
What does "which may be a snapshot" mean? /mnt/data2/pve-storage/ should it be a snapshot of BTRFS? why not subvolume?
A snapshot is just a special type of subvolume, which also shares data with another, in the user space tooling. Essentially, there's no real difference between both, but AFAICS, you're correct that subvolume could be clearer to readers of the documentation.
After comparing this I realized that my config file is missing "is_mountpoint ......", should I add this line of config code manually?
The is_mountpoint option is recommended as it indicates to PVE that the storage is offline, if the provided path is not mounted. This makes it easier to handle externally managed storages, i.e. which have to be mounted manually.

All else, your setup looks fine to me.
 
Hi!

A snapshot is just a special type of subvolume, which also shares data with another, in the user space tooling. Essentially, there's no real difference between both, but AFAICS, you're correct that subvolume could be clearer to readers of the documentation.

The is_mountpoint option is recommended as it indicates to PVE that the storage is offline, if the provided path is not mounted. This makes it easier to handle externally managed storages, i.e. which have to be mounted manually.

All else, your setup looks fine to me.
thank you.