SD卡上的空间在哪里?


10

我刚买了一个树莓派。它带有一个8GB的SD卡(实际上是SD适配器+ microSD卡),上面带有RPi徽标。

它本来应该有8Gb,但是“ parted”命令说的却有所不同...

$ sudo parted
GNU Parted 2.3
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help                                                             
  align-check TYPE N                        check partition N for TYPE(min|opt) alignment
  check NUMBER                             do a simple check on the file system
  cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on partition NUMBER
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  mkpartfs PART-TYPE FS-TYPE START END     make a partition with a file system
  move NUMBER START END                    move partition NUMBER
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table, available devices, free space, all found partitions, or a particular partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resize NUMBER START END                  resize partition NUMBER and its file system
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU Parted
(parted) print                                                            
Model: SD USD (sd/mmc)
Disk /dev/mmcblk0: 8069MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      4194kB  62.9MB  58.7MB  primary  fat16        lba
 2      62.9MB  3277MB  3214MB  primary  ext4

而且我用光了空间...

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       2.9G  2.7G   50M  99% /
devtmpfs        428M     0  428M   0% /dev
tmpfs            87M  228K   87M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           173M     0  173M   0% /run/shm
/dev/mmcblk0p1   56M   20M   37M  36% /boot

其他4.5 Gb还剩哪里呢?

谢谢

Answers:


19

树莓派

  1. sudo raspi-config
  2. 选择选项#1: Expand filesystem
  3. Tab Tab--->选择finish--->重新启动?yes
  4. 重新启动后。跑df -h

有关raspi-config的更多信息。经历这个

基于Raspbian的基于Debian的操作系统(ubuntu,debian armhf等)

raspi-configraspbian。以外的操作系统上默认不可用。

  1. wget http://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20150706_all.deb
  2. sudo gdebi raspi-config_20150706_all.deb

它将raspi-config随其依赖关系一起安装。现在,按照上面提到的树莓派步骤扩展文件系统。

任何Linux发行版(也适用于Raspbian)

请遵循以下Wiki页面:http : //elinux.org/RPi_Resize_Flash_Partitions#Manually_resizing_the_SD_card_on_Linux

它很好地解释了如何使用parted扩展文件系统。

希望能帮助到你。


谢谢 !!!!$ df -h使用的文件系统大小可用百分比已安装在/ dev / root上7.3G 2.7G 4.3G 39%/
FlamingMoe
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.