LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Trying to expand / add storage to our Ubuntu 18.04 server (https://www.linuxquestions.org/questions/linux-server-73/trying-to-expand-add-storage-to-our-ubuntu-18-04-server-4175653967/)

cis4life 05-15-2019 01:53 PM

Trying to expand / add storage to our Ubuntu 18.04 server
 
Good Day,

I'm trying to expand the server storage on our Linux server. So a little back story. I'm a software engineer and develop mostly on Linux and mac. So I know linux (Ubuntu) but from a more software engineer point of view. I don't pretend to know many of the things when it comes to administering these servers. But I was tasked with adding 10tb of storage to our server that had currently 1. So this is what we did.
1.) For some reason they started by giving me 500gb to add. I was able to look up a tutorial and was able to add the 500gb without much problem using fdisk. Then I needed more. So they went ahead and gave me 10tb of storage.
2.) I went to tried to use fdisk to add the 10tb and saw that I couldn't do anything other than 2tb and I had to use something like gdisk. This is where the issues began.

The current system is currently all mbr. (/dev/sda) is the only volume / disk I have in the VM and it has some partition in the /dev/sda. This is where I'm confused... I tried converting the /dev/sda over to gpt but the system wouldn't boot. I revert back using a snap shot, and then tried to allow the VM to boot from EFI but that didn't work either. So I'm stuck with a disk with 11.3tb on it, but I don't know how to access the free space and create a partition(s) so that I could expand the storage.

FYI: I do have 2 (/dev/sda4 and 5) that are typed as Linux LVM. What are my options and please forgive my newish type questions. I feel that I'm overlooking something simple to handle this.

*** Here is what my fdisk -l prints out ***

Disk /dev/sda: 11.3 TiB, 12373800779776 bytes, 24167579648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x747b6714

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 83 Linux
/dev/sda2 1001470 2147481599 2146480130 1023.5G 5 Extended
/dev/sda3 3196059648 4294967294 1098907647 524G 83 Linux
/dev/sda4 2147481600 3196059647 1048578048 500G 8e Linux LVM
/dev/sda5 1001472 2147481599 2146480128 1023.5G 8e Linux LVM

Partition table entries are not in disk order.


Disk /dev/mapper/vhbdfcdocker1--vg-root: 1.5 TiB, 1634843230208 bytes, 3193053184 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vhbdfcdocker1--vg-swap_1: 976 MiB, 1023410176 bytes, 1998848 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

teckk 05-15-2019 02:30 PM

If you are partitioning a disk of 2 TiB or larger, you need to use GPT.

This is for arch, but has information
https://wiki.archlinux.org/index.php/Partitioning
https://wiki.archlinux.org/index.php/Parted
https://wiki.archlinux.org/index.php/File_systems

chrism01 05-16-2019 01:28 AM

Depends a bit on which VM system you are using eg kvm with libvirt:

1 this increases size of current disk https://www.maxoberberger.net/blog/2...-kvm-disk.html
2 This adds an extra disk https://www.cyberciti.biz/faq/how-to...virsh-command/ (for more examples, google "virsh attach-disk" )

Several different examples in Redhat docs as well

syg00 05-16-2019 02:21 AM

C'mon folks, read the initial post - the space has been provided as a single enlarged "disk". S?he even tried to convert it to gpt to get at the space.

The concise answer is there is no simple answer - if it were me I'd see if I could get the storage admins to revert the situation to as it was before, and provide the extra space as a separate disk. That can be added to the LVM environment much more simply. Whilst we're waiting, let's see this output.
Code:

sudo lsblk -f

cis4life 05-16-2019 09:19 AM

Exactly.

The disk is currently just 1 disk.

Here is the output you were looking for.

NAME FSTYPE LABEL UUID MOUNTPOINT
fd0
sda
├─sda1 ext2 1f052f23-e122-4271-9840-8a6fcf5a3c87 /boot
├─sda2
├─sda3
├─sda4 LVM2_member f2dA3R-gs3d-kzWV-mISs-z5tu-q5FJ-MypTkA
│ └─vhbdfcdocker1--vg-root ext4 b59b3302-f8a2-468b-ab83-9b7d7acb8512 /
└─sda5 LVM2_member LeDStt-BvbA-aZBN-4WWs-KXTW-lvY1-H4SHxF
├─vhbdfcdocker1--vg-root ext4 b59b3302-f8a2-468b-ab83-9b7d7acb8512 /
└─vhbdfcdocker1--vg-swap_1 swap 0c071441-ca2a-463c-a8bc-e0417b917245 [SWAP]
sr0

cis4life 05-20-2019 02:11 PM

Ok,

I now have a fresh server with the following...

/dev/sda
---/dev/sda1 - boot (i believe)
---/dev/sda2 = 2TB

/dev/sdb - 3TB Unallocated Space


Both are using LVM2 Physical Volumes

So, If I need to extend /dev/sda2 to now include all 3TB in /dev/sdb Is this where I can use LVM commands to extend /dev/sda2? if so, what steps or tutorials could I follow to do this.

Thanks for all the help thus far.

dc.901 05-20-2019 03:51 PM

Quote:

Originally Posted by cis4life (Post 5997243)
Ok,

I now have a fresh server with the following...

/dev/sda
---/dev/sda1 - boot (i believe)
---/dev/sda2 = 2TB

/dev/sdb - 3TB Unallocated Space


Both are using LVM2 Physical Volumes

So, If I need to extend /dev/sda2 to now include all 3TB in /dev/sdb Is this where I can use LVM commands to extend /dev/sda2? if so, what steps or tutorials could I follow to do this.

Thanks for all the help thus far.

Yep: https://www.tecmint.com/extend-and-r...lvms-in-linux/

syg00 05-21-2019 02:13 AM

If it's already a pv, you simply need to add it to the vg and expand the lv.


All times are GMT -5. The time now is 03:46 PM.