Raspberry Pi study notes - (2) expansion SD card remaining space

My SD card is 64GB, but only a part of the remaining space is not extended.

 

View disk usage

[the root @ localhost ~] DF # - H # Check current disk, only a portion of 
the Filesystem Size Used Avail the Use% Mounted ON 
/ dev / 1.4G 1.2G 211M 85% the root / 
devtmpfs 1.9G 1.9G 0 0% / dev  tmpfs 0% 0 2.0G 2.0G / dev / SHM  tmpfs 17M 2.0G 1.9G. 1% / RUN tmpfs 2.0G 2.0G 0 0% / SYS / FS / a cgroup / dev / 18 is mmcblk0p1 286M 235M 52M% / Boot tmpfs 391M 391M 0 0% / run / user / 0

 

View the partition usage

[root@localhost ~]# fdisk -l
        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *        8192      593919      292864    c  W95 FAT32 (LBA)
/dev/mmcblk0p2          593920     1593343      499712   82  Linux swap / Solaris
/dev/mmcblk0p3         1593344     4524031     1465344   83  Linux

 

Allocating disk using fdisk

[the root @ localhost ~] # the fdisk / dev / mmcblk0 
available for purchase to the fdisk (util-Linux 2.23.2 ). 

Changes in REMAIN Will only Memory, an until you Decide to Write Them. 
of Be careful before the using The Write Command. 

 the Command (for m help): d # delete partition  partition number (1-3, default 3) : 3 # 3 delete partitions, i.e., / dev / mmcblk0p3 the partition 3 IS deleted the Command (m for Help): n-# Create a new partition partition type: p primary (2 primary, Extended 0, 2 Free ) E Extended the Select (default P): P # Number create a primary partition the partition (3,4-, default. 3):. 3   # partition 3 First sector (2048-124735487, default 2048 ): 1,593,344 partition start sector # 3 is input, by fdisk - give commands l Last sector, + sectors or + size {K, M, G} (1593344-124735487, default 124735487):   #最后一个扇区,默认即可 Using default value 124735487 Partition 3 of type Linux and of size 58.7 GiB is set Command (m for help): w  #将上述操作写入分区表 The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks. [root@localhost ~]# reboot  #操作完成需要重启

 

After the restart, query space has not changed, you need to enter the following command

[root@localhost ~]# sudo resize2fs /dev/mmcblk0p3
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/mmcblk0p3 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 8
The filesystem on /dev/mmcblk0p3 is now 15392768 blocks long.

 

At this capacity has been extended

[root@localhost ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        58G  1.2G   57G   2% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           2.0G   17M  1.9G   1% /run
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/mmcblk0p1  286M   52M  235M  18% /boot
tmpfs           391M     0  391M   0% /run/user/0

Guess you like

Origin www.cnblogs.com/jxzc/p/12037828.html