etcher icon indicating copy to clipboard operation
etcher copied to clipboard

Feature request: option to resize partitions/filesystems on disk to fill available space

Open tkfu opened this issue 7 years ago • 10 comments

  • Etcher version: All
  • Operating system and architecture: All
  • Image flashed: Raw disk images
  • Do you see any meaningful error information in the DevTools? n/a

Use case for this feature request: I have a build process whose output artefact is a raw disk image with two partitions. This image then gets flashed onto boot media of various sizes. Since the size isn't known ahead of time, the image can't be pre-sized to the boot media. That means the process for flashing looks like this, resizing the partition with parted and then the filesystem with e2fstools:

etcher my-image.img # or dd if=my-image.img of=/dev/sdX if you're feeling dangerous
parted -s /dev/sdX resizepart 2 '100%'
resize2fs /dev/sdX2

Could this be implemented as part of Etcher? For the UI, perhaps a check-box for 'Attempt to maximize partition size', and a similar command line option?

tkfu avatar May 18 '17 12:05 tkfu

I'm fairly sure we discussed this before somewhere, but Github search isn't finding the right issue discussion for me...

Etcher simply copies the disk image byte-perfect onto the destination drive, and doesn't mess about with the partition tables at all. So I dunno if we'll be adding this feature anytime soon. In the meantime, perhaps you could use the same workaround that Raspbian uses, where it automatically enlarges the root partition the first time it boots up?

lurch avatar May 18 '17 12:05 lurch

I would also be interested in seeing this.

probonopd avatar Dec 02 '17 10:12 probonopd

I'm fairly sure we discussed this before somewhere...

Aha, here's the other place where it was being discussed: https://github.com/resin-io/etcher/issues/413#issuecomment-263056113

lurch avatar Dec 02 '17 11:12 lurch

I considder this to be a usefull feature as well (and would like to see it?)

GuBi34 avatar Oct 08 '18 08:10 GuBi34

Would be a(nother) possibile workaround to https://github.com/balena-os/balena-os/issues/396.

daghemo avatar Jan 15 '19 14:01 daghemo

This is surprisingly a pain in the butt on macOS, etcher having this feature would be fantastic, as my SD cards rarely match the image size that comes with the image, and you can't really do it from the running image.

bcomnes avatar Feb 04 '19 19:02 bcomnes

This would be an amazing feature to add!

scottrpaterson avatar Sep 07 '20 02:09 scottrpaterson

I ended up finding a way to set this up outside of balena by modifying images with packer.

Script that does it: https://github.com/bcomnes/raspi-packer/blob/master/resizerootfs

Lifecycle script that runs it (systemd): https://github.com/bcomnes/raspi-packer/blob/master/resizerootfs.service

bcomnes avatar Sep 07 '20 15:09 bcomnes

Syncloud project is willing to pay for this feature £100 even if it is a Linux only option, job proposal is published at upwork.com

cyberb avatar Feb 14 '21 22:02 cyberb

This would be a great feature to have!

lowlydba avatar Mar 17 '23 15:03 lowlydba