[SOLVED] Increase datastore partition

Jul 20, 2022
133
10
18
Running PBS 2.2-1 as a VM on Proxmox 7.2-11. The PBS datastore is a zvol on a Proxmox ZFS pool. It's formatted as XFS.

I need to increase my PBS datastore from 10 TB to 15 TB. Have already adjusted the VM disk configuration accordingly.

Now I need help with the next stop.

Code:
root@pbs:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    0   32G  0 disk
├─sda1         8:1    0 1007K  0 part
├─sda2         8:2    0  512M  0 part
└─sda3         8:3    0 31.5G  0 part
  ├─pbs-swap 253:0    0    8G  0 lvm  [SWAP]
  └─pbs-root 253:1    0 19.6G  0 lvm  /
sdb            8:16   0 14.9T  0 disk
└─sdb1         8:17   0   10T  0 part /mnt/datastore/PBS
root@pbs:~#

How do I get /dev/sdb1 to take up all of /dev/sdb? Does the device need to be offline?

I realize this is a noob question. :-(

After this, I plan to expand the XFS file system within the partition. I think I know how to do that with xfs_growfs. Please let me know if that's incorrect.

Thanks.
 
Last edited:
Why a zvol with xfs at all? Thats just adds additional overhead. ZFS got datasets for that if you need to store stuff, like a PBS datastore, on a filesystem.
 
I tried:
Code:
root@pbs:~# resize2fs /dev/sdb1
resize2fs 1.46.2 (28-Feb-2021)
resize2fs: Bad magic number in super-block while trying to open /dev/sdb1
Couldn't find valid filesystem superblock.
root@pbs:~#
Why a zvol with xfs at all? Thats just adds additional overhead. ZFS got datasets for that if you need to store stuff, like a PBS datastore, on a filesystem.
That doesn't answer my question.
 
I tried:
Code:
root@pbs:~# resize2fs /dev/sdb1
resize2fs 1.46.2 (28-Feb-2021)
resize2fs: Bad magic number in super-block while trying to open /dev/sdb1
Couldn't find valid filesystem superblock.
root@pbs:~#
I would like to accomplish this without copying 8 TB of data.
 
Last edited:
Lets say your ZFS pool is called "tank", then its usually mounted at "/tank". If you want to store files directly on ZFS its best to create a new dataset first. Lets say you want a dataset called "datastore1" on the pool "tank". Then you can run zfs create tank/datastore1. Then you should have that dataset mounted at "/tank/datastore1".
For some performance optimizations you could also run this:
Code:
# disable compression as PBS already is compressing chunks with zstd on the software side:
zfs set compression=off tank/datastore1
# make that the atime is only updated once per day, so not every read operation will cause an additional write operation:
zfs set relatime=on tank/datastore1
# chunks are usually about 2MB in size, so it makes sense to increase the recordsize from default 128K to 1M so the metadata to data ratio will be better:
zfs set recordsize=1M tank/datastore1

In case you got enough free space you could then temporarily disable your backup/prune/sync/GC/verify jobs, so PBS won't read/write while you coyp it. Then copy over all files from your old datastore to that "/tank/datastore1" (for example using rsync -avc /path/of/your/old/datastore/ /tank/datastore1). When that is finished you could edit your datastore.cfg (nano /etc/proxmox-backup/datastore.cfg) and edit it to point to "/tank/datastore1" instead of "/path/of/your/old/datastore".
then you can reboot PBS, test if all works and in case it did you could remove the old datastore (rm -r /path/of/your/old/datastore).

A ZFS dataset also got the benefit that you never need to increase its size as it will dynamically use all the space that your pool got available in case you don't set a quota to limit that.
And a ZFS pool should always have 20% of free space. So I would recommend to also set a 90% quota so you can't completely fill that pool up by accident. Lets say you got 10TB pool, then I would set a pool wide quota of 9TB by running zfs quota=9T tank.
 
Last edited:
Then copy over all files from your old datastore to that "/tank/datastore1" (for example using rsync -avc /path/of/your/old/datastore/ /tank/datastore1).

So, how do I set this up in Proxmox?

Code:
root@proxmox:/# zfs list
NAME                                     USED  AVAIL     REFER  MOUNTPOINT
fivebays                                13.2T  19.8T      166K  /fivebays
fivebays/PBSdatastore                    153K  19.8T      153K  /fivebays/PBSdatastore
fivebays/vm-100-disk-1                  12.8G  19.8T     12.8G  -
fivebays/vm-101-disk-0                  6.36T  19.8T     6.36T  -
fivebays/vm-103-disk-0                  39.7G  19.8T     30.7G  -
fivebays/vm-103-state-B4BraveDuplicati  4.91G  19.8T     4.91G  -
fivebays/vm-105-disk-0                  6.78T  19.8T     6.78T  -
root@proxmox:/# mkdir /mnt/datastore
root@proxmox:/# zfs set mountpoint=/mnt/datastore fivebays/vm-101-disk-0
cannot set property for 'fivebays/vm-101-disk-0': 'mountpoint' does not apply to datasets of this type
root@proxmox:/#

The existing PBS zvol is fivebays/vm-101-disk-0.

The new ZFS file system is mounted at /fivebays/PBSdatastore.

How can I make the files in the zvol accessible at the same time as the ZFS file system so that I can copy the files from the zvol to the ZFS file system?

When I wish to add the ZFS file system to PBS's VM,
1668038755059.png

I don't have any options to provide a ZFS file system, or any host directory.
1668038914874.png

And, as you may have noticed above, I am seemingly unable to make the zvol (xfs) file system available to the Proxmox root ID.

Thanks for your help.
 
Ah, you got an PBS VM. In that case datasets wouldn't work...at least with direct access.


To expand your existing xfs zvol:
1.) extend zvol size using the PVE webUI
2.) download a gparted ISO, upload it to PVE, attach it to the virtual optical drive of the PBS VM, boot PBS VM into gparted ISO.
3.) Use gparted to move the backup MBR/GPT partition table to the end of the virtual disk. And use it to extend your xfs partition to use the unallocated space.
4.) Remove ISO and boot into PBS. Use the xfs_growfs command to extend the xfs filesystem.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!