Score:0

Not able to grow the partition of an img file

lc flag

I have an img file with below partition table

$ sudo parted tmp/disk.img 
GNU Parted 3.4
Using /tmp/disk.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model:  (file)
Disk /tmp/disk.img: 969MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      512B    67.1MB  67.1MB  primary  fat16        esp
 2      67.1MB  902MB   835MB   primary               boot
 3      902MB   969MB   67.1MB  primary  fat32

I have increased the disk using the dd command:

$ sudo dd if=/dev/zero bs=1M count=4096 >> /tmp/disk.img

now I need to increase the partition 3 using parted command:

$ sudo parted /tmp/disk.img resizepart 3 1300MB
Error: The location 1300MB is outside of the device /tmp/disk.img.

Can I get some clues on how to solve this issue?

hu flag
I’m voting to close this question because it is unrelated to Ubuntu or any of its derivatives.
BTR Naidu avatar
lc flag
can you help me know which is the right place to post such a query?
hu flag
You can just search for it, for example: https://superuser.com/questions/610819/how-to-resize-img-file-created-with-dd?noredirect=1 Was that so hard?
BTR Naidu avatar
lc flag
Thanks but the issue which you posted for reference is not exactly same. Here I want to grow, a fat32 (msdos) file system, unattended via a script. .. It has a different use case. If server fault is the right place then I can happy to post it there.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.