oci-utils icon indicating copy to clipboard operation
oci-utils copied to clipboard

[enhancement] extend OS support: ubuntu

Open davidkhala opened this issue 4 years ago • 17 comments

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

davidkhala avatar May 13 '21 01:05 davidkhala

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

davidkhala avatar May 13 '21 02:05 davidkhala

I second this, would be very useful.

axtonpitt avatar Jun 29 '21 23:06 axtonpitt

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

axtonpitt avatar Jun 30 '21 01:06 axtonpitt

@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.

davidkhala avatar Jun 30 '21 01:06 davidkhala

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.

KingPin avatar Sep 24 '21 12:09 KingPin

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?

davidkhala avatar Sep 24 '21 12:09 davidkhala

Hi @davidkhala thank you for responding.

  • I cloned this repo
  • ran the libexec/oci-growfs command.

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.

KingPin avatar Sep 24 '21 12:09 KingPin

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

guidotijskens avatar Sep 24 '21 12:09 guidotijskens

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 💯

KingPin avatar Sep 24 '21 14:09 KingPin

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

mrbluecoat avatar Feb 09 '22 01:02 mrbluecoat

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

guidotijskens avatar Feb 09 '22 08:02 guidotijskens

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.

Frederick888 avatar Apr 14 '22 09:04 Frederick888

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

seffignoz avatar Apr 15 '22 17:04 seffignoz

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?

davidkhala avatar Dec 11 '22 04:12 davidkhala

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

Frederick888 avatar Dec 11 '22 13:12 Frederick888

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

seliver avatar Mar 14 '23 19:03 seliver

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!

candlewill avatar May 24 '23 05:05 candlewill