I believe that kind of custom partitioning has to happen as part of your provisioning scripts. Packer won't do it for you.
On Wed, Nov 20, 2019 at 2:19 PM Samvitha K <[email protected]> wrote: > Once you expand the root disk i.e. /dev/xvda to desired size, may i know > how to create custom filesystem partitions (/var, /home/, /var/log etc) on > a AWS EBS disk during boot process using hashicorp packer? Is it possible > and did anyone try this? > > On Friday, August 18, 2017 at 9:49:06 AM UTC+12, > [email protected] wrote: >> >> Hi, >> >> Really sorry to be asking this because I can see there are previous >> threads, e.g. "Configuring size of root volume on EC2" but they actually >> don't provide a clear answer and neither do the docs. >> >> I'm building an AMI using the amazon-ebs builder. The reference AMI is a >> Debian stretch image with an 8GB root volume. The source images use >> /dev/xvda1 as the root partition. >> >> I'd like my packer image to have a much larger volume, e.g. 40GB. >> Previous threads indicate this should be possible by adding: >> >> "ami_block_device_mappings": [ { >> "device_name": "/dev/xvda", >> "volume_size": 40, >> "delete_on_termination": true >> } ], >> "launch_block_device_mappings": [ { >> "device_name": "/dev/xvda", >> "volume_size": 40, >> "delete_on_termination": true >> } ] >> >> It's not clear to me what the distinction between >> ami_block_device_mappings and launch_block_device_mappings is. What what I >> understand of the docs they should be used when I want to add additional >> devices beyond the root vol, but the discussion in the other thread >> suggests using the code above is used to modify the root volume size. >> >> I don't fully understand what it's doing, but more to the point, I can't >> make it work. >> >> The reference image boots from /dev/xvda1, so presumably I need >> >> "device_name": "/dev/xvda" >> >> >> but that throws this error: >> >> The device 'xvda' is used in more than one block-device mapping >> >> So, what device should I use is the source AMI is using /dev/xvda1 as >> root partition and what the difference between the two mappings? >> >> (I know I may need to deal with fs resize, but I'll get to that when it's >> a problem) >> >> Many Thanks, >> >> Rich >> > -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/packer-tool/310d491b-ee58-4626-adf4-3e071b0469fe%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/310d491b-ee58-4626-adf4-3e071b0469fe%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAGPV1uqgVU6sgG9ZVYyThvEA4rL0k4o20fWtOjuqUYNYxgU%2B0Q%40mail.gmail.com.
