oracle / oci-utils

Oracle Cloud Infrastructure utilities
https://cloud.oracle.com/
Universal Permissive License v1.0
46 stars 20 forks source link

[enhancement] extend OS support: ubuntu #136

Open davidkhala opened 3 years ago

davidkhala commented 3 years ago

It will be great that if we can provide a guideline to install oci-utils on Ubuntu or debian-like system.

davidkhala commented 3 years ago

Per my experiment, libexec/oci-growfs works on ubuntu by its own but not so graceful

axtonpitt commented 3 years ago

I second this, would be very useful.

axtonpitt commented 3 years ago

@davidkhala did using libexec/oci-growfs work with another file system like ext4 (rather than XFS)?

davidkhala commented 3 years ago

@davidkhala did using libexec/oci-growfs work with another file system like ext4 (rather than XFS)?

I am not file system expert to give accurate advice. But since ext4 is default in Debian, and my experiment environment did not change the default, it should work.

KingPin commented 2 years ago

Hi David I just tried running growfs and got this error on ubuntu : xfs_growfs: / is not a mounted XFS filesystem

was there a workaround or a flag you used to get it to work on ubuntu?

thank you.

davidkhala commented 2 years ago

Hi David I just tried running growfs and got this error on ubuntu : xfs_growfs: / is not a mounted XFS filesystem

was there a workaround or a flag you used to get it to work on ubuntu?

thank you.

Hi @KingPin,

What are the full steps to reproduce it?

KingPin commented 2 years ago

Hi @davidkhala thank you for responding.

I saw no flags to be used with it so I simply used the command as is. it asked me if I wanted to resize, once I said yes it threw the error out at the end.

guidotijskens commented 2 years ago

oci-utils is not supported on Ubuntu or Debian, has not been tested. tx. Guido

KingPin commented 2 years ago

ok well just for any future google searchers ending up here, the error I posted above seems to be a warning and not an error. after a backup (please always backup) and a reboot the resizing seems to have been successful.

thanx @davidkhala for experimenting on this so I had the courage to try it out 💯

mrbluecoat commented 2 years ago

FYI, oci-growfs didn't work for me on Ubuntu but this guide did.

guidotijskens commented 2 years ago

oci-growfs only handled xfs file systems; support for ext4 is in next release, support for Debian/Ubuntu is on the table but not yet decided. Guido

Frederick888 commented 2 years ago

The script internally calls growpart from cloud-guest-utils and resize2fs. So if you are not using LVM etc, to grow main ext4 partition of a boot volume in Ubuntu, simply run:

sudo growpart /dev/sda 1
sudo resize2fs -z ./sda1.e2undo /dev/sda1

Since Oracle puts the boot partition after main, to be safe you can also install efibootmgr and check efibootmgr -v output. If yours also looks like

Boot0002* UEFI ORACLE BlockVolume       PciRoot(0x0)/Pci(0x12,0x7)/Pci(0x0,0x0)/SCSI(0,1)N.....YM....R,Y.

then it means it uses SCSI disk/partition number to locate boot partition and it should be safe to reboot now.

seffignoz commented 2 years ago

@Frederick888 Thank you, that worked flawlessly and you saved me a lot of headaches.

davidkhala commented 1 year ago
sudo resize2fs -z ./sda1.e2undo /dev/sda1

@Frederick888 If we don't want to keep a undo back up, can we skip the option -z ./sda1.e2undo here?

Frederick888 commented 1 year ago

@davidkhala If it's what you want ¯\_(ツ)_/¯

seliver commented 1 year ago

This repo works for me on Ubuntu 22.04 out of the box. Had to do the following:

git checkout url-of-the-repo
cd oci-utils
python3 ./setup.py build
sudo python3 ./setup.py install
# the following will expand your volume(s)
sudo ./libexec/oci-growfs
candlewill commented 1 year ago

This repo works for me on Ubuntu 22.04 out of the box. Had to do the following:

git checkout url-of-the-repo
cd oci-utils
python3 ./setup.py build
sudo python3 ./setup.py install
# the following will expand your volume(s)
sudo ./libexec/oci-growfs

This worked. Thank you!