[update] @robb suggest to just increase the vdisk size in proxmox; and @fausp give detailed steps to increase the LVM partition inside the NS vm.
NethServer Version: 7.5.1804 (beta)
** Base OS:** Proxmox
** Hard disks:** 4HDD of 1 TB each with ZFS “raid 10”
How can add a new virtual disk, to mount as the /var partition, so it can be used to store the soon to be folders for my users, and to add more modules later.
Or (Hope not) I need to re-install the full nethserver and re-create the AD?
Maybe I can backup and restore all my users and groups to accomplish this task?
Of course I can delete and recreate the shared folders.
In case I need to reinstall everything. What is not so clear to me is how to tell to NS that I want to use one virtual disk for the root partition and other disk for the /var partition. I really don’t understand how to tame the anaconda on the disk setup.
If you use proxmox, as said by @mrmarkuz, you have to create that disk in proxmox. Then you can mount the new vdisk in your NethServer install as /var/lib/nethserver so your server data (shares and homedirs) will be on a separate vdisk.
But to be honest, since you are using proxmox, what benefit do you think to gain by creating an extra vdisk for data? Taking a snapshot and using your usual backup options in NethServer will at least be as safe as having the extra vdisk. Keep in mind that the extra vdisk is in the same ZFS pool as your vserver. So if your ZFS pool breaks, it doesn’t matter if you have an extra vdisk or not for data.
Thank you @mrmarkuz@robb :
I have more to learn with your posts.
maybe I wasn’t thinking correctly, I got some pressure here to get this server running at the first shot. With some little practice before of course, but I really want this to be the one in production.
I forgot about LVM; that I’m rarely touching ever; that’s why I asked how to add the disk in NS.
What If I go for the next option?
Increase the vdisk size of then VM from 50GB to 500GB (so I can take vm snapshots, etc in proxmox).
NS can detect and use the new size?
I need to do something in NS to use the new size?
# vgdisplay
--- Volume group ---
VG Name VolGroup
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <49.00 GiB
PE Size 4.00 MiB
Total PE 12543
Alloc PE / Size 12542 / 48.99 GiB
Free PE / Size 1 / 4.00 MiB
VG UUID Ci0PmN-UPop-0403-OgQp-RkUr-dNUT-njpDCZ
# lvdisplay
--- Logical volume ---
LV Path /dev/VolGroup/lv_root
LV Name lv_root
VG Name VolGroup
LV UUID vTEZSO-TXcH-jqCd-nrwb-UeRW-6qlz-MwPuGe
LV Write Access read/write
LV Creation host, time avion.lan, 2018-04-13 13:50:44 -0600
LV Status available
# open 1
LV Size 46.99 GiB
Current LE 12030
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
--- Logical volume ---
LV Path /dev/VolGroup/lv_swap
LV Name lv_swap
VG Name VolGroup
LV UUID 99OZhe-RSgF-6Ox4-qeGE-M0hf-h0N7-k31l2b
LV Write Access read/write
LV Creation host, time avion.lan, 2018-04-13 13:50:44 -0600
LV Status available
# open 2
LV Size 2.00 GiB
Current LE 512
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
-
Fill in how mani GiB you want to increase the vdisk and it’s done on the fly. In your case, you want to increase from 50GiB to 500GiB, you fill in 450GiB…
Yeah I already love it.
I tested before the “resize disk” option and it works, but not using NS.
Too many projects, options and work is a little overwhelming to keep the pace.
The backup is done, I keep reading your comments. Thank you!
I would say you have to resize the disk under NS now…
Did you activate the Qemu Agent under Proxmox? (click on the vm > Options > Qemu Agent). After that install the qemu-guest-agent under NS… I think you need to shutdown the vm to take affect…
I wonder if I just crippled my NS: I have installed the acpi/services a few hours ago; and right now the qemu-guest-agent.
Now, I try to shutdown the NS from proxmox and no, the vm is still running.
I forgot to test it
qm agent 100 ping
that test don’t give me an output
/edit: The wiki says: "if the qemu-guest-agent is correctly runnning in the VM, it will return without an error message. " its official, I’m tired.
Lets say we have a NS7-VM under Proxmox 5.x and we want to increase the disk size from 500 up to 2000.
1. Click on the NS7-VM > Hardware > Hard Disk (xxx) > Resize disk > 1500
2. fdisk /dev/sda > p > d > 2 > n > p > 2 > First sector <Enter> > Last sector <Enter> w
3. pvresize /dev/sda2
4. lvresize -l +100%FREE /dev/VolGroup/lv_root
5. xfs_growfs /dev/VolGroup/lv_root
Lets say we have a NS7-VM under Proxmox 5.x and we want to increase the disk size from 500 up to 2000.
Under the Proxmox GUI:
1. Click on the NS7-VM > Hardware > Hard Disk (xxx) > Resize disk > 1500
On the NS7 Console:
2. fdisk /dev/sda > p > d > 2 > n > p > 2 > First sector <Enter> > Last sector <Enter> w
3. reboot the server If you get this:
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
4. pvresize /dev/sda2
5. lvresize -l +100%FREE /dev/VolGroup/lv_root
6. xfs_growfs /dev/VolGroup/lv_root