[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Resize a disk image from 32G to 4G or copy u-boot?



Hi All.

I have an Olimex LIME2 based Freedombox (Debian Buster) and as I am
using an external hard drive with it, less than 2 GB of the 32 GB
micro-SD card capacity is being used.  I have a spare 4 GB card that I
would like to use instead, but haven't figured out how to downsize the
root partition in the disk image file after using dd to make an image
from the 32 GB card.

I tried the steps at:

https://softwarebakery.com/shrinking-images-on-linux

and gparted fails at the resize step with an error of:

   btrfs filesystem resize 1:2234368K ʼ/tmp/gparted-3ExAC9ʼ  00:00:05    (
   ERROR )

   Resize ʼ/tmp/gparted-3ExAC9ʼ of ʼ1:2234368Kʼ
   ERROR: unable to resize ʼ/tmp/gparted-3ExAC9ʼ: No space left on device

Even if I manually try to use the btrfs command to attempt the resize I
get the same error which seems weird as I am *shrinking* the file
system..

As an alternative, I created the proper partitions on the 4 GB card and
used rsync to copy the relevant data over.  That is all well and good
except that now I don't have u-boot in the first 1 MB of the 4 GB card
(the boot partition starts at sector 2048 in both the disk image and the
4 GB card).  I'm unsure of the exact offsets or I would simply use dd to
copy that data from the 32 GB image to the 4 GB card and be on my way.

Ideas?

TIA

- Nate

-- 

"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."

Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819

Attachment: signature.asc
Description: PGP signature


Reply to: