Resize partitions on live systems

Hi

I tried this by NFS booting with our V2.7 image and installing parted from the angstrom feeds.
One try was successful, one ended also in a segmentation fault, e.g.:

root@colibri-imx6:~# umount /dev/mmcblk0p2                                      
root@colibri-imx6:~# fsck.ext3 /dev/mmcblk0p2                                   
e2fsck 1.43 (17-May-2016)                                                       
rootfs contains a file system with errors, check forced.                        
...                               
rootfs: 23117/192640 files (2.7% non-contiguous), 127020/885760 blocks          
root@colibri-imx6:~# resize2fs /dev/mmcblk0p2 900M                              
resize2fs 1.43 (17-May-2016)                                                    
Resizing the filesystem on /dev/mmcblk0p2 to 230400 (4k) blocks.                
Segmentation fault (core dumped)                                                

After upgrading to e2fsprogs 1.43.4 in openembedded-core which includes the patch Stefan referenced the resizing worked. e.g:

[layers/openembedded-core]$ git cherry-pick 8b9668c b51bb93

And rebuilding the image.

Then with NFS (or initramfs boot):

root@colibri-imx6:~# umount /dev/mmcblk0p2

root@colibri-imx6:~# e2fsck -f /dev/mmcblk0p2
e2fsck 1.43 (17-May-2016)
...
rootfs: 23117/192640 files (2.7% non-contiguous), 127020/885760 blocks

root@colibri-imx6:~# resize2fs /dev/mmcblk0p2 900M
resize2fs 1.43.3 (04-Sep-2016)
Resizing the filesystem on /dev/mmcblk0p2 to 230400 (4k) blocks.
The filesystem on /dev/mmcblk0p2 is now 230400 (4k) blocks long.

root@colibri-imx6:~# parted /dev/mmcblk0
GNU Parted 3.2
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: MMC 004GE0 (sd/mmc)
Disk /dev/mmcblk0: 3959MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      4194kB  21.0MB  16.8MB  primary  fat16        lba
 2      21.0MB  3649MB  3628MB  primary  ext3

(parted) resizepart 2 1200MB                                              
Warning: Shrinking a partition can cause data loss, are you sure you want to
continue?
Yes/No? Yes                                                               
(parted) mkpart p ext3 1200MB 3800MB                                                                                                                                                                                                                                             
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? i                                                          
(parted) print                                                            
Model: MMC 004GE0 (sd/mmc)
Disk /dev/mmcblk0: 3959MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      4194kB  21.0MB  16.8MB  primary  fat16        lba
 2      21.0MB  1200MB  1179MB  primary  ext3
 3      1200MB  3800MB  2600MB  primary  ext3         lba

(parted) q                                                                
Information: You may need to update /etc/fstab.

root@colibri-imx6:~# mkfs.ext3 /dev/mmcblk0p3
mke2fs 1.43 (17-May-2016)
/dev/mmcblk0p3 contains `zlib compressed data' data
Proceed anyway? (y,n) y
Discarding device blocks: done                            
Creating filesystem with 634765 4k blocks and 158720 inodes
Filesystem UUID: 494e2c56-cbd6-4c7b-8ded-88d7ae4e92c8
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done 

root@colibri-imx6:~# 

After a reboot with the rootfs from the eMMC:

root@colibri-imx6:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root               891352    442844    434204  50% /
...
/dev/mmcblk0p1           16334      4942     11392  30% /media/mmcblk0p1
/dev/mmcblk0p3         2433636      3788   2302896   0% /media/mmcblk0p3
tmpfs                    50964         0     50964   0% /run/user/0