Benutzer:Tuxnix: Unterschied zwischen den Versionen

Aus wiki.archlinux.de
Keine Bearbeitungszusammenfassung
(Entwurf)
Zeile 37: Zeile 37:
  Creating new GPT entries in memory.<br>
  Creating new GPT entries in memory.<br>
  Command (? for help):<span style="color:maroon"> o</span>
  Command (? for help):<span style="color:maroon"> o</span>
  This option deletes all partitions and creates a new protective MBR.<br>
  This option deletes all partitions and creates a new protective MBR.
  Proceed? (Y/N): <span style="color:maroon">y</span><br>
  Proceed? (Y/N):<span style="color:maroon"> y</span><br>
  Command (? for help):<span style="color:maroon"> n</span>
  Command (? for help):<span style="color:maroon"> n</span>
  Partition number (1-128, default 1):<span style="color:maroon">{{taste|Enter}}</span>
  Partition number (1-128, default 1):<span style="color:maroon">{{taste|Enter}}</span>
  First sector (34-976773134, default = 2048) or {+-}size{KMGTP}:<span style="color:maroon">{{taste|Enter}}</span>
  First sector (34-976773134, default = 2048) or {+-}size{KMGTP}:<span style="color:maroon">{{taste|Enter}}</span>  
  Last sector (2048-976773134, default = 976773134) or {+-}size{KMGTP}:<span style="color:maroon">{{taste|Enter}}</span>
  Last sector (2048-976773134, default = 976773134) or {+-}size{KMGTP}:<span style="color:maroon"> +512M</span>
  Current type is 8300 (Linux filesystem)<br>
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):<span style="color:maroon"> ef00</span>
Changed type of partition to 'EFI system partition'<br>
Command (? for help):<span style="color:maroon"> n</span>
Partition number (2-128, default 2):<span style="color:maroon">{{taste|Enter}}</span>
First sector (34-976773134, default = 1050624) or {+-}size{KMGTP}:<span style="color:maroon">{{taste|Enter}}</span>
Last sector (1050624-976773134, default = 976773134) or {+-}size{KMGTP}:<span style="color:maroon">{{taste|Enter}}</span>
  Current type is 8300 (Linux filesystem)
  Hex code or GUID (L to show codes, Enter = 8300):<span style="color:maroon">{{taste|Enter}}</span>
  Hex code or GUID (L to show codes, Enter = 8300):<span style="color:maroon">{{taste|Enter}}</span>
  Changed type of partition to 'Linux filesystem'<br>
  Changed type of partition to 'Linux filesystem'<br>
  Command (? for help):<span style="color:maroon"> w</span>
Command (? for help):<span style="color:maroon"> p</span>
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)<br>
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<br>
  Command (? for help):<span style="color:maroon"> w</span><br>
  Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!<br>
  Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!<br>
  Do you want to proceed? (Y/N):<span style="color:maroon"> y</span>
  Do you want to proceed? (Y/N):<span style="color:maroon"> y</span>
  OK; writing new GUID partition table (GPT) to /dev/sda.
  OK; writing new GUID partition table (GPT) to /dev/sdc.
  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==
Zeile 114: Zeile 77:


===1 Partition===
===1 Partition===
* {{ic|gdisk /dev/'''x'''}} –  Starten von gdisk
* {{taste|o}} – Erzeugen einer neuen GPT im cache. (Protektiver MBR zur Kompatibilität)
* {{taste|y}} – Bestätigung
* {{ic|n}} – Eine neue Partition erstellen
* {{taste|Enter}} – Partitionsnummer bestätigen
* {{taste|Enter}} – Ersten Sektor bestätigen
* {{taste|Enter}} – Letzten Sektor bestätigen
* {{taste|Enter}} – Linux Partitionstyp (8300)bestätigen
* {{taste|p}} - Zeige neue Partitionstabelle zur Überprüfung an. 
* {{taste|w}} - Speicher der neue Partitionstabelle.
* {{taste|y}} – Bestätigung


===/boot, root (/)===
===/boot, root (/)===
(siehe oben)
Die gebräuchliche Partitionierung für UEFI-Boot-Systeme. (siehe oben)


* {{ic|gdisk /dev/'''x'''}} –  Starten von gdisk
* {{ic|gdisk /dev/'''x'''}} –  Starten von gdisk
* {{taste|N}} – Erstellen einer leeren Partitionstabelle
* {{taste|o}} – Erzeugen einer neuen GPT im cache. (Protektiver MBR zur Kompatibilität)
* {{taste|Enter}} – Erstellen einer Partition
* {{taste|y}} – Bestätigung
* {{taste|n}} – Erstellen einer neuen Partition
* {{taste|Enter}} – Partitionsnummer bestätigen
* {{taste|Enter}} – Den ersten Sektor bestätigen
* {{taste|Enter}} – Den ersten Sektor bestätigen
* {{ic|+512M}} – Die Partition 512 Megabyte groß zu machen
* {{ic|+512M}} – Die Partition 512 Megabyte groß zu machen
Zeile 128: Zeile 105:
* {{taste|Enter}} – Ersten Sektor bestätigen
* {{taste|Enter}} – Ersten Sektor bestätigen
* {{taste|Enter}} – Letzten Sektor bestätigen
* {{taste|Enter}} – Letzten Sektor bestätigen
* {{taste|Enter}} – Partitionstypen bestätigen
* {{taste|Enter}} – Linux Partitionstyp (8300)bestätigen
* {{taste|p}} - Zeige neue Partitionstabelle zur Überprüfung an. 
* {{taste|w}} - Speicher der neue Partitionstabelle.
* {{taste|y}} – Bestätigung


== siehe auch ==
== siehe auch ==

Version vom 28. November 2020, 17:10 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}: +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):↵ Enter First sector (34-976773134, default = 1050624) or {+-}size{KMGTP}:↵ Enter Last sector (1050624-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): 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

  • gdisk /dev/x – Starten von gdisk
  • o – Erzeugen einer neuen GPT im cache. (Protektiver MBR zur Kompatibilität)
  • y – Bestätigung
  • n – Eine neue Partition erstellen
  • ↵ Enter – Partitionsnummer bestätigen
  • ↵ Enter – Ersten Sektor bestätigen
  • ↵ Enter – Letzten Sektor bestätigen
  • ↵ Enter – Linux Partitionstyp (8300)bestätigen
  • p - Zeige neue Partitionstabelle zur Überprüfung an.
  • w - Speicher der neue Partitionstabelle.
  • y – Bestätigung

/boot, root (/)

Die gebräuchliche Partitionierung für UEFI-Boot-Systeme. (siehe oben)

  • gdisk /dev/x – Starten von gdisk
  • o – Erzeugen einer neuen GPT im cache. (Protektiver MBR zur Kompatibilität)
  • y – Bestätigung
  • n – Erstellen einer neuen Partition
  • ↵ Enter – Partitionsnummer bestätigen
  • ↵ 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 – Linux Partitionstyp (8300)bestätigen
  • p - Zeige neue Partitionstabelle zur Überprüfung an.
  • w - Speicher der neue Partitionstabelle.
  • y – Bestätigung

siehe auch