soyxan
Posts: 13
Joined: Wed Apr 06, 2016 11:48 am

Default Raspbian Strecht Lite free space

Sat Oct 21, 2017 3:16 pm

Hi,

I want to know what is the default Raspbian Strectch Lite free space avialable just after flashing the SD card (on the first boot before using raspi-config to enlarge the data partition).

On the other hand, is there any tool (windows and linux) to resize the official image (IMG file) before flashing it to the SD card?

Thanks!

jahboater
Posts: 4598
Joined: Wed Feb 04, 2015 6:38 pm

Re: Default Raspbian Strecht Lite free space

Sat Oct 21, 2017 5:03 pm

It is resized automatically on first boot to make all of the SD card available.
Thats the ext4 "/" filesystem.

davesteele
Posts: 57
Joined: Wed Nov 30, 2016 4:16 pm

Re: Default Raspbian Strecht Lite free space

Sat Oct 21, 2017 5:14 pm

The uncompressed lite img is 1.8GB. Anything between that and the size of your SD card is roughly the free space.

As has been said, the image is resized automatically on first boot. Linux has tools included to do this manually (loopback mount, parted, resize2fs), but they are not simple the first time through.

davesteele
Posts: 57
Joined: Wed Nov 30, 2016 4:16 pm

Re: Default Raspbian Strecht Lite free space

Sat Oct 21, 2017 5:28 pm

To more precisely answer your question, the latest fresh lite image shows 620MB free, for 61% utilization.

Code: Select all

# fdisk -l 2017-09-07-raspbian-stretch-lite.img
Disk 2017-09-07-raspbian-stretch-lite.img: 1.7 GiB, 1854590976 bytes, 3622248 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x11eccc69

Device                                Boot Start     End Sectors  Size Id Type
2017-09-07-raspbian-stretch-lite.img1       8192   93813   85622 41.8M  c W95 FAT32 (LBA)
2017-09-07-raspbian-stretch-lite.img2      94208 3622247 3528040  1.7G 83 Linux
The offset in the file for the desired partition is 94208 * 512 = 48234496

Code: Select all

# mount -o ro,loop,offset=48234496 <path>/2017-09-07-raspbian-stretch-lite.img /mnt/foo

# df -h /mnt/foo
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0      1.7G  942M  620M  61% /mnt/foo

soyxan
Posts: 13
Joined: Wed Apr 06, 2016 11:48 am

Re: Default Raspbian Strecht Lite free space

Mon Oct 23, 2017 2:28 pm

jahboater wrote:
Sat Oct 21, 2017 5:03 pm
It is resized automatically on first boot to make all of the SD card available.
Thats the ext4 "/" filesystem.
I have realized that there is the following command in cmdline.txt file:

Code: Select all

init=/usr/lib/raspi-config/init_resize.sh
Can I just remove it in order to avoid the partition to be resized? (I want to avoid that as this is a testing machine and I make images of the SD card as a backup, and I dont want that a big image size)

Return to “Raspbian”