How to resize an Easy***.img file ?

Moderator: BarryK

Post Reply
Caramel
Posts: 476
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 100 times
Been thanked: 78 times

How to resize an Easy***.img file ?

Post by Caramel »

This question is particulary for BarryK and follow the message https://www.forum.puppylinux.com/viewto ... 399#p81399

In https://bkhome.org/news/202302/mount-im ... write.html , it is explained how to mount read-write an easy image drive but not how to enlarge the part with the folder /easyos .
I've searched in vain on internet.

Thank for your help.

Last edited by Caramel on Fri Mar 03, 2023 7:19 pm, edited 1 time in total.
Caramel
Posts: 476
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 100 times
Been thanked: 78 times

Re: How to resize an Easy***.img file ?

Post by Caramel »

Method under test :

Commands to execute In the directory where is located (a copy of) easy-5.0-amd64.img to enlarge it to 1G

- (optional) fdisk -l easy-5.0-amd64.img display informations on the partitions on the drive image

Disque easy-5.0-amd64.img : 825 MiB, 865075200 octets, 1689600 secteurs
Unités : secteur de 1 × 512 = 512 octets
Taille de secteur (logique / physique) : 512 octets / 512 octets
taille d'E/S (minimale / optimale) : 512 octets / 512 octets
Type d'étiquette de disque : dos
Identifiant de disque : 0x07c66c81

Périphérique Amorçage Début Fin Secteurs Taille Id Type
easy-5.0-amd64.img1 * 2048 16383 14336 7340032 ef EFI (FAT-12/16/
easy-5.0-amd64.img2 16384 1687551 1671168 855638016 83 Linux

- truncate -s 1G easy-5.0-amd64.img (extend the size to 1GB)

- fdisk easy-5.0-amd64.img (to modify the partition table)
then type d, type enter to delete the partition 2
then type n, type enter 4 times to create the partition 2 with maximum size

fdisk asks if we want to delete the signature. Reply N
(optional) type p for verify the table partions after the modification

Périphérique Amorçage Début Fin Secteurs Taille Id Type
easy-5.0-amd64.img1 * 2048 16383 14336 7340032 ef EFI (FAT-12/16
easy-5.0-amd64.img2 16384 2097151 2080768 1065353216 83 Linux

type w to save the new table and quit fdisk.

We can now verify the size of easy-5.0-amd64.img (1024MB -> OK)
We click on easy-5.0-amd64.img to mount it read-only
The 2nd partition is probably mount with dev/loop2 (cat /etc/mtab to verify , it's the line /dev/loop2 /tmp/mount-img-2-ext4-loop2 ext4 ro,relatime 0 0)

blkid /dev/loop2
/dev/loop2: LABEL="easy2" UUID="328ed5c2-b561-11ed-ae4d-287fcfeb4376" BLOCK_SIZE="4096" TYPE="ext4"

The UUID has not changed

I'll test the img file in ventoy.

Last edited by Caramel on Fri Mar 03, 2023 7:20 pm, edited 1 time in total.
Caramel
Posts: 476
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 100 times
Been thanked: 78 times

Re: How to resize an Easy***.img file ?

Post by Caramel »

The easy-5.0 img file enlarged don't work with ventoy.

So i tested with the original easy-5.0-amd64.img. Don't work too (whereas easy-4.5.5 work)

Last edited by Caramel on Fri Mar 03, 2023 7:20 pm, edited 1 time in total.
Caramel
Posts: 476
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 100 times
Been thanked: 78 times

Re: How to resize an Easy***.img file ?

Post by Caramel »

My conclusions for this topic:

-The method for enlarge the 2nd partition in a easy***.img file seems work. (EDIT : not works)

-The last version of ventoy (1.0.88) is not compatible with easy5.0***.img

-The mehod for install easy on a ventoy key explained in https://www.forum.puppylinux.com/viewto ... 625#p81625 is still working

Last edited by Caramel on Sat Mar 04, 2023 1:21 pm, edited 1 time in total.
User avatar
BarryK
Posts: 2695
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 132 times
Been thanked: 738 times

Re: How to resize an Easy***.img file ?

Post by BarryK »

Looking through the above steps, you have increased the size of the working-partition, however you haven't increased the ext4 filesystem to fill the partition.

In a drive with working-partition /dev/sdb2:

Code: Select all

# resize2fs -f /dev/sdb2
Caramel
Posts: 476
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 100 times
Been thanked: 78 times

Re: How to resize an Easy***.img file ?

Post by Caramel »

BarryK wrote: Fri Mar 03, 2023 11:40 pm

Looking through the above steps, you have increased the size of the working-partition, however you haven't increased the ext4 filesystem to fill the partition.

In a drive with working-partition /dev/sdb2:

Code: Select all

# resize2fs -f /dev/sdb2

You're right.
Fdisk change only the table of partitions, not modify the format of the partitions.

I'll test with parted

Caramel
Posts: 476
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 100 times
Been thanked: 78 times

Re: How to resize an Easy***.img file ?

Post by Caramel »

I don't succeed with parted. I give up.

Post Reply

Return to “EasyOS”