I installed raspbian on an sd card and then booted into a pi zero to do my required configuration and setup.
I then made an
.img off of this sd card which I'm planning to use in a manufacturing process.
In order to reduce burn time I made it about 3 GB using
Now when I burn the image to a new SD card I want to extend
rootfs to the full card length, so I'm running the following commands:
# echo -e "d\n2\nw\n" | fdisk /dev/sdc
# parted -s /dev/sdc unit B mkpart primary 50331648 100%
Where 50331648 was the start of
rootfs before deleting it, gotten from
parted -m /dev/sdc unit B print.
Then I run
resize2fs -p /dev/sdc
And I get
resize2fs 1.46.2 (28-Feb-2021)
resize2fs: Bad magic number in super-block while trying to open /dev/sdc
Couldn't find valid filesystem superblock.
All my searches led to primarily answers about centOS or non applicable scenarios. The only relevant question I found was that one, which also has no answers..
How can I do this?