Howto resize on x86 ext4-combined-efi.img.gz?

is not suitable for ...-x86-64-generic-ext4-combined-efi.img.gz

I installed by PXE boot Centos

cd /tmp
wget https://downloads.openwrt.org/releases/22.03.0/targets/x86/64/openwrt-22.03.0-x86-64-generic-ext4-combined-efi.img.gz
gunzip openwrt-22.03.0-x86-64-generic-ext4-combined-efi.img.gz
dd if=openwrt-22.03.0-x86-64-generic-ext4-combined-efi.img.gz bs=1M of=/dev/sda

fdisk -l >>> shows only one GPT partition
sgdisk -e /dev/sda >>> then I have 3 partions, and can resize sda2 as usual.
.
e2fsck -f /dev/sda2
resize2fs /dev/sda2

at reboot grub is ok , but boot will stuck

if I reboot without e2fsck -f /dev/sda2 & resize2fs /dev/sda2 boot is ok, but I cannot resize fs because it is mounted.

how can I resize ( and maybe update grub with new GUID/UUID ??? )

You'd have to flash the image, not copy TFTP transfer.

I'm not certan about the details of your resize inquiry; but I'm sure that can it only be one with the EXT4.

If you have several OS:es installed, don't use the combined image.

Put the kernel file in /boot of the other Linux, dd the ext4 openwrt root FS to a new partition, and do a resize2fs of it afterwards.

Modify the grub conf, and add the new entry for openwrt.

You're doing Sysupgrade help for x86_64 - #14 by frollic, but your primary os isn't openwrt.

assuming /dev/sda2 is your root

opkg install resize2fs tune2fs
mount -o remount,ro / #Remount root as ReadOnly 
tune2fs -O^resize_inode /dev/sda2 #Remove reserved GDT blocks 
fsck.ext4 -f /dev/sda2 #Fix part, answer yes to remove GDT blocks remnants
change UUID in /boot/grub/grub.cfg (imho better to use /dev/sda2)
reboot 
resize2fs /dev/sda2

I have only one OS - openwrt installed , the centos is on a NFS share , and booted by pxe to flash the openwrt image.

root@OpenWrt:~# fsck.ext4 -f /dev/sda2
e2fsck 1.46.5 (30-Dec-2021)
/dev/sda2 is mounted.
e2fsck: Cannot continue, aborting.
root@OpenWrt:~# fdisk -l
Disk /dev/sda: 59.63 GiB, 64023257088 bytes, 125045424 sectors
Disk model: 64GB SATA Flash
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: gpt
Disk identifier: 266B958D-769A-BCBD-AA7B-1BAC46AB8600

Device      Start       End   Sectors  Size Type
/dev/sda1     512     33279     32768   16M Linux filesystem
/dev/sda2   33280 125045390 125012111 59.6G Linux filesystem
/dev/sda128    34       511       478  239K BIOS boot

Partition table entries are not in disk order.
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               126.3M     26.0M     97.8M  21% /
tmpfs                     3.8G     72.0K      3.8G   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev

If you're lazy, boot gparted off an USB drive, and be done with it.

1 Like

its headless
donig it from remote , I would call lazy

what about booting from pxe to centos
e2fsck -f /dev/sda2
resize2fs /dev/sda2
then chroot and fix grub ?

You need to resize the partition, too.

Delete the old, create the new (larger), save, and resize.

1 Like
[root@centos ~]# resize2fs /dev/sda2
resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/sda2' first.

[root@centos ~]# e2fsck -f /dev/sda2
e2fsck 1.42.9 (28-Dec-2013)
Filesystem does not have resize_inode enabled, but s_reserved_gdt_blocks
is 7; should be zero.  Fix<y>? yes
Resize_inode not enabled, but the resize inode is non-zero.  Clear<y>? yes
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -(2--8) -427
Fix<y>? yes
Free blocks count wrong for group #0 (25661, counted=25669).
Fix<y>? yes
Free blocks count wrong (25661, counted=25669).
Fix<y>? yes

rootfs: ***** FILE SYSTEM WAS MODIFIED *****
rootfs: 1716/6656 files (0.0% non-contiguous), 7099/32768 blocks
[root@centos ~]#

resize2fs /dev/sda2

working without grub update this time