Enlarge the SD card of your Pi Raspberry
Warning : This article has been automatically translated by Google Translate
Voilà, the much dreaded time has arrived :
Inevitably with a 2 GB card, We quickly end up being lack of space. And clearly for me, reinstall everything was not possible. I therefore recovered a 16 GB card (Yes this is extreme but it takes what it takes !) so it becomes my new card for my server.
- First step : the backup ! For this, It is a choice and I will not be able to describe all. For example, in Mac Os (replace the X's rdiskX the number that goes well, found with the command Mount for example) :
DD bs = 4 m if = / dev/rdiskX of =<name of your image>
- Once your image backup created, Insert your new card and copy the image top. Always on Mac Os :DD bs = 4 m if =<name of your image> of = / dev/rdiskY
- Now we have a copy of our 2 GB SD card on our 16 GB card. Put it in the Raspberry Pi and boot
- Login to the Raspberry and run the following command
It comes here to edit the partition table to change the size of the primary partition.
- Type p to view the information on the SD card
Here you should remember the starting point of the primary partition that is 194560
- Delete the primary partition in combining the following commands
- d <Enter>
- 2 <Enter>
- Create a new partition primary above the former
- n <Enter>
- p <Enter>
- 2 <Enter>
- Make sure that the number proposed to start the partition is the same as that of the stage 5 (Home 194560)
- Then use the suggested value that is the maximum value to occupy the whole of disk space (Home 30220287)
- w <Enter> (It is to write the changes to the partition table)
- Do a reboot. If all goes well (If if it's going to happen), Raspberry Pi will restart without problem. Your partition will be enlarged but you will not always have the maximum possible size
- Launch the expansion of the filesystem in him even :
And here is the result :
For me it took a few seconds to move to the maximum size but it will depend on the size of the destination and its quality card.
You can play !