Adding a physical drive to storage

Cecil

Well-Known Member
Sep 22, 2017
57
2
48
45
I went through the guides I could find to add a drive and it sort of worked but after a reboot I lost one.

Can someone please give me some idea's of what I did wrong here.

So I have:
Disk /dev/sda: 18.2 TiB, 19999998607360 bytes, 39062497280 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 327680 bytes
Disklabel type: gpt
Disk identifier: F1BF1E7F-252A-42FB-AEF8-292DD5F820BD

Device Start End Sectors Size Type
/dev/sda1 2048 1048578047 1048576000 500G Linux filesystem
/dev/sda2 1048578048 39062497246 38013919199 17.7T Linux filesystem


Disk /dev/sdb: 29.8 GiB, 31949914112 bytes, 62402176 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: FC775497-BBD3-4F09-B150-F5C5E259BD52

Device Start End Sectors Size Type
/dev/sdb1 2048 4095 2048 1M BIOS boot
/dev/sdb2 4096 528383 524288 256M EFI System
/dev/sdb3 528384 62402142 61873759 29.5G Linux LVM

sdb is where proxmox is installed.

sda is a Raid5 volume where I want wall my VM's to run on.
I created a smaller 500Gb partition sda1 for just storing all the ISO files.

sda2 is the rest of the volume for the containers and its working as intended, however I added sda1 as a "directory" to storage pointing directly to /dev/sda1 and it worked until a reboot.

I'm pretty sure I need to add sda1 (and maybe sda2) somewhere to fstab to be mounted properly and then change the ISO storage directory t the new mount point but I cannot find enough info to figure this one out.

Right now this is what I see when I click on the iso content tab:
mkdir /dev/sda1: File exists at /usr/share/perl5/PVE/Storage/DirPlugin.pm line 106. (500)
 
OH forgot one more thing, when i do:

# pvdisplay /dev/sda1
"/dev/sda1" is a new physical volume of "500.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sda1
VG Name
PV Size 500.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID qjVifx-rdbN-Cfdk-TtMw-YEqt-CFBH-fe8nyp

Allocate is set to NO, is this why its not working anymore?
 
OH forgot one more thing, when i do:

# pvdisplay /dev/sda1
"/dev/sda1" is a new physical volume of "500.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sda1
VG Name
PV Size 500.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID qjVifx-rdbN-Cfdk-TtMw-YEqt-CFBH-fe8nyp

Allocate is set to NO, is this why its not working anymore?


Is sda1 a physical volume for LVMs?

If yes: you have to create an LVM with a filesystem on it an mount it then as usual (e.g. as /mnt/sda1) - afterwards specify it as storage type "directory"; fstab entry:

Code:
/dev/mapper/<vg>/<lv> /mnt/sda1 ext4 defaults 0 0

If no: probably a filesystem exists in the partition /dev/sda1 - mount the partition directly (rest as above)
; fstab entry:

Code:
/dev/sda1 /mnt/sda1 ext4 defaults 0 0


Strange how it worked before - maybe the ISO storage was interpreted to reside in root mount point /dev/sda1 as a directory which will not work any more when a block device with that name exists.
 
When there is a release of proxmox 5.1 I'm probably going to just re-do everything.

I got it to work somehow but initially I could not get sda1 to mount at all, there was some kind of problem with the filesystem or partition or something.
I deleted the whole thing and followed some random guide online to re-create the partition and re-format it and then I was able to mount it, but I just mounted it to /media soo probably not ideal haha.

I still don't quite understand LVM correctly and right now i have two LVM's , the one proxmox is installed on(with ssd's) and the other one made up of hdds.

Is there some kind of best practice guide on setting up the storage when there are two separate hardware raid drives from the start?
 
Recommended (when you start from scratch):

- install Proxmox at one of the drives

- after installed create an LVM VG (not a volume, that will be done by creating virtual machines) at the other drive (see e.g. https://www.howtoforge.com/linux_lvm)

- define the new LVM VG as Storage type "LVM" in Proxmox