Wenn man in Linux die Partiongröße ändern will, muss man die alte Partion löschen und eine neue Partion an legen.
Diese Schritte sind dafür notwendig.
A. Ausgabe der Partionsinformationen
B. Löschen der Partion Nummer #2
C. Neu Partion #2 erstellen
D. Partionen speichern
Mit dem Tool „fdisk“ sind diese Kommandos notwendig.
A. [p] (Print)
B. [d,2] (Delete, Partition #2)
C. [n,p,2,{default},{default}] (New, Primary, Partition #2, First sector, Last sector)
D. [w] (Write)
Die Ausgabe von „fdisk“ sieht so aus.
# sudo fdisk /dev/mmcblk0
Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/mmcblk0: 29,3 GiB, 31440502784 bytes, 61407232 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
Disklabel type: dos
Disk identifier: 0xf9315c16
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 133119 131072 64M c W95 FAT32 (LBA)
/dev/mmcblk0p2 133120 7679999 7546880 3,6G 83 Linux
Command (m for help): d
Partition number (1,2, default 2):
Partition 2 has been deleted.
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (2-4, default 2):
First sector (133120-61407231, default 133120):
Last sector, +sectors or +size{K,M,G,T,P} (133120-61407231, default 61407231):
Created a new partition 2 of type 'Linux' and of size 29,2 GiB.
Command (m for help): p
Disk /dev/mmcblk0: 29,3 GiB, 31440502784 bytes, 61407232 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
Disklabel type: dos
Disk identifier: 0xf9315c16
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 133119 131072 64M c W95 FAT32 (LBA)
/dev/mmcblk0p2 133120 61407231 61274112 29,2G 83 Linux
Command (m for help): w
The partition table has been altered. |
Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/mmcblk0: 29,3 GiB, 31440502784 bytes, 61407232 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
Disklabel type: dos
Disk identifier: 0xf9315c16
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 133119 131072 64M c W95 FAT32 (LBA)
/dev/mmcblk0p2 133120 7679999 7546880 3,6G 83 Linux
Command (m for help): d
Partition number (1,2, default 2):
Partition 2 has been deleted.
Command (m for help): n
Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p):
Using default response p.
Partition number (2-4, default 2):
First sector (133120-61407231, default 133120):
Last sector, +sectors or +size{K,M,G,T,P} (133120-61407231, default 61407231):
Created a new partition 2 of type 'Linux' and of size 29,2 GiB.
Command (m for help): p
Disk /dev/mmcblk0: 29,3 GiB, 31440502784 bytes, 61407232 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
Disklabel type: dos
Disk identifier: 0xf9315c16
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 2048 133119 131072 64M c W95 FAT32 (LBA)
/dev/mmcblk0p2 133120 61407231 61274112 29,2G 83 Linux
Command (m for help): w
The partition table has been altered.
Jetzt ist ein Reboot notwendig.
# sudo reboot
Das Dateisystem ext4 kann im Betrieb vergrössert werden.
# sudo apt-get install e2fsprogs
# sudo resize2fs -p /dev/mmcblk0p2