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

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



* On 2020 24 Mar 15:46 -0500, Alan Corey wrote:
> Downsizing requires that no files are in the part you trim off.

Ahhh.  Makes sense.

The mmc has two partitions, p1 an ext2 of 128 MB and p2 a btrfs with the
rest of the space.

Since I had the files of p2 on the 4 GB card, I went ahead and deleted
the p2 partition in the image file and then created a 3 GB btrfs
partition and then I could use the truncate command to resize the file,
Then I rsync'd the files from the card to the file and dd'd that to the
card.  Afterward Gparted would not upsize the btrfs partition, so I
deleted it and created it anew and then rsync's the files from the file
to the card!

Having gone through this, I think it would have worked as well to make a
copy of the original image file and truncate that to just after the end
of the p1 partition, dd'd that to the card, use Gparted (or parted) to
create the btrfs partition on the card, then rsync's things over from
image file 1.

Now the problem is that I get a kernel panic that the rootfs isn't
found.  On the 4 GB card I edited /etc/fstab with the new P2 UUID and
decompressed the initrd images and edited /conf/conf.d/default_root with
the new UUID and compressed them and copied them back to p1.  Of course
everything works with the 32 GB card.

At this point I am still puzzled where else the rootfs UUID is saved.
I've looked through the uboot environment and see nothing obvious there.
I do have a serial cable connected to the UART pins on the LIME2.

- 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: