Modernine TV
ͼ : ͼ駢 admin     ʶҹ admin      ҷ駢 ѹ : 27 ѹ¹ 2560 20:01:39      ١Դҹ 32   32 / 0    ŴҴѡ ŴҴѡ 
: [ ]      Raspberry Pi      Raspberry Pi      Raspberry Pi
ͧ : Resize SD card partition to fill 32GB card from a running Raspberry Pi


Here is how to utilise the full capacity of your Raspberry Pi's SD card after installing the Debian image which gives a 2GB root partition:

Step 1: Run fdisk as sudo
 pi@raspberrypi ~ $ sudo fdisk -cu /dev/mmcblk0


Step 2: enter p to view the current partition table:
 pi@raspberrypi ~ $ p

Device          Boot    Start    End        Blocks    Id    System 
/dev/mmcblk0p1          2048      155647    76800    c      W95 FAT32 (LBA) 
/dev/mmcblk0p2          157696    3414015 1628160  83    Linux 
/dev/mmcblk0p3          3416064  3807231 195584    82    Linux swap / Solaris

Step 3: Delete partitions 2 and 3 (root and swap)
 pi@raspberrypi ~ $ d 2

 pi@raspberrypi ~ $ d 3


Step 4: Create a new primary partition (2) starting where the previous partition 2 started (usually 157696)
 pi@raspberrypi ~ $ n p 2
n p 2 
157696 
Enter (use remaining space)

Your partition table on a 32GB SD card will now look like this :

Device          Boot    Start    End        Blocks     Id    System 
/dev/mmcblk0p1          2048     155647     76800      c     W95 FAT32 (LBA) 
/dev/mmcblk0p2          157696   62552063   31197184   83    Linux 

w (to write new partition table to the SD card)

Step 5: Reboot to reload the partition table
 pi@raspberrypi ~ $ sudo shutdown -r now


Step 6: Resize partition 2 (Takes about 44 minutes on a class 10 SD card)
 pi@raspberrypi ~ $ sudo resize2fs /dev/mmcblk0p2

Based on the tutorial found here: http://elinux.org/RPi_Resize_Flash_Partitions

https://www.chrisnewland.com/resize-raspberry-pi-sd-card-partition-to-fill-32gb-card-from-a-running-raspberry-pi-245




Ѵ ˹ҷѷ ӡѴ ( Ҫ ) ͡ͺ෤մԨԵ ȭ