Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inefficient disk usage by OS #40

Closed
dexter136 opened this issue Feb 12, 2022 · 5 comments
Closed

Inefficient disk usage by OS #40

dexter136 opened this issue Feb 12, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@dexter136
Copy link
Contributor

I am not sure if this can be fixed during installation, as I am not very well versed in ansible/rocky/lvm.

I found that the root directory of the nodes is limited to 70GB in size in all nodes I deployed - two with 256GB drives and one with a 512GB drive - and the /home directory is given the majority of the disk space. As longhorn uses the root volume for PVCs this leaves the majority of the disk unusable by longhorn.

I was able to resolve this manually by running the following to recreate the volume for /home with a smaller size and granting the newly available disk space to the root volume.

#Install  xfsdump and backup /home
yum -y install xfsdump
xfsdump -f /tmp/home.dump /home

#Unmount /home and remove the volume
umount /home
lvremove /dev/mapper/<vg name>-home

#Create a new volume for home, limited to 5GB, and restore the backup to it
lvcreate -L 5G -n home <vg name>
mkfs.xfs /dev/mapper/<vg name>-home
mount -a
xfsrestore -f /tmp/home.dump /home

#Extend the root volume to use the newly available space
lvextend -l +100%FREE /dev/<vg name>/root
xfs_growfs /dev/mapper/<vg name>-root
@khuedoan
Copy link
Owner

khuedoan commented Feb 13, 2022

Ohhh I didn't notice that, thank you!

Fixed in 0171288, it will not create a /home partition anymore (we don't store anything in there anyway), but you will need to replace the nodes one by one (just added the document in 056e906).

Before:

NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0 119.2G  0 disk
├─sda1               8:1    0   600M  0 part /boot/efi
├─sda2               8:2    0     1G  0 part /boot
└─sda3               8:3    0 117.7G  0 part
  ├─rl_metal0-root 253:0    0    70G  0 lvm  /
  ├─rl_metal0-swap 253:1    0   7.9G  0 lvm  [SWAP]
  └─rl_metal0-home 253:2    0  39.8G  0 lvm  /home

After:

NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0 119.2G  0 disk
├─sda1               8:1    0   600M  0 part /boot/efi
├─sda2               8:2    0     1G  0 part /boot
└─sda3               8:3    0 117.7G  0 part
  ├─rl_metal3-root 253:0    0    70G  0 lvm  /
  └─rl_metal3-swap 253:1    0   7.9G  0 lvm  [SWAP]

@khuedoan khuedoan added the enhancement New feature or request label Feb 13, 2022
@khuedoan
Copy link
Owner

khuedoan commented Feb 13, 2022

Hmmm just realized the root partition is still 70GB even without the /home partition, I'll need to check that.

@khuedoan
Copy link
Owner

We'll need something more advance like this https://dark.ca/2009/08/03/complex-partitioning-in-kickstart/

However I'm thinking of switching to Rook Ceph for better performance and use a separate partition for data.

@dexter136
Copy link
Contributor Author

Without the /home partition it is much easier to grow root:

lvextend -l +100%FREE /dev/<vg name>/root
xfs_growfs /dev/mapper/<vg name>-root

That feels like something that can be automated.

@khuedoan
Copy link
Owner

khuedoan commented Feb 19, 2022

Fully fixed in bce3291:

  • Remove LVM
  • Create boot (0.5GiB) and root (remaining) partitions manually instead of using automatic partitioning
root@all (4)[f:5]$ lsblk
metal0 | CHANGED | rc=0 >>
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 119.2G  0 disk
├─sda1   8:1    0   512M  0 part /boot/efi
└─sda2   8:2    0 118.8G  0 part /
metal1 | CHANGED | rc=0 >>
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 119.2G  0 disk
├─sda1   8:1    0   512M  0 part /boot/efi
└─sda2   8:2    0 118.8G  0 part /
metal2 | CHANGED | rc=0 >>
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 119.2G  0 disk
├─sda1   8:1    0   512M  0 part /boot/efi
└─sda2   8:2    0 118.8G  0 part /
metal3 | CHANGED | rc=0 >>
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 119.2G  0 disk
├─sda1   8:1    0   512M  0 part /boot/efi
└─sda2   8:2    0 118.8G  0 part /

image

This is subject to change since I may switch to Rook Ceph.

zanehala added a commit to zanehala/homelab that referenced this issue Mar 15, 2023
retX0 pushed a commit to retX0/homelab that referenced this issue Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants