Grep for the UUID?  Including grep -r to recurse directories.  You'll
probably need to do it once per partition.  gpartid has some serous
bugs when it comes to resizing I think.  If you're really careful with
your math you can control fdisk at a sector level. Actually I've done
it in OpenBSD, not Linux.  apcalc will handle the big numbers.  You
can copy and paste the inputs and outputs, it's just text.  And keep
files of notes.  I've never used truncate.

On 3/24/20, Nate Bargmann <n...@n0nb.us> wrote:
> * 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
>
>


-- 
-------------
No, I won't  call it "climate change", do you have a "reality problem"? - AB1JX
Cities are cages built to contain excess people and keep them from
cluttering up nature.
Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach  Impeach

Reply via email to