It looks like it boils down to 3 steps:
1) Use truncate(1) to increase the file size (by 5 gigs):
$ truncate -s +5G foo.img
2) Use fdisk to delete and re-create the partition:
$ fdisk foo.img
(interactively, delete and re-create the second partition)
3) Use resize2fs to enlarge the filesystem. First, use losetup to map a loop device to the partition:
$ loopdev=$(losetup -fP --show foo.img)
$ resize2fs ${loopdev}p2
$ losetup -d $loopdev
That all look OK?
1) Use truncate(1) to increase the file size (by 5 gigs):
$ truncate -s +5G foo.img
2) Use fdisk to delete and re-create the partition:
$ fdisk foo.img
(interactively, delete and re-create the second partition)
3) Use resize2fs to enlarge the filesystem. First, use losetup to map a loop device to the partition:
$ loopdev=$(losetup -fP --show foo.img)
$ resize2fs ${loopdev}p2
$ losetup -d $loopdev
That all look OK?
Statistics: Posted by BigRedMailbox — Thu Dec 19, 2024 1:36 am