Extending Datastore

Aug 18, 2020
20
3
23
37
Hello,

we have installed PBS as a vm on PVE. The vm has a virtual disk for the Backup Storage. (40 GB as Directory Storage)

Now i want to expand the Storage. At the PVE side i increased the virtual disk. A moment later PBS shows the new disk size. (50GB)

But the Datastore shows 40GB. How can i tell the Datastore to use the additional 10 GB?
 

Attachments

  • Screenshot 2020-11-16 132535.jpg
    Screenshot 2020-11-16 132535.jpg
    72.9 KB · Views: 66
  • Screenshot 2020-11-16 132642.jpg
    Screenshot 2020-11-16 132642.jpg
    55 KB · Views: 67
Last edited:
@fabian,

The link you referenced uses parted to extend the file system. PBS iso install does not include parted and will not install with apt-get install parted. So what is the next step?
 
I am in a similar position with you, but I am using ZFS for my datastore.
So I have enabled autoexpand for the zfs pool and the pool automatically expanded to fill the new Virtual Disk:
zpool set autoexpand=on backup
 
@fabian,

The link you referenced uses parted to extend the file system. PBS iso install does not include parted and will not install with apt-get install parted. So what is the next step?
You certainly should be able to install parted in a fresh debian, do you really mean that "apt update" and "apt install parted" is not installing it for you? What does "apt search ^parted" show?
 
Last edited:
Hello,

I have also installed PBS as vm on PVE with disks for datastore1 and datastore2. Currently also resized first disk and from PBS I run zpool set autoexpand=on datastore1 and disk was successfully resized. But on the tab ZFS datastore1 has original size. Could you please help me, how can I increase ZFS datastore?

Thank you
Daniel
 

Attachments

  • pbs_disk.JPG
    pbs_disk.JPG
    48.4 KB · Views: 50
  • pbs_zfs_datastore.JPG
    pbs_zfs_datastore.JPG
    50.6 KB · Views: 47
  • pve_pbs_disk.JPG
    pve_pbs_disk.JPG
    24.3 KB · Views: 46
You certainly should be able to install parted in a fresh debian, do you really mean that "apt update" and "apt install parted" is not installing it for you? What does "apt search ^parted" show?
Thank you @oversite for the reply. I guess I could have prefaced my post with my lack of experience in linux. Running apt update first did in fact allow install to run. I understand now why. I'm kicking myself for not thinking of that before I posted.
 
For others who may be struggling to extend a datastore....
(PBS installed in a PVE cluster. The pve virtual disk in PBS is /dev/sdb)

-resize disk in PVE
-verify resized disk in PBS -> administration -> storage/disks
-open PBS shell and run the following
Code:
parted /dev/sdb
(parted) print
Warning: Not all of the space available to /dev/sdb appears to be used, you can
fix the GPT to use all of the space (an extra ########### blocks) or continue
with the current setting?
Fix/Ignore? F
(parted) resizepart 1 Yes 100%
(parted) quit
(* I had to add "yes" to the resizepart line from the wiki tutorial)

Code:
resize2fs /dev/sdb1
(*this step can take some time)

-verify datastore extended
 
Last edited:
For others who may be struggling to extend a datastore....
(PBS installed in a PVE cluster. The pve virtual disk in PBS is /dev/sdb)

-resize disk in PVE
-verify resized disk in PBS -> administration -> storage/disks
-open PBS shell and run the following
Code:
parted /dev/sdb
(parted) print
Warning: Not all of the space available to /dev/sdb appears to be used, you can
fix the GPT to use all of the space (an extra ########### blocks) or continue
with the current setting?
Fix/Ignore? F
(parted) resizepart 1 Yes 100%
(parted) quit
(* I had to add "yes" to the resizepart line from the wiki tutorial)

Code:
resize2fs /dev/sdb1
(*this step can take some time)

-verify datastore extended
Seems that parted is no longer included in PBS :(
 
-> apt update
-> apt install parted
-> fuser -v /mnt/datastore/ClusterDtStoreName
-> umount -l /mnt/datastore/ClusterDtStoreName
-> umount /mnt/datastore/ClusterDtStoreName
-> parted /dev/sdb resizepart 1 100%
-> mount /dev/sdb1 /mnt/datastore/ClusterDtStoreName
-> xfs_growfs /dev/sdb1

Should do it for xfs file system
 
-> apt update
-> apt install parted
-> fuser -v /mnt/datastore/ClusterDtStoreName
-> umount -l /mnt/datastore/ClusterDtStoreName
-> umount /mnt/datastore/ClusterDtStoreName
-> parted /dev/sdb resizepart 1 100%
-> mount /dev/sdb1 /mnt/datastore/ClusterDtStoreName
-> xfs_growfs /dev/sdb1

Should do it for xfs file system
fs_growfs can resize on a mounted partition. So you no not need all the steps before.

It's enough to:
Bash:
# 1. Install parted if not already installed
apt update && apt install parted
# 2. You MUST move the 2nd GPT header to the end of the disk
#.   Otherwise, you get a parted warning when running "parted /dev/vdb"
sgdisk -e /dev/vdb
# 3. Resize partition. Here it is number 1.
parted /dev/vdb resizepart 1 100%
# 4. Resize XFS on partition 1 to 100% (default)
xfs_growfs /dev/vdb1
 
Last edited:
sdb1 is backup repository disk. Add disk space to you sdb in your environment.
In PBS:
apt install lsof
apt install parted

lsof /dev/sdb1
Kill 847 (process number(s) occupying the disk, PBS might die on your SSH)

In console:
Umount /dev/sdb1

parted /dev/sdb
(parted) print
Warning: Not all of the space available to /dev/sdb appears to be used, you can
fix the GPT to use all of the space (an extra ########### blocks) or continue
with the current setting?
Fix/Ignore? F
(parted) resizepart 1 Yes 100%
(parted) quit

Reboot

After reboot:

resize2fs /dev/sdb1