## 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
• #### DJXIA in Implementing pulse oximeter using MAX30100

same problem here

#### Fabian Rios in Implementing pulse oximeter using MAX30100

I Sorry, when I click on "Submit Comment" say me error, and I try again, try again... I sorry for the replies

#### Fabian Rios in Implementing pulse oximeter using MAX30100

Hi Raivis or some person, I download all inside the folder with the .ino ok but de led of my board no go on, the monitor put all the time 19:58:20.999 ->  2debug=true...

#### Fabian Rios in Implementing pulse oximeter using MAX30100

Hi Raivis or some person, I download all inside the folder with the .ino ok but de led of my board no go on, the monitor put all the time 19:58:20.999 ->  2debug=true...

#### Fabian Rios in Implementing pulse oximeter using MAX30100

Hi Raivis or some person, I download all inside the folder with the .ino ok but de led of my board no go on, the monitor put all the time 19:58:20.999 ->  2debug=true...

#### Fabian Rios in Implementing pulse oximeter using MAX30100

Hi Raivis, or some person, I download all inside the folder with the .ino ok but de led of my board no go on, the monitor put all the...

#### Epson printer error code 0xf1 in nRF51 Makefile with Qt Creator

This is a very good post which I really enjoy reading. It is not every day that I have the possibility to see something like this. Epson printer error code...