Drewsif / PiShrink

Make your pi images smaller!
MIT License
3.5k stars 644 forks source link

filesystem not expanded on first boot #250

Closed thindata closed 1 year ago

thindata commented 1 year ago

I resized a debian 8 image down to 1.8GB if i write to either an 8gb or 16gb sd card the size doesn't expand. I assume it's due to me not having raspi_config if so is there a woekaround?

pishrink.sh v0.1.2
pishrink.sh: Gathering data ...
Creating new /etc/rc.local
pishrink.sh: Checking filesystem ...
/dev/loop28: 39070/462384 files (0.3% non-contiguous), 331129/1848064 blocks
resize2fs 1.44.1 (24-Mar-2018)
pishrink.sh: Shrinking filesystem ...
resize2fs 1.44.1 (24-Mar-2018)
Resizing the filesystem on /dev/loop28 to 451685 (4k) blocks.
Begin pass 2 (max = 139382)
Relocating blocks             XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 3 (max = 57)
Scanning inode table          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 4 (max = 3973)
Updating inode references     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/loop28 is now 451685 (4k) blocks long.

pishrink.sh: Shrinking image ...
pishrink.sh: Shrunk test.img from 15G to 1.8G ...
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p1  1.6G  1.1G  457M  70% /
udev             10M     0   10M   0% /dev
tmpfs           377M  5.1M  372M   2% /run
tmpfs           941M     0  941M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           941M     0  941M   0% /sys/fs/cgroup
Device         Boot Start     End Sectors  Size Id Type
/dev/mmcblk0p1       2048 3647696 3645649  1.8G 83 Linux