# \[SOLVED\] Expanding file system issue

**URL:** https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880
**Category:** Troubleshooting
**Created:** [27 January 2019 23:33 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880 "2019-01-27T23:33:10Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![unixmit](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/u/e9a140/32.png) [@unixmit](https://dietpi.com/forum/u/unixmit)
#### Post date: [27 January 2019 23:33 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/1 "2019-01-27T23:33:10Z")

</div>

I’ve just downloaded the latest Raspberry Pi image and flashed it onto and 8GB SD card  
After booting the Pi and accessing over SSH it doesn’t seem to have expanded the file system so it has no free space to continue. Is there a script I can run to expand the drive and if so where can I find it?

Thanks

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [27 January 2019 23:46 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/2 "2019-01-27T23:46:02Z")

</div>

Please try:  
systemctl enable dietpi-fs\_partition\_resize  
reboot

---

<div class="post-metadata">

### Author: ![unixmit](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/u/e9a140/32.png) [@unixmit](https://dietpi.com/forum/u/unixmit)
#### Post date: [28 January 2019 10:31 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/3 "2019-01-28T10:31:44Z")

</div>

Thanks so much. That sorted it out and I no longer get issues with the initial setup.  
Not sure why the expansion wouldn’t happen by default at the beginning though. Is that normal? Maybe I missed a step.

---

<div class="post-metadata">

### Author: ![unixmit](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/u/e9a140/32.png) [@unixmit](https://dietpi.com/forum/u/unixmit)
#### Post date: [29 January 2019 09:19 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/4 "2019-01-29T09:19:32Z")

</div>

I spoke too soon. Still having issues. I started over twice, flashing the SD card again. Part way through the initial setup I get the error:

DietPi-Update: G\_AGUG  
│ - Exit code: 100  
│ - DietPi version: v6.17.0 (Fourdee/master) | HW\_MODEL:0 | HW\_ARCH:1 | DISTRO:4  
│ - Image creator: DietPi Core Team  
│ - Pre-image: Raspbian Lite  
…  
│ After this operation, 278 kB of additional disk space will be used.  
│ E: You don’t have enough free space in /var/cache/apt/archives/.

Any clue why I’m getting this error? Obviously it says there’s not enough space. I’m using an 8GB SD card and the Raspberry Pi image with no changes. Strange

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [29 January 2019 12:59 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/5 "2019-01-29T12:59:47Z")

</div>

There is indeed an issue with the current RPi image not expanding the file system correctly. We will upload new images soon.

Okay so the issue now occurred before/during update. In this case you need to do the expansion manually. Please run the following:  
Verify your root partition is /dev/mmcblk0p2: findmnt / -o source -n  
Expand partition: sfdisk /dev/mmcblk0 -fN2 --no-reread \<\<\< ‘,+,’  
Tell the kernel/system about changed partition: partprobe /dev/mmcblk0  
Expand the file system: resize2fs /dev/mmcblk0p2

---

<div class="post-metadata">

### Author: ![unixmit](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/u/e9a140/32.png) [@unixmit](https://dietpi.com/forum/u/unixmit)
#### Post date: [29 January 2019 13:13 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/6 "2019-01-29T13:13:08Z")

</div>

Thank you for confirming that. I thought I was going mad. That’s great I’ll give it a go.

---

<div class="post-metadata">

### Author: ![unixmit](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/u/e9a140/32.png) [@unixmit](https://dietpi.com/forum/u/unixmit)
#### Post date: [30 January 2019 10:01 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/7 "2019-01-30T10:01:17Z")

</div>

Still having issues. df -h shows that expanding the file system worked but now I get a new error:

Get:34 [https://archive.raspberrypi.org/debian](https://archive.raspberrypi.org/debian) stretch/main armhf  
│ raspberrypi-bootloader armhf 1.20181112-1 [3,573 kB]  
│ Fetched 54.0 MB in 38s (1,385 kB/s)  
│ E: Failed to fetch  
│ [https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-sys-mods/raspberrypi-sy](https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-sys-mods/raspberrypi-sy)  
│ s-mods\_20181127\_armhf.deb gnutls\_handshake() failed: The TLS connection was  
│ non-properly terminated.  
│ E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?  
│  
│  
│  
│ Unable to continue, DietPi-Update will now terminate.

Trying the suggestions it notes now.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [30 January 2019 12:14 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/8 "2019-01-30T12:14:34Z")

</div>

I remember seening this error once. Have to search the web.

However TLS errors often occur in combination with wrong system clock. As failsafe, run /DietPi/dietpi/func/run\_ntpd 1 to sync the system clock.

---

<div class="post-metadata">

### Author: ![unixmit](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/u/e9a140/32.png) [@unixmit](https://dietpi.com/forum/u/unixmit)
#### Post date: [30 January 2019 13:00 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/9 "2019-01-30T13:00:12Z")

</div>

Now I’m getting Log file contents:  
│ Reading package lists…  
│ Building dependency tree…  
│ Reading state information…  
│ Calculating upgrade…  
│ E: The package index files are corrupted. No Filename: field for package  
│ libraspberrypi-bin.

Maybe I’ll just wait until the new images are up.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [30 January 2019 13:08 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/10 "2019-01-30T13:08:41Z")

</div>

Please try the following:  
apt clean  
rm -R /var/cache/apt  
apt update

This is an error with the Raspberry Pi APT repository. The above cleans all local APT cache an refreshes the package list.  
I just checked on my RPi and I can update the repo fine. But check the last command above for error messages.

---

<div class="post-metadata">

### Author: ![unixmit](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/u/e9a140/32.png) [@unixmit](https://dietpi.com/forum/u/unixmit)
#### Post date: [3 February 2019 15:09 UTC](https://dietpi.com/forum/t/solved-expanding-file-system-issue/2880/11 "2019-02-03T15:09:21Z")

</div>

The new image is much better and works now thank you.
