RaspberryPi Raspberry Pi Partition Expansion Root Directory

 After the Raspberry Pi is installed, only a part of the SD card partition is in use. If you want to use all the partitions, you must expand the capacity


1. If it is a raspbian system

Use the command directly

raspi-config

 1. Select Advanced Options

 2. Select Expand Filesystem

 3. Restart to expand the capacity


2. Unofficial system approach

1. View block devices

lsblk
Confirm the block device mounted in the / directory

 

remember type

 2. Use the command

#1.使用parted分区工具
parted

#2.按p打印分区情况
p

#3.扩容分区 3是p命令获得的分区number 100%的意思是100%的空闲空间
resizepart 3 100%

 3. Resize partition after resizepart succeeds

#ext使用resize2fs xfs使用xfs_grows
resize2fs /dev/mmblk0p3

4.lsblk view partition status has been expanded successfully

Guess you like

Origin blog.csdn.net/qq_36532805/article/details/127466172