Benutzer:Tuxnix: Unterschied zwischen den Versionen

Aus wiki.archlinux.de
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
Entwurf Beitrag 'gdisk'
Entwurf Beitrag 'gdisk'
(Kopie von fdisk - muss noch entsprechend angepasst werden)


{{SEITENTITEL:gdisk}}{{righttoc}}
{{SEITENTITEL:gdisk}}{{righttoc}}
{{Hinweis|Gdisk nutzt die moderne GUID-Partitionstabelle (GPT) welche für das Booten von UEFI-Systeme notwendig ist, während [[fdisk]] eine DOS-Partitionstabelle (MBR)für Datenträger bis 2TiB einsetzt die für das Booten von BIOS-Systemen benötigt wird.}}<br>
{{Hinweis|Gdisk nutzt die moderne GUID-Partitionstabelle (GPT) welche für das Booten von UEFI-Systeme notwendig ist, während [[fdisk]] eine DOS-Partitionstabelle (MBR) für Datenträger bis 2TiB einsetzt die für das Booten von BIOS-Systemen benötigt wird.}}<br>


Mit dem Konsolenprogramm {{ic|gdisk}} wird die Partitionstabelle eines Datenträgers verändert oder neu erstellt.
Mit dem Konsolenprogramm {{ic|gdisk}} wird die Partitionstabelle eines Datenträgers verändert oder neu erstellt.
Zeile 52: Zeile 51:
  OK; writing new GUID partition table (GPT) to /dev/sda.
  OK; writing new GUID partition table (GPT) to /dev/sda.
  The operation has completed successfully.</span></b>
  The operation has completed successfully.</span></b>
GPT fdisk (gdisk) version 1.0.5
Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: present
Found valid GPT with corrupt MBR; using GPT and will write new
protective MBR on save.
Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y
Command (? for help): n
Partition number (1-128, default 1):
First sector (34-976773134, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-976773134, default = 976773134) or {+-}size{KMGTP}: +512M
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): ef00
Changed type of partition to 'EFI system partition'
Command (? for help): n
Partition number (2-128, default 2):
First sector (34-976773134, default = 1050624) or {+-}size{KMGTP}:
Last sector (1050624-976773134, default = 976773134) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):
Changed type of partition to 'Linux filesystem'
Command (? for help): p
Disk /dev/sdc: 976773168 sectors, 465.8 GiB
Model: USB 3.5"-HDD   
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 96231FD8-EEE4-4EFB-846A-5527772B96FC
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number  Start (sector)    End (sector)  Size      Code  Name
  1            2048        1050623  512.0 MiB  EF00  EFI system partition
  2        1050624      976773134  465.3 GiB  8300  Linux filesystem
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdc.
The operation has completed successfully.


==Weitere Beispiele==
==Weitere Beispiele==

Version vom 28. November 2020, 15:34 Uhr

Entwurf Beitrag 'gdisk'


Hinweis: Gdisk nutzt die moderne GUID-Partitionstabelle (GPT) welche für das Booten von UEFI-Systeme notwendig ist, während fdisk eine DOS-Partitionstabelle (MBR) für Datenträger bis 2TiB einsetzt die für das Booten von BIOS-Systemen benötigt wird.


Mit dem Konsolenprogramm gdisk wird die Partitionstabelle eines Datenträgers verändert oder neu erstellt.

Installation

Das Programm gdisk ist im Paket gptfdisk enthalten und gehört zur Standardinstallation.

Partitionieren

Hinweis: Vor dem Partitionieren sollte man sich mit dem Befehl # fdisk -l oder lsblk über die angeschlossenen Festplatten und deren Partitionen einen Überblick verschaffen.

Achtung: Das Neuanlegen der Partitionstabelle kann gespeicherte Daten unauffindbar machen.


Eingeleitet wird das Partitionieren mit dem Befehl:

gdisk <Datenträger>

Danach können interaktiv vom Benutzer die weiteren Schritte gewählt werden:
Mit der Eingabe von ? werden alle Optionen aufgelistet.
Alle Änderungen werden vorerst nur im cache vorgenommen und können mit q jederzeit folgenlos abgebrochen werden.
Erst mit der Eingabe von w wird die neue Partitionstabelle auf den Datenträger geschrieben und die Partitionierung abgeschlossen.

Beispiel

Zur Veranschaulichung hier ein Beispiel mit allen Aus- und Eingaben.
Der Datenträger /dev/sda soll für die Einrichtung mit Arch Linux neu partitioniert werden.

  • Die erste Partition soll für /boot mit 512MiB -
  • Die zweite Partition soll für root (/) mit dem maximalen Speicherplatz -

Dies entspricht der gebräuchlichen Partitionierung für UEFI-Boot-Systeme.

# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.5
Partition table scan: MBR: not present BSD: not present APM: not present GPT: not present
Creating new GPT entries in memory.
Command (? for help): o This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y
Command (? for help): n Partition number (1-128, default 1):↵ Enter First sector (34-976773134, default = 2048) or {+-}size{KMGTP}:↵ Enter Last sector (2048-976773134, default = 976773134) or {+-}size{KMGTP}:↵ Enter Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):↵ Enter Changed type of partition to 'Linux filesystem'
Command (? for help): w Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!
Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/sda. The operation has completed successfully.


GPT fdisk (gdisk) version 1.0.5

Partition table scan:

 MBR: not present
 BSD: not present
 APM: not present
 GPT: present

Found valid GPT with corrupt MBR; using GPT and will write new protective MBR on save.

Command (? for help): o This option deletes all partitions and creates a new protective MBR. Proceed? (Y/N): y

Command (? for help): n Partition number (1-128, default 1): First sector (34-976773134, default = 2048) or {+-}size{KMGTP}: Last sector (2048-976773134, default = 976773134) or {+-}size{KMGTP}: +512M Current type is 8300 (Linux filesystem) Hex code or GUID (L to show codes, Enter = 8300): ef00 Changed type of partition to 'EFI system partition'

Command (? for help): n Partition number (2-128, default 2): First sector (34-976773134, default = 1050624) or {+-}size{KMGTP}: Last sector (1050624-976773134, default = 976773134) or {+-}size{KMGTP}: Current type is 8300 (Linux filesystem) Hex code or GUID (L to show codes, Enter = 8300): Changed type of partition to 'Linux filesystem'

Command (? for help): p Disk /dev/sdc: 976773168 sectors, 465.8 GiB Model: USB 3.5"-HDD Sector size (logical/physical): 512/512 bytes Disk identifier (GUID): 96231FD8-EEE4-4EFB-846A-5527772B96FC Partition table holds up to 128 entries Main partition table begins at sector 2 and ends at sector 33 First usable sector is 34, last usable sector is 976773134 Partitions will be aligned on 2048-sector boundaries Total free space is 2014 sectors (1007.0 KiB)

Number Start (sector) End (sector) Size Code Name

  1            2048         1050623   512.0 MiB   EF00  EFI system partition
  2         1050624       976773134   465.3 GiB   8300  Linux filesystem

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!

Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/sdc. The operation has completed successfully.


Weitere Beispiele

(Bei den folgenden Beispielen ist lediglich die Eingabe notiert.)
Für x ist jeweils das konkrete Laufwerk zu setzen.

1 Partition

/boot, root (/)

(siehe oben)

  • gdisk /dev/x – Starten von gdisk
  • N – Erstellen einer leeren Partitionstabelle
  • ↵ Enter – Erstellen einer Partition
  • ↵ Enter – Den ersten Sektor bestätigen
  • +512M – Die Partition 512 Megabyte groß zu machen
  • ef00 – Bestimmen, dass es eine EFI-Partition ist
  • n – Eine weitere Partition erstellen
  • ↵ Enter – Erstellen der Partition bestätigen
  • ↵ Enter – Ersten Sektor bestätigen
  • ↵ Enter – Letzten Sektor bestätigen
  • ↵ Enter – Partitionstypen bestätigen

siehe auch