Raspbian 遷移到更大的 SD 卡

Raspbian 遷移到更大的 SD 卡

當我的 Raspberry PI 上的空間不足時,我拿起了另一張 SD 卡。 「舊」卡只有 4GB,新卡有 8GB。

我用 Win32DiskImage 製作了一個映像並將其寫入 8GB 卡。一切順利。但是,我發現其實什麼也沒發生,所以還是4GB……我上網查了一下,發現這很正常。所以,我尋找「如何做」。我找到了一個:點選

因此,我遵循了本教程,或者至少我嘗試過這樣做。看起來我的 SD 卡佈局根本不一樣。但是,我嘗試使用: /dev/mmcblk0p6 。但沒有成功,所以我將影像重新寫入SD卡。順便說一下,我是使用NOOBS方式安裝Raspbian的。

更多資訊:

df -h給出:

pi@raspberrypi:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          3.4G  3.0G  216M  94% /
/dev/root       3.4G  3.0G  216M  94% /
devtmpfs        215M     0  215M   0% /dev
tmpfs            44M  268K   44M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            88M     0   88M   0% /run/shm
/dev/mmcblk0p5   60M  9.4M   50M  16% /boot

fdisk /dev/mmcblk0給出:

pi@raspberrypi:~$ sudo fdisk /dev/mmcblk0

Command (m for help): p

Disk /dev/mmcblk0: 8072 MB, 8072986624 bytes
4 heads, 16 sectors/track, 246368 cylinders, total 15767552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00004bf1

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            8192      240234      116021+   e  W95 FAT16 (LBA)
/dev/mmcblk0p2          245760     7663615     3708928   85  Linux extended
/dev/mmcblk0p3         7663616     7729151       32768   83  Linux
/dev/mmcblk0p5          253952      376831       61440    c  W95 FAT32 (LBA)
/dev/mmcblk0p6          385024     7663615     3639296   83  Linux

Command (m for help): q

pi@raspberrypi:~$

parted /dev/mmcblk0給出:

pi@raspberrypi:~$ sudo parted /dev/mmcblk0
GNU Parted 2.3
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit chs
(parted) print
Model: SD F0F0F (sd/mmc)
Disk /dev/mmcblk0: 1955,38,37
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 1955,128,63.  Each cylinder is 4129kB.
Partition Table: msdos

Number  Start      End        Type      File system  Flags
 1      1,2,2      29,101,15  primary   fat16        lba
 2      30,60,60   950,44,43  extended
 5      31,62,62   46,93,28   logical   fat32        lba
 6      47,95,31   950,44,43  logical   ext4
 3      950,44,44  958,60,59  primary   ext4

(parted)

所以,歡迎任何幫助......

答案1

您應該能夠透過shell 程式(fdisk、parted、resize2fs 等)擴展分區,但我認為您可以使用簡單的解決方案:將SD 卡放入裝有Linux 的標準PC 中,或使用GParted 啟動PC(從USB 記憶棒) ),然後在 GParted GUI 中擴展分區。找不到更簡單的解決方案。這是「要求很高」但又美好又簡單。

相關內容