Facebook Twitter Instagram Pinterest YouTube
    Trending
    • Elecrow Meteor IPS Touchscreen with RGB LEDs
    • Pi Pico Pinout Display on the Command Line
    • How to Add a Raspberry Pi Pico Reset Button
    • Pi Pico Onboard LED
    • Pi Pico W Pinout and Power Pins
    • CrowPi L Raspberry Pi Laptop and Learning Platform
    • Pi Pico W Launched
    • Add Kodi to RetroPie Menu
    Facebook Twitter Instagram Pinterest YouTube RSS
    Raspberry Pi SpyRaspberry Pi Spy
    • Home
    • Categories
      • General
      • Hardware
      • Programming
      • Python
      • Software
      • Tutorials & Help
    • BerryClip
      • BerryClip Instructions
      • BerryClip Plus Instructions
      • Videos & Reviews
    • Buy
      • Buy Pi
      • Buy Pi Accessories
      • Buy Books
    • Tools
      • Ultimate Raspberry Pi Alexa Skill
      • Pi Power Estimator App
      • Pi-Lite 14×9 LED Matrix Sprite Editor
      • RPiREF Pin-out Reference App
      • Simple Ohm’s Law Calculator
      • Web Sites & Links
    • Tutorials & Help
        Featured
        November 9, 20200

        Raspberry Pi Temperature Monitoring

        Recent
        December 23, 2022

        How to Add a Raspberry Pi Pico Reset Button

        November 20, 2022

        Pi Pico Onboard LED

        May 6, 2022

        Add Kodi to RetroPie Menu

      1. Contact Us
      2. Site Map
      Raspberry Pi SpyRaspberry Pi Spy
      You are at:Home»Tutorials & Help»Resize SD Card Partitions

      Resize SD Card Partitions

      6
      By Matt on June 1, 2012 Tutorials & Help

      The default images provided for the Raspberry Pi are usually 2GB and this results in wasted space on larger SD cards.

      When the image is written to your card three partitions are created. A boot partition, a Linux system partition and a swap file partition. They are sized to fit on a 2GB SD card and the additional space on larger cards is unallocated and unusable.

      This procedure explains how you can allocate that spare space and use the full capacity of your SD card. This involves moving the swap partition to the end of the card and then increasing the size of the Linux system partition that sits in the middle.


      UPDATE : This process is unnecessary if you are using the latest version of Raspbian. Simpy run “sudo raspi-config” and use the “Expand filesystem” option.


      To start will you need an SD card with the image written to it. Check this card works in your Raspberry Pi. If it doesn’t work at this point there is no point continuing!

      In the example I will be using the Debian image on a 8GB SD card and to perform the partition resize I will use a GParted Linux Live disc. A “Live” disc allows you to boot into a operating system on the disc without messing with your usual installed operating system. This is great for tasks such as this as it allows Windows users (me!) to run a Linux application on a temporary basis.

      Step 1 – Prepare a GParted live disc

      • Download the latest stable GParted disc image from : http://gparted.sourceforge.net/download.php
      • Burn the ISO to a blank CD or DVD. Make sure your burning application is writing the ISO file to the disc as an Image not simply as a normal file. If in doubt use the free Imgburn to write the image to the disc.

      Step 2 – Boot from the disc

      In order to boot from a disc your computer must be configured to boot from it’s optical drive before the hard drive. You may need to edit your BIOS settings to change the boot order of your devices.

      • Insert the disc into your computer and reboot.
      • Select “GParted Live (Default settings) from the menu.
      • Select “Don’t touch keymap” from the menu.
      • Select the nationality of your keyboard by typing the appropriate number.
      • Select ‘0’ from the mode option menu and press Enter.

      GParted will now load.

      Step 3 – Select your SD card

      The GParted window will show the details of the default device. We need to change this to the SD card you inserted earlier. You can select it using the drop-down list in the top-right of the GParted window.

      Here is an example where I have select my 8GB SD card from the list.

      You can see the 75MB boot partition, the 1.55GB system partition and the 191MB swap partition.

      Step 4 – Move the swap partition

      We will move the swap partition to the end of the SD card.

      • Select the linux-swap partition.
      • Click the “Resize/Move” button.

      • Position the cursor in the centre of the white box.
      • Drag it to the far right.

      The size stays the same but there is now no space after it. Click cancel if you make a mistake and try again.

      • Click “Resize/Move” to finish.

      Step 5 – Resize the system partition

      Now we can increase the size of the system partition.

      • Select the system partition (labelled “ext4”).
      • Click the “Resize/Move” button.

      • Position the cursor over the arrow on the right-hand side of the white box.
      • Drag the arrow to the far right to increase its size.

      The “New Size” should increase and the “Free space following” should reduce to zero.

      You may get the odd 1MB either side of the partition but on an 8GB card these bits of padding aren’t worth worrying about.

      • Click the “Resize/Move” button to finish.

      Step 6 – Apply the changes

      The application has now inserted our two operations into the pending operations list.

      There is a “Move” and a “Grow” operation. It is worth doing a quick sanity check at this point. Make sure you are moving the linux-swap partition and the increase in size of the system partition matches your expectations.

      • Click the “Apply” button to make the changes.

      • Wait for the operations to complete.

      The two warnings are usually related to a feature not being available within the system so they can be ignored.

      The final state of the SD card can be seen below. The boot and swap partitions are the same size as before but the system partition is now much bigger. There is an extra 5.87GB available which corresponds to the extra 6GB due to the bigger 8GB SD card.

      Step 7 – Reboot!

      • Double click the red “Exit” button in top left corner of the desktop
      • Select “Restart” and click “OK”
      • Remove the disc when prompted
      • Remove the SD card
      • Press Enter

      Your computer will reboot as usual into your normal operating system.

      Step 8 – Test SD card

      You can now insert the SD card into your Raspberry Pi and test that it boots correctly.

      You should now have lots of extra space available.

      Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
      Previous ArticleEnable SSH (Secure Shell) on the Raspberry Pi
      Next Article Matt’s First Raspberry Pi Photos

      Related Posts

      How to Add a Raspberry Pi Pico Reset Button

      Pi Pico Onboard LED

      Add Kodi to RetroPie Menu

      6 Comments

      1. David Field on June 6, 2012 7:44 pm

        An alternative — and often easier method — is to create a new ext3/ext4/(filesystem of your choice) partition using the unallocated space and “mount” that under a new/existing directory e.g. /home or /opt

        Reply
        • Matt on June 8, 2012 8:06 pm

          Thanks for the suggestion. I think this would be the preferred method if you wanted to store data/photos etc and keep it all separate from your operating system partitions. I’m sure I’ll give this a try at some point once I start using the Pi to do something practical.

          Reply
      2. Flomips on April 11, 2014 10:54 am

        Thanks for that. I have made the same operation with the SD card, 4G to 8G. Great !

        Reply
      3. Birkan on September 2, 2014 1:10 am

        Hi,
        it really really works for my 8gb sd card. I kept running my raspberian..
        There is no such info on raspberry pi’s forum.. All info listed there is rubbush.. Very stupid. THANKS MATT…!

        Reply
      4. RDK on December 21, 2014 4:55 pm

        Matt….Great tutorial. I’ve used this process several times. It just works!!!

        However, now I may have gotten myself into a bind. I recently created a copy of my 8GB SD card using the process detailed here(http://www.simonthepiman.com/2-9-how_to_backup_your_sdcard_using_windows.php) and then copied it onto a 32 GB SD. Pi booted just fine.

        Now I used your process to expand it out to the full 32 GB. It worked and the Pi booted just fine.

        Now the problem, I’ve made lots of changes to my system and now want to create a backup SD card in case I corrupt this one. I don’t have another 32GB SD card. How can I “downsize” the OS folder so I can then create a copy which will fit on my 16GB SD card?

        Thanks in advance for any ideas…..RDK

        Reply
      5. fireskyer on October 6, 2015 3:24 pm

        I have the same Problem as RDK

        Has anyone the same problem and solved this ?

        best regards

        fireskyer

        Reply

      Leave A Reply Cancel Reply

      This site uses Akismet to reduce spam. Learn how your comment data is processed.

      Recent Posts
      March 13, 2023

      Elecrow Meteor IPS Touchscreen with RGB LEDs

      December 26, 2022

      Pi Pico Pinout Display on the Command Line

      December 23, 2022

      How to Add a Raspberry Pi Pico Reset Button

      November 20, 2022

      Pi Pico Onboard LED

      November 14, 2022

      Pi Pico W Pinout and Power Pins

      Categories
      • 1-wire
      • 3D Printing
      • Add-ons
      • BBC Micro:bit
      • BerryClip
      • Books
      • Camera Module
      • Cases
      • Events
      • General
      • Hardware
      • I2C
      • Infographics
      • Interfaces
      • Minecraft
      • Model A+
      • Model B+
      • News
      • Pi Models
      • Pi Pico
      • Pi Zero
      • Power
      • Programming
      • Python
      • Raspberry Pi OS
      • Raspbian
      • RetroGaming
      • Robotics
      • Sensors
      • Software
      • SPI
      • Tutorials & Help
      Tags
      Arduino audio battery berryclip Birthday bluetooth cambridge camera CamJam DigiMakers display games GPIO I2C interface Kickstarter Kodi LCD LED Linux media Minecraft Model A motionEyeOS PCB photography photos Pi-Lite Pi Pico power python Raspberry Jam Raspberry Pi Bootcamp raspbian Retrogaming retroPie screen SD card security sensor SPI SSH temperature ultrasonic video
      Raspberry PI Related
      • Adafruit Blog
      • Average Maker
      • Official RaspBerry Pi Site
      • Raspberry Pi Pod
      • RasPi.tv
      • RaspTut
      • Stuff About Code
      Tech Resources
      • MattsBits – Pi Resources
      • Microbit Spy
      • Technology Spy
      Archives
      About

      Unofficial site devoted to the Raspberry Pi credit card sized computer offering tutorials, guides, resources,scripts and downloads. We hope to help everyone get the most out of their Pi by providing clear, simple articles on configuring, programming and operating it.

      Popular Posts
      September 19, 2014

      Top 5 Reasons The Raspberry Pi Sucks

      July 27, 2012

      16×2 LCD Module Control Using Python

      October 20, 2013

      Analogue Sensors On The Raspberry Pi Using An MCP3008

      Recent Posts
      March 13, 2023

      Elecrow Meteor IPS Touchscreen with RGB LEDs

      December 26, 2022

      Pi Pico Pinout Display on the Command Line

      December 23, 2022

      How to Add a Raspberry Pi Pico Reset Button

      Facebook Twitter Instagram Pinterest YouTube RSS

      Entries RSS | Comments RSS

      This site is not associated with the official Raspberrypi.org site or the Raspberry Pi Foundation. Raspberry Pi is a trademark of the Raspberry Pi Foundation.

      Copyright © 2022 - All Rights Reserved - Matt Hawkins

      mastodon.social@RPiSpy

      Type above and press Enter to search. Press Esc to cancel.