failed adding new drive to pve-data

han0522

Renowned Member
Sep 25, 2016
5
0
66
43
I am running pve 4.4. I have the entire installation and pve-data on a single 250GB SSD. I have a spare 2TB HDD that I wanted to add for additional VM storage.

I ran through this document not realizing it was outdated:

https://pve.proxmox.com/wiki/Extending_Local_Container_Storage

I ran through the steps until I got to resize2fs command and received the following error:

resize2fs: Bad magic number in super-block while trying to open /dev/mapper/pve-data

After googling this, I realized that I was following an outdated way of extending the storage capacity of pve-data.

I'm trying to figure out how to undo what I did (that is, remove the 2TB drive from pve-data and resize pve-data down to what it was before) so that I can then add a new volume with the 2TB (the way I should have from the beginning).

pvremove on the drive's UUID gives me a "not found" error and running lvresize using the original pve-data size (Current LE) reminds me that volumes cannot be reduce in size.

Everything's working right now and I'm going to backup my VMs/LXCs/proxmox installation just in case. But before I mess anything else up I wanted to see if someone knows an easy way to remove a drive from a volume group.

chris
 
IF your filesystem resize failed to do anything, then you need to shrink your lv size and remove the extension of the volume to finally remove it. As always it is best to have a backup before continuing.
 
IF your filesystem resize failed to do anything, then you need to shrink your lv size and remove the extension of the volume to finally remove it. As always it is best to have a backup before continuing.
So just to be sure, would I run lvresize using the old extent size then pvremove on the added drive then hopefully I would be back to where I started?

Thanks
chris
 
Before:
root@proxmox:~# pvdisplay
--- Physical volume ---
PV Name /dev/sda3
VG Name pve
PV Size 223.45 GiB / not usable 4.57 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 57201
Free PE 4058
Allocated PE 53143
PV UUID 0VrZtf-rXJ7-a4K1-dDcA-dibn-iyJM-gYxRh2

root@proxmox:~# vgdisplay
--- Volume group ---
VG Name pve
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2116
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 9
Open LV 5
Max PV 0
Cur PV 1
Act PV 1
VG Size 223.44 GiB
PE Size 4.00 MiB
Total PE 57201
Alloc PE / Size 53143 / 207.59 GiB
Free PE / Size 4058 / 15.85 GiB
VG UUID ue4B2F-0Emr-pi1q-CM5t-gjQH-eKRQ-CViGUH

root@proxmox:~# lvdisplay
--- Logical volume ---
LV Path /dev/pve/swap
LV Name swap
VG Name pve
LV UUID JHv2Lz-9bTJ-d2NL-qS3o-W2km-p4dZ-2fs6Rp
LV Write Access read/write
LV Creation host, time proxmox, 2016-09-29 22:28:37 -0500
LV Status available
# open 2
LV Size 8.00 GiB
Current LE 2048
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 251:1

--- Logical volume ---
LV Path /dev/pve/root
LV Name root
VG Name pve
LV UUID 9kw7Lm-e8Tx-eAKq-0Mhj-wU40-JOOK-uHnlYU
LV Write Access read/write
LV Creation host, time proxmox, 2016-09-29 22:28:37 -0500
LV Status available
# open 1
LV Size 55.75 GiB
Current LE 14272
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 251:0

--- Logical volume ---
LV Name data
VG Name pve
LV UUID 1EZdsO-xz43-e2nD-2e9x-OFsY-CBE7-srMhz0
LV Write Access read/write
LV Creation host, time proxmox, 2016-09-29 22:28:37 -0500
LV Pool metadata data_tmeta
LV Pool data data_tdata
LV Status available
# open 7
LV Size 143.70 GiB
Allocated pool data 70.54%
Allocated metadata 34.17%
Current LE 36787
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 251:4

After:
root@proxmox:/# pvdisplay
--- Physical volume ---
PV Name /dev/sda3
VG Name pve
PV Size 223.45 GiB / not usable 4.57 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 57201
Free PE 0
Allocated PE 57201
PV UUID 0VrZtf-rXJ7-a4K1-dDcA-dibn-iyJM-gYxRh2

--- Physical volume ---
PV Name /dev/sdb1
VG Name pve
PV Size 1.82 TiB / not usable 4.09 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 476931
Free PE 4058
Allocated PE 472873
PV UUID Z1qe2R-VK4E-7rRI-Nh1k-dTvs-dN7s-LDf5SV

root@proxmox:/# vgdisplay
--- Volume group ---
VG Name pve
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 2134
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 9
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 2.04 TiB
PE Size 4.00 MiB
Total PE 534132
Alloc PE / Size 530074 / 2.02 TiB
Free PE / Size 4058 / 15.85 GiB
VG UUID ue4B2F-0Emr-pi1q-CM5t-gjQH-eKRQ-CViGUH

root@proxmox:/# lvdisplay
--- Logical volume ---
LV Path /dev/pve/swap
LV Name swap
VG Name pve
LV UUID JHv2Lz-9bTJ-d2NL-qS3o-W2km-p4dZ-2fs6Rp
LV Write Access read/write
LV Creation host, time proxmox, 2016-09-29 22:28:37 -0500
LV Status available
# open 2
LV Size 8.00 GiB
Current LE 2048
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 251:1

--- Logical volume ---
LV Path /dev/pve/root
LV Name root
VG Name pve
LV UUID 9kw7Lm-e8Tx-eAKq-0Mhj-wU40-JOOK-uHnlYU
LV Write Access read/write
LV Creation host, time proxmox, 2016-09-29 22:28:37 -0500
LV Status available
# open 1
LV Size 55.75 GiB
Current LE 14272
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 251:0

--- Logical volume ---
LV Name data
VG Name pve
LV UUID 1EZdsO-xz43-e2nD-2e9x-OFsY-CBE7-srMhz0
LV Write Access read/write
LV Creation host, time proxmox, 2016-09-29 22:28:37 -0500
LV Pool metadata data_tmeta
LV Pool data data_tdata
LV Status available
# open 7
LV Size 1.96 TiB
Allocated pool data 5.31%
Allocated metadata 40.92%
Current LE 513718
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 251:4

Where /dev/sdb1 is the 2TB drive I attempted to extend onto from /dev/mapper/pve-data.

In the GUI, local-lvm (which appears to be /dev/mapper/pve-data) looks like it contains only my VMs/LXCs. As an alternative to attempting to fix what I did above, is there an easy way to scrap pve-data, rebuild onto /dev/sda3 (the original disk it was sitting on) and then copy my VMs/LXCs back over (and then add the 2TB drive as a separate volume like I should have before)?

thanks,
chris
 
An alternative, but also not easy is the following link. You definitely need backups of your VMs/LXCs.
https://pve.proxmox.com/wiki/Proxmox_VE_4.x_Cluster#Re-installing_a_cluster_node
Thanks for the suggestion and link to the article - it was much easier than I thought to reinstall. I reinstalled on the ssd and created a new physical volume and new volume group on the 2TB drive and moved my vms/lxcs to it. I used this article https://pve.proxmox.com/wiki/Logical_Volume_Manager_(LVM)

Just to throw this question out, I attempted to install proxmox 5.0 (figuring I should install the latest version) on an intel s2600cp2j (purchased from natex, dual e5-2670, 128gb ram) and the install would hang at initiallizing ramdisk. I then installed 4.4 and attempted to upgrade from there with the same results (4.4 installed without issue).

I was curious if anyone else had a similar experience as above. I figure it's because I'm using a 5+ year old motherboard.

Thanks
chris
 
@han0522, please open a new thread for your install issue. Thanks.