Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Shrink boot partition on SD card

Featured Replies

Hi,

following the documentation, I used

nand-sata-install

to

  • boot from SD, system on SATA / USB

without any problems. My backup solution (raspiBackup.sh) now creates a 16GB image for the SD card, even if it is just used to boot.

Is it possible to shrink the partition?

 

Thank you

René

Here is how to shrink an existing image.

In "gparted", do "edit/resize" of the partition, but leave a certain percentage of free space, then "Apply".

Replace the "endsect" by the actual number shown by fdisk.

sudo modprobe loop
sudo losetup -f
sudo losetup /dev/loop0 myimage.img
sudo partprobe /dev/loop0
sudo gparted /dev/loop0
sudo losetup -d /dev/loop0
fdisk -l myimage.img
truncate --size=$[(endsect+1)*512] myimage.img

  • Author

If I understand correctly, the steps apply to the already taken backup img file.

After shrinking, I could write it to another SD card and test if the root partition is smaller, correct?

 

Thank you

  • Author

Thanks. I though it might be possible to shrink while the system is running, but this is a way I can live with.

  • Author

I'm still working on this issue.

In the documentation I found that it is possible to specify a size in percentage, that is used to adjust the sd card partition:

I put 25% in the file /root/.rootfs_resize

Then I wanted to run the firstrun script again to apply the change (and create a new ssh key).

But the file is not present on my disk. However I found it under /media/mmc/etc/init.d. I am running "ARMBIAN 5.25 stable Debian GNU/Linux 8 (jessie) 3.4.113-sun8i".

 

Is the file supposed to be missing after the initial resize and copying everything to the hdd?

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.