[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 Wednesday 25 March 2020 04:18:20 Andrei POPESCU wrote:

> On Ma, 24 mar 20, 19:12:46, Gene Heskett wrote:
> > And nothing so far, and I have been watching, in the way of reducing
> > a filesystem to only the actual size occupied. Then it can be backed
> > up with dd and recovered, rewritten by dd, at a reasonable size for
> > storage.  And re-expanded to fit the media it finds.
>
> You could do this with the 'sparse' option of dd (you might need to
> fill the partition with a file containing only zeroes first).
>
> The resulting file must be handled with care as many tools (cp, rsync)
> will un-sparse it by default, as will writing it to a filesystem
> without support for sparse files (tar it first).
>
> To see the actual size with ls you will have to use -s/--size.
>
> > All of my attempts to do that with dd alone have been thwarted by
> > the fact that I have yet to find two u-sd's marked as such and such
> > a capacity, that actually were the same size.
>
> Just create the partitions slightly smaller than the size of the SD
> card.

I've also considered that, but then you risk losing the gpt tables and it 
all disappears in the cloud of blue smoke being emmited from ones ears. 

BTDT at least twice on arm systems. The distro folks have it and use it 
to make an install image of 5 gigs, unpacks to 7 or 8G and which can 
then be auto expanded on the first reboot to fill the card, so they know 
how to do it, why can't the user make backups from a deployed well 
running system that could be put on a fresh u-sd card and treated 
exactly the same for recovery purposes?

> Kind regards,
> Andrei


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: