Cannot use 1TB partition

mhammady

New Member
Sep 19, 2019
3
0
1
54
Hello,

I'm new to Proxmox, so excuse my question...

I have a 1TB disk that I need to use for backup (2 HDD 1TB each mirror raid)

Code:
 lsblk
NAME                         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                            8:0    0  2.7T  0 disk
├─sda1                         8:1    0 1007K  0 part
├─sda2                         8:2    0  512M  0 part
└─sda3                         8:3    0  2.7T  0 part
  ├─pve-swap                 253:0    0    8G  0 lvm
  ├─pve-root                 253:1    0   96G  0 lvm  /
  ├─pve-data_tmeta           253:2    0 15.8G  0 lvm
  │ └─pve-data-tpool         253:4    0  2.6T  0 lvm
  │   ├─pve-data             253:5    0  2.6T  0 lvm
  │   ├─pve-vm--108--disk--0 253:6    0   60G  0 lvm
  │   ├─pve-vm--106--disk--0 253:7    0   16G  0 lvm
  │   ├─pve-vm--113--disk--0 253:8    0  211G  0 lvm
  │   ├─pve-vm--115--disk--1 253:9    0   60G  0 lvm
  │   ├─pve-vm--110--disk--0 253:10   0   60G  0 lvm
  │   ├─pve-vm--111--disk--0 253:11   0   60G  0 lvm
  │   ├─pve-vm--115--disk--0 253:12   0   60G  0 lvm
  │   ├─pve-vm--112--disk--0 253:13   0   60G  0 lvm
  │   ├─pve-vm--109--disk--0 253:14   0   60G  0 lvm
  │   ├─pve-vm--102--disk--0 253:15   0   32G  0 lvm
  │   └─pve-vm--101--disk--0 253:16   0  100G  0 lvm
  └─pve-data_tdata           253:3    0  2.6T  0 lvm
    └─pve-data-tpool         253:4    0  2.6T  0 lvm
      ├─pve-data             253:5    0  2.6T  0 lvm
      ├─pve-vm--108--disk--0 253:6    0   60G  0 lvm
      ├─pve-vm--106--disk--0 253:7    0   16G  0 lvm
      ├─pve-vm--113--disk--0 253:8    0  211G  0 lvm
      ├─pve-vm--115--disk--1 253:9    0   60G  0 lvm
      ├─pve-vm--110--disk--0 253:10   0   60G  0 lvm
      ├─pve-vm--111--disk--0 253:11   0   60G  0 lvm
      ├─pve-vm--115--disk--0 253:12   0   60G  0 lvm
      ├─pve-vm--112--disk--0 253:13   0   60G  0 lvm
      ├─pve-vm--109--disk--0 253:14   0   60G  0 lvm
      ├─pve-vm--102--disk--0 253:15   0   32G  0 lvm
      └─pve-vm--101--disk--0 253:16   0  100G  0 lvm
sdb                            8:16   0  931G  0 disk
└─sdb1                         8:17   0  931G  0 part
sr0                           11:0    1 1024M  0 rom


when I tried to use this disk from Proxmox v6.0-4, I got that no disk available. I used fdisk to delete the partition, and ve was able to see it, but when it tries to format, I get the following error:

Code:
sudo /sbin/sgdisk /dev/sdb -U R
Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!

Invalid partition data!

Any idea what is wrong with this disk?

PS: It is blank so formating is an option...

Thank you
 
I'm always good with dd'ing the first couple blocks and sometimes re-attaching the disk.

In your case: dd if=/dev/urandom of=/dev/sdb bs=4k count=4096 status=progress && sync
That's always working, when i try to add disks, that we're used before, to get them as an OSD into the CEPH Pool.

Also, you could format it ext4, make an entry in the fstab to mount it to, let's say /mnt/backup of your proxmox server and configure the storage as directory for vzdump files in /mnt/backup

To do that you'll need to do this after the dd command:
Code:
mkfs.ext4 /dev/sdb
mkdir /mnt/backup
echo "/dev/sdb  /mnt/backup  ext4  noauto,rw,users 0 0" >> /etc/fstab
# Better would be to use the UUID for fstab. Find it like this:   ls -l /dev/disk/by-uuid/ | grep sdb
# Then the entry would be:   echo "/dev/disk/by-uuid/YOUR_FOUND_UUID  /mnt/backup  ext4  noauto,rw,users 0 0" >> /etc/fstab
pvesm add dir backup --content backup --path /mnt/backup

Please pay attantion to use the right Block Device. Otherwise you will destroy data.

Also note, that the drive will not be mounted automatically, since it is configured noauto.
This is to get your server to startup clean and smoothly.
 
Last edited:
  • Like
Reactions: Moayad
Can you not use gdisk and use option o to wipe the existing structure and create a new partition and then write then to disk?
This solution didn't work. After creating a new DOS partition, I tried to add a directory for backups on sdb but I got the following error in Proxmox:

command '/sbin/sgdisk -n1 -t1:8300 /dev/sdb' failed: exit code 2
 
I'm always good with dd'ing the first couple blocks and sometimes re-attaching the disk.

In your case: dd if=/dev/urandom of=/dev/sdb bs=4k count=4096 status=progress && sync
That's always working, when i try to add disks, that we're used before, to get them as an OSD into the CEPH Pool.

Also, you could format it ext4, make an entry in the fstab to mount it to, let's say /mnt/backup of your proxmox server and configure the storage as directory for vzdump files in /mnt/backup

To do that you'll need to do this after the dd command:
Code:
mkfs.ext4 /dev/sdb
mkdir /mnt/backup
echo "/dev/sdb  /mnt/backup  ext4  noauto,rw,users 0 0" >> /etc/fstab
# Better would be to use the UUID for fstab. Find it like this:   ls -l /dev/disk/by-uuid/ | grep sdb
# Then the entry would be:   echo "/dev/disk/by-uuid/YOUR_FOUND_UUID  /mnt/backup  ext4  noauto,rw,users 0 0" >> /etc/fstab
pvesm add dir backup --content backup --path /mnt/backup
Hello AKA,

The dd if=/dev/urandom of=/dev/sdb bs=4k count=4096 status=progress && sync didnt help. I tried to adding a directory immedietly after successfully runnig the dd comand, but also failed by Proxmox.


BUT, as soon as i formated using mkfs.ext4 /dev/sdb, Proxmox was able to use this "mounted" partion for backup...

Thank you for your and everyone help...
 

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!