Jump to content

Recommended Posts

Posted (edited)

Good day.

I built an image for SDCARD on the rockchip3568 board using the project
from here https://github.com/armbian/build
This framework creates an image for SDCARD, consisting of two
partitions:

1 - boot (Fat32 - 256 MiB)
2 - root file system (ext4)

(all remaining capacity on SDCARD, I use a 16GiB card)
I need a different, custom, file system partition.

How can I make three partitions, for example of these sizes:
1. boot - 256MiB
2. root - 2GiB
3. work - the entire remaining capacity of the SDCARD
while the size of the image file is not all 16GiB,
but 256MiB (boot) + 2Gib (root) + 256MiB (work) = 2.5GiB
and the last partition would take up all the remaining space on the card?

I managed to modify two scripts:
partitioning.sh and rootfs-to-image.sh
and, as I understood, to make the last partition for the entire remaining capacity of the card, when forming the script for marking
partitions for sfdisk (in the partitioning.sh file), you do not need to specify the size
of the partition, which is what I did. However, the desired result did not work.

Can someone help with this problem?
Thanks in advance.

 

Edited by Alexander iLminsky
  • Solution
Posted

check those files

/usr/lib/systemd/system/armbian-resize-filesystem.service
/usr/lib/armbian/armbian-resize-filesystem
 

Posted

It's worth noting that you don't have to necessarily change anything in the build process. As long as you plan to not insert partitions in the middle, you can:

  1. write the image to the card
  2. with parted, resize the root partition to whatever you want
  3. make a new partition
    1. If you want to have more than 4 partitions total, this works best with GPT partition table, but legacy msdos works too with a little more effort
  4. `fsck.ext4 -f /dev/foo` where foo is the root partition
  5. `resize2fs /dev/foo`
  6. after you have the machine booted, you can then mkfs the new partition [you could probably do it in advance of booting the system too]

I do this regularly, b/c I typically only partition about 1/2 or 1/4 of the SD card to leave the rest for wear-leveling.

 

Are you trying to do this as a one-off or are you trying to do it for a dozen or more SBCs of the same type?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines