## Resize main partition (utilize all SD card)

It's annoying when you copy image to the SD card and the main partion uses 2Gb out of 8Gb (in my case)
Here is just a quick reminder what to do to set up arch linux on Pi while utilizing all 8Gb or whatever size SD card you have.

So you want to resize the partition to match the SD card since there is likely to be a lot of unused/unusable space by default. Log in with username root and password root (either via SSH or with a keyboard and screen connected to the Raspberry Pi, either will work). Run "fdisk /dev/mmcblk0". Type the command 'p' and press enter. You should see two lines looking similar to this:

/dev/mmcblk0p1                     1      195312           97656        c  W95 FAT32 (LBA)
/dev/mmcblk0p2            197265        15544319         7673527+  83  Linux


Those are the current partitions. What we need to do is delete the second one and recreate it larger. Make a note of the first number on the second line (in this case 197265) and then type the command 'd' (and press enter). Choose 2. Now we create a new one with 'n' and enter 'p' for primary and 2 for partition number 2. Now we get to the first sector, and here it's important that you enter the number we took note of earlier, in this case 197265. Select the largest value for last sector. Now that we've done that enter 'w' to write and then 'q' to quit. Reboot with the command 'reboot' and once you've booted and logged in again run 'resize2fs /dev/mmcblk0p2'.

### Related Articles

• #### Implementing pulse oximeter using MAX30100

Mar 8, 2017 | by Raivis Strogonovs
• #### nRF51 Makefile with Qt Creator

Jun 4, 2016 | by Raivis Strogonovs
• #### USART, FreeRTOS and C++ on nRF51

Dec 14, 2015 | by Raivis Strogonovs
• #### Starting with nRF51 BLE and Qt Creator

Dec 12, 2015 | by Raivis Strogonovs
• #### Touch gesture recognition using body capacitance

Nov 29, 2014 | by Raivis Strogonovs
• #### Introduction to data encryption

Oct 4, 2014 | by Raivis Strogonovs
• #### MEMS (Part 2) – Guide to using gyroscope L3G4200D

Jun 17, 2014 | by Raivis Strogonovs
• #### Victoria Tegg in LXDE on Raspberry PI Arch Linux

This is a topic that is near to my heart… Many thanks! Exactly where are your contact details though?

#### Victoria Tegg in LXDE on Raspberry PI Arch Linux

This is a topic that is near to my heart… Many thanks! Exactly where are your contact details though?

#### Jessica Roggers in Implementing pulse oximeter using MAX30100

Small portable size makes it easy to handle and carry. Helpful for athletes and pilots to obtain quick and precise oxygen saturation...

#### James J in Simple library for driving 20x4 LCD with 4bits

Very good writeup. I thought had been fighting my code for a week or two and confirmed what I was dooing was right. This overview is the best I have seen for doing the code. You may wish to add one thing though that I have found on another website. Urge people to check the contrast dial on...