Fdisk: Unterschied zwischen den Versionen

Aus Foxwiki
Markierung: Zurückgesetzt
KKeine Bearbeitungszusammenfassung
Markierung: Manuelle Zurücksetzung
Zeile 1: Zeile 1:
'''topic''' kurze Beschreibung
fdisk ('''f'''ixed '''disk''') manipuliert Partitionen (GPT, MBR, Sun, SGI und BSD).


= Beschreibung =
=Modi=
= Installation =
==interaktiver Modus==
= Syntax =
*Wird über Kommandos gesteuert.
== Parameter ==
*Alle Änderungen werden erst vorgemerkt.
== Optionen ==
*Kann jederzeit mit '''Q''' (quit) verlassen werden, ohne Veränderungen am Datenträger vorzunehmen.
= Konfiguration =
*Erst mit '''W''' (write) werden alle Informationen unwiderruflich festgeschrieben.
== Dateien ==


= Anwendungen =
==nicht-interaktiver Modus==
= Dokumentation =
*Wird über Optionen gesteuert.
== Man-Pages ==
*Ist geeignet, um in Scripten verwendet zu werden. Im Gegensatz zum interaktiven Modus.
== Info-Pages ==
= Links =
== Intern ==
== Weblinks ==


= Testfragen =
=Syntax=
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 1''
<div class="mw-collapsible-content">'''Antwort1'''</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 2''
<div class="mw-collapsible-content">'''Antwort2'''</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 3''
<div class="mw-collapsible-content">'''Antwort3'''</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 4''
<div class="mw-collapsible-content">'''Antwort4'''</div>
</div>
<div class="toccolours mw-collapsible mw-collapsed">
''Testfrage 5''
<div class="mw-collapsible-content">'''Antwort5'''</div>
</div>


= TMP =
fdisk [Optionen] DATENTRAEGER
'''fdisk (fixed disk) ist ein Kommandozeilen-Programm zur Partitionierung von Festplatten. fdisk gibt es für Windows und Linux. Man kann fdisk in Linux benutzen, um Partitionen anzuzeigen, anzulegen, zu manipulieren oder zu löschen'''.


Um fdisk zu benutzen, geben Sie fdisk und den Namen der Festplatte, die Sie partitionieren    wollen, ein. Dies wird das fdisk Prompt eröffnen. Um beispielsweise die primäre SATA Festplatte  zu partitionieren, benutzen wir den folgenden Befehl
=Optionen=


=Beispel=  
{|class="wikitable"
!Option !! Beschreibung
|-
| -b, --sector-size ''SEKTORGROESSE''|| Ändern der Sektorgröße. Gültige Werte: 512, 1024, 2048 oder 4096.
fdisk unterscheidet zwischen logischer und physischer Sektorgröße. Option ändert beide Sektorgrößen auf ''SEKTORGROESSE''.
|-
| -B, --protect-boot || Verhindert das '''Löschen des 1. Sektors''' des Datenträgers, wenn eine neue Festplattenbezeichnung erzeugt wird.
|-
| -c, --compatibility[=''MODUS''] || Legt den '''Kompatibilitätsmodus''' fest (dos oder nondos).
Für Abwärtskompatibilität, kann die Option ohne ''MODUS''-Argument verwendet werden, dann wird der Standardwert nondos verwendet.
Beachten: Optionales ''MODUS''-Argument darf nicht durch ein Leerzeichen von der -c-Option getrennt werden => -c=dos.
|-
| -h, --help || Zeigt '''Hilfe''' an und beendet Programm.
|-
| -L, --color[=''WANN''] || Stellt '''Ausgabe farbig''' dar. Optionales ''WANN''-Argument kann ''auto'', ''never'' oder ''always'' sein.
Ohne Angabe des ''WANN''-Arguments, ist ''auto'' der Standardwert. Farben können deaktiviert werden.
|-
| -l, --list || Gibt '''Partitionstabellen''' für angegebene Datenträger aus u. beendet das Programm.
Ohne Angabe eines Datenträgers, werden die Datenträger  aus /proc/partitions verwendet.
|-
| -o, --output ''SPALTE'' || Gibt an, welche '''Spalten''' in der Ausgabe angezeigt werden sollen. Mit --help erhalten Sie eine Liste aller unterstützten Spalten. -l, --list muss ebenfalls angegeben werden.
Die voreingestellte Liste der Spalten kann erweitert werden, indem man die Liste im Format ''+SPALTE'' angibt (z.B. -o ''+UUID'').
|-
|  -t, --type ''TYP'' || Aktiviert die Unterstützung für Plattenbezeichnungen des angegebenen ''TYP''s, z.B. gpt od. dos und deaktiviert die Unterstützung für alle anderen Typen.
|-
| -u, --units[=''EINHEIT'']|| Legt fest, ob bei der Ausgabe von Partitionstabellen die Größe in Sektoren oder Zylindern angegeben wird.
Ohne das ''EINHEIT''-Argument wird als Standard die Größe in Sektoren ausgegeben.
 
Beachten: Optionales ''EINHEIT''-Argument darf nicht durch ein Leerzeichen von der -u-Option => -u=cylinders.
|- 
| -H, --heads ''ZAHL'' || Legt die Anzahl der Köpfe der Festplatte, die für Partitionstabellen verwendet werden sollen fest, nicht die physikalische Anzahl.
Vernünftige Werte sind 255 und 16.
|-
| -S, --sectors ''ZAHL'' || Legt fest, wie viele Sektoren sich auf einer Spur der Platte befinden, die für Partitionstabellen verwendete, nicht die physikalische Anzahl.
Ein sinnvoller Wert ist 63.
|-
| -w, --wipe ''WANN'' || Löscht Dateisystem-, RAID- und Partitionstabellensignaturen von dem Gerät, um mögliche Kollisionen zu vermeiden.
Mögliche ''WANN''-Argumente: ''auto'', ''never'' oder ''always''.
Ohne das ''WANN''-Argument wird als Standard ''auto'' verwendet, d.h. die Signaturen werden nur im interaktiven Modus gelöscht.
|-
| -V, --version || Zeigt Versionsinformationen an und beendet das Programm.
|}
 
=Kommandos=
 
==Hauptmenü==
 
===Auswahl von Kommandos ohne Veränderungen an einer MBR-Partitionstabelle===
{|class="wikitable"
!Kommando !! Beschreibung
|-
| m || Ausgabe eines Hilfetextes der zur Verfügung stehenden Kommandos.
|-
| p || Anzeige der Informationen zu MBR-Partitionen eines Datenträgers.
|-
| u || Umschalten der Einheiten-Anzeige.
|-
| x || Aufruf der Menü-Ebene 2 (zusätzliche Funktionen - nur für Experten).
|-
| q || Verlassen des Programms ohne Veränderungen auf den Datenträger zu schreiben.
|}
 
===Auswahl von Kommandos mit Veränderungen an einer MBR-Partitionstabelle===
{|class="wikitable"
!Kommando !! Beschreibung
|-
| a || (De)Aktivieren des "bootfähig"-Flag einer MBR-Partition eines Datenträgers.
|-
| c || (De)Aktivieren des DOS-Kompatibilitätsflags.
|-
| d || Löschen einer MBR-Partition.
|-
| n || Neuanlage einer MBR-Partition.
|-
| o || Neuanlage einer leeren DOS-Partitionstabelle (Typ msdos)
|-
| t || Änderung des Dateisystemtyps (ID) einer Partition.
|-
| w || Abspeichern aller Änderungen in die MBR-Partitionstabelle eines Datenträgers.
|}
 
==Expertenmenü==
 
===Auswahl von zusätzlichen Funktionen mit/ohne Veränderungen===
{|class="wikitable"
!Kommando !! Beschreibung
|-
| b || Datenanfang einer Partition eines Datenträgers verschieben.
|-
| f || Einträge in einer MBR-Partitionstabelle in Reihenfolge bringen.
|-
| r || Zurückwechseln zur Menüebene 1 (Hauptmenü).
|-
| v || Überprüfen einer MBR-Partitionstabelle.
|}
 
=Anwendung=
 
==Anzeigen der Partitionstabellen aller Datenträger==


  # fdisk -l
  #fdisk -l
Disk /dev/sda: 637.8 GB, 637802643456 bytes
255 heads, 63 sectors/track, 77541 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          13      104391  83  Linux
/dev/sda2              14        2624    20972857+  83  Linux
/dev/sda3            2625        4582    15727635  83  Linux
/dev/sda4            4583      77541  586043167+  5  Extended
/dev/sda5            4583        5887    10482381  83  Linux
/dev/sda6            5888        7192    10482381  83  Linux
/dev/sda7            7193        7845    5245191  83  Linux
/dev/sda8            7846        8367    4192933+  82  Linux swap / Solaris
/dev/sda9            8368      77541  555640123+  8e  Linux LVM


  Disk /dev/sdb: 3.8 GiB, 4009754624 bytes, 7831552 sectors
  Disk /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: SAMSUNG HD103SJ
  Units: sectors of 1 * 512 = 512 bytes
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disklabel type: dos
  Disk identifier: 0x1c01bde6
  Disk identifier: 0x5bbfa64b
Device    Boot    Start        End    Sectors  Size Id Type
/dev/sda1          2048  39063551  39061504  18,6G fd Linux raid autodetect
/dev/sda2      39065598 1949218815 1910153218 910,9G  5 Extended
/dev/sda5      39065600  50782207  11716608  5,6G 82 Linux swap / Solaris
/dev/sda6      50784256 1949218815 1898434560 905,3G fd Linux raid autodetect
Disk /dev/sdc: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WDC WD20EZRX-00D
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xc54dca74
Device    Boot Start        End    Sectors  Size Id Type
/dev/sdc1        2048 3907020976 3907018929  1,8T fd Linux raid autodetect
 
 
Disk /dev/sde: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA HDWD120
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x9d878eda
Device    Boot Start        End    Sectors  Size Id Type
/dev/sde1        2048 3907020976 3907018929  1,8T fd Linux raid autodetect
 
 
Disk /dev/sdb: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Hitachi HDS72202
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: 0x1c13a897
Device    Boot Start        End    Sectors  Size Id Type
/dev/sdb1        2048 3907020976 3907018929  1,8T fd Linux raid autodetect
 
==Anzeigen der Partitionstabelle eines bestimmten Datenträgers==
 
 
#fdisk -l /dev/sde
 
Disk /dev/sde: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA HDWD120
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x9d878eda
Device    Boot Start        End    Sectors  Size Id Type
/dev/sde1        2048 3907020976 3907018929  1,8T fd Linux raid autodetect
 
== Anzeige in der Größeneinheit cylinders==
 
*Die Standardgrößeneinheit ist [https://en.wikipedia.org/wiki/Cylinder-head-sector#Sectors sectors] (Sektoren).
# fdisk -l /dev/sda1
Disk /dev/sda1: 18,6 GiB, 19999490048 bytes, 39061504 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
 
*Änderung der Größeneinheit von sectors auf [https://en.wikipedia.org/wiki/Cylinder-head-sector#Cylinders cylinders] (Zylinder).
# fdisk -lu=cylinders /dev/sda1
Disk /dev/sda1: 18,6 GiB, 19999490048 bytes, 39061504 sectors
'''Units: cylinders of 16065 * 512 = 8225280 bytes'''
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
 
*Optionen '''-lu''' stehen für '''l'''ist und '''u'''nits.
*mehr Info: [https://en.wikipedia.org/wiki/Cylinder_Head_Sector Cylinder Head Sector]
 
==Wechsel in den interaktiven Modus==
 
# fdisk /dev/sdd
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help):
 
==Kommandoübersicht anzeigen lassen==


  Device    Boot Start    End Sectors  Size Id Type
  # fdisk /dev/sdc
/dev/sdb1        8064 783


  Befehl '''fdisk''' [Optionen] DATENTRAEGER1551 7823488  3.7G  b W95 FAT32 
  Welcome to fdisk (util-linux 2.33.1).                                                                                                           
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xdfca4904.
Command (m for help): '''m'''


Help:
  DOS (MBR)
  a  toggle a bootable flag
  b  edit nested BSD disklabel
  c  toggle the dos compatibility flag
  Generic
  d  delete a partition
  F  list free unpartitioned space
  l  list known partition types
  n  add a new partition
  p  print the partition table
  t  change a partition type
  v  verify the partition table
  i  print information about a partition
  Misc
  m  print this menu
  u  change display/entry units
  x  extra functionality (experts only)
  Script
  I  load disk layout from sfdisk script file
  O  dump disk layout to sfdisk script file
  Save & Exit
  w  write table to disk and exit
  q  quit without saving changes
   
   
# fdisk -l /dev/sda
   Create a new label
Disk /dev/sda: 637.8 GB, 637802643456 bytes
  g   create a new empty GPT partition table
255 heads, 63 sectors/track, 77541 cylinders
   G   create a new empty SGI (IRIX) partition table
Units = cylinders of 16065 * 512 = 8225280 bytes
   o   create a new empty DOS partition table
Device Boot      Start        End      Blocks   Id  System
   s   create a new empty Sun partition table
/dev/sda1   *          1          13      104391  83  Linux
 
/dev/sda2              14        2624    20972857+  83  Linux
==Nummernindex der Partitionstypen anzeigen lassen==
/dev/sda3            2625        4582   15727635   83  Linux
/dev/sda4            4583      77541  586043167+  5  Extended
/dev/sda5            4583        5887   10482381   83  Linux
/dev/sda6            5888        7192   10482381   83  Linux
/dev/sda7            7193        7845    5245191  83  Linux
/dev/sda8            7846        8367    4192933+  82  Linux swap / Solaris
/dev/sda9            8368      77541  555640123+  8e  Linux LVM 


  # fdisk /dev/sda
  # fdisk /dev/sda
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): 


# fdisk /dev/sda
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): '''t'''
 
Selected partition 1
Partition type (type L to list all types): '''L'''
 
  1 EFI System                    C12A7328-F81F-11D2-BA4B-00A0C93EC93B
  2 MBR partition scheme          024DEE41-33E7-11D3-9D69-0008C781F39F
  3 Intel Fast Flash              D3BFE2DE-3DAF-11DF-BA40-E3A556D89593
  4 BIOS boot                      21686148-6449-6E6F-744E-656564454649
  5 Sony boot partition            F4019732-066E-4E12-8273-346C5641494F
  6 Lenovo boot partition          BFBFAFE7-A34F-448A-9A5B-6213EB736C22
  7 PowerPC PReP boot              9E1A2D38-C612-4316-AA26-8B49521E5A8B
  8 ONIE boot                      7412F7D5-A156-4B13-81DC-867174929325
  9 ONIE config                    D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149
10 Microsoft reserved            E3C9E316-0B5C-4DB8-817D-F92DF00215AE
11 Microsoft basic data          EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
12 Microsoft LDM metadata        5808C8AA-7E8F-42E0-85D2-E1E90434CFB3
13 Microsoft LDM data            AF9B60A0-1431-4F62-BC68-3311714A69AD
14 Windows recovery environment  DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
15 IBM General Parallel Fs        37AFFC90-EF7D-4E96-91C3-2D7AE055B174
16 Microsoft Storage Spaces      E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D
17 HP-UX data                    75894C1E-3AEB-11D3-B7C1-7B03A0000000
18 HP-UX service                  E2A1E728-32E3-11D6-A682-7B03A0000000
19 Linux swap                    0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
20 Linux filesystem              0FC63DAF-8483-4772-8E79-3D69D8477DE4
21 Linux server data              3B8F8425-20E0-4F3B-907F-1A25A76F98E8
22 Linux root (x86)              44479540-F297-41B2-9AF7-D131D5F0458A
23 Linux root (ARM)              69DAD710-2CE4-4E3C-B16C-21A1D49ABED3
24 Linux root (x86-64)            4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709
25 Linux root (ARM-64)            B921B045-1DF0-41C3-AF44-4C6F280D3FAE
26 Linux root  (IA-64)            993D8D3D-F80E-4225-855A-9DAF8ED7EA97
27 Linux reserved                8DA63339-0007-60C0-C436-083AC8230908
28 Linux home                    933AC7E1-2EB4-4F13-B844-0E14E2AEF915
29 Linux RAID                    A19D880F-05FC-4D3B-A006-743F0F84911E
30 Linux extended boot            BC13C2FF-59E6-4262-A352-B275FD6F7172
31 Linux LVM                      E6D6D379-F507-44C2-A23C-238F2A3DF928
32 FreeBSD data                  516E7CB4-6ECF-11D6-8FF8-00022D09712B
33 FreeBSD boot                  83BD6B9D-7F41-11DC-BE0B-001560B84F0F
34 FreeBSD swap                  516E7CB5-6ECF-11D6-8FF8-00022D09712B
35 FreeBSD UFS                    516E7CB6-6ECF-11D6-8FF8-00022D09712B
36 FreeBSD ZFS                    516E7CBA-6ECF-11D6-8FF8-00022D09712B
37 FreeBSD Vinum                  516E7CB8-6ECF-11D6-8FF8-00022D09712B
38 Apple HFS/HFS+                48465300-0000-11AA-AA11-00306543ECAC
 
*Hier werden die ersten 38 Partitionstypen angezeigt.
*Durch Drücken der Enter-Taste wird jeweils der nächste mögliche Partitionstyp angezeigt.
 
39 Apple UFS                      55465300-0000-11AA-AA11-00306543ECAC
40 Apple RAID                    52414944-0000-11AA-AA11-00306543ECAC
41 Apple RAID offline            52414944-5F4F-11AA-AA11-00306543ECAC
42 Apple boot                    426F6F74-0000-11AA-AA11-00306543ECAC
43 Apple label                    4C616265-6C00-11AA-AA11-00306543ECAC
44 Apple TV recovery              5265636F-7665-11AA-AA11-00306543ECAC
45 Apple Core storage            53746F72-6167-11AA-AA11-00306543ECAC
46 Solaris boot                  6A82CB45-1DD2-11B2-99A6-080020736631
47 Solaris root                  6A85CF4D-1DD2-11B2-99A6-080020736631
48 Solaris /usr & Apple ZFS      6A898CC3-1DD2-11B2-99A6-080020736631
49 Solaris swap                  6A87C46F-1DD2-11B2-99A6-080020736631
50 Solaris backup                6A8B642B-1DD2-11B2-99A6-080020736631
51 Solaris /var                  6A8EF2E9-1DD2-11B2-99A6-080020736631
52 Solaris /home                  6A90BA39-1DD2-11B2-99A6-080020736631
53 Solaris alternate sector      6A9283A5-1DD2-11B2-99A6-080020736631
54 Solaris reserved 1            6A945A3B-1DD2-11B2-99A6-080020736631
55 Solaris reserved 2            6A9630D1-1DD2-11B2-99A6-080020736631
56 Solaris reserved 3            6A980767-1DD2-11B2-99A6-080020736631
57 Solaris reserved 4            6A96237F-1DD2-11B2-99A6-080020736631
58 Solaris reserved 5            6A8D2AC7-1DD2-11B2-99A6-080020736631
59 NetBSD swap                    49F48D32-B10E-11DC-B99B-0019D1879648
60 NetBSD FFS                    49F48D5A-B10E-11DC-B99B-0019D1879648
61 NetBSD LFS                    49F48D82-B10E-11DC-B99B-0019D1879648
62 NetBSD concatenated            2DB519C4-B10E-11DC-B99B-0019D1879648
63 NetBSD encrypted              2DB519EC-B10E-11DC-B99B-0019D1879648
64 NetBSD RAID                    49F48DAA-B10E-11DC-B99B-0019D1879648
65 ChromeOS kernel                FE3A2A5D-4F32-41A7-B725-ACCC3285A309
66 ChromeOS root fs              3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC
67 ChromeOS reserved              2E0A753D-9E48-43B0-8337-B15192CB1B5E
68 MidnightBSD data              85D5E45A-237C-11E1-B4B3-E89A8F7FC3A7
69 MidnightBSD boot              85D5E45E-237C-11E1-B4B3-E89A8F7FC3A7
70 MidnightBSD swap              85D5E45B-237C-11E1-B4B3-E89A8F7FC3A7
71 MidnightBSD UFS                0394EF8B-237E-11E1-B4B3-E89A8F7FC3A7
72 MidnightBSD ZFS                85D5E45D-237C-11E1-B4B3-E89A8F7FC3A7
73 MidnightBSD Vinum              85D5E45C-237C-11E1-B4B3-E89A8F7FC3A7
74 Ceph Journal                  45B0969E-9B03-4F30-B4C6-B4B80CEFF106
75 Ceph Encrypted Journal        45B0969E-9B03-4F30-B4C6-5EC00CEFF106
76 Ceph OSD                      4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D
77 Ceph crypt OSD                4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D
78 Ceph disk in creation          89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE
79 Ceph crypt disk in creation    89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE
80 VMware VMFS                    AA31E02A-400F-11DB-9590-000C2911D1B8
81 VMware Diagnostic              9D275380-40AD-11DB-BF97-000C2911D1B8
82 VMware Virtual SAN            381CFCCC-7288-11E0-92EE-000C2911D0B2
83 VMware Virsto                  77719A0C-A4A0-11E3-A47E-000C29745A24
84 VMware Reserved                9198EFFC-31C0-11DB-8F78-000C2911D1B8
85 OpenBSD data                  824CC7A0-36A8-11E3-890A-952519AD3F61
86 QNX6 file system              CEF5A9AD-73BC-4601-89F3-CDEEEEE321A1
87 Plan 9 partition              C91818F9-8025-47AF-89D2-F030D7000C2C
(END)
 
*In diesem Fall sind noch weitere 49 Partitionstypen möglich.
*Durch Eingabe des Buchstaben q schließt sich die Liste und der Partitionstyp kann durch Eingabe der Partitionsnummer geändert werden.
 
==Neue primäre Partition anlegen==
===Auswählen===
# fdisk /dev/sdc
 
Welcome to fdisk (util-linux 2.33.1).                                                                                                           
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xdfca4904.
 
Command (m for help): '''g'''
 
Created a new GPT disklabel (GUID: 748568BC-EC8C-F34A-B822-45C2E267CFFB).
 
*Als Disklabel wurde GPT festgelegt.
**'''g''' steht für gpt
 
Command (m for help): '''n'''
Partition number (1-128, ''default'' 1):
First sector (2048-3907029134, ''default'' 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-3907029134, ''default'' 3907029134): '''+1842G'''
 
Created a new partition 1 of type 'Linux filesystem' and of size 1,8 TiB.
 
*Neue Partitionstabelle wurde (vor)angelegt (siehe [[Linux:Befehl:fdisk#Auswahl von Kommandos mit Veränderungen an einer MBR-Partitionstabelle|Kommando '''w''']]).
**'''n''' steht für new
 
*Soll als primäre Partition angelegt werden.
**'''1''' oder einfach "Enter" drücken, dann wird der Standardwert (''default'') genommen.
*Am Anfang des Datenträgers werden 2048 Sektoren ungenutzt gelassen, um ein optimales [[Linux:Software-RAID:Anlegen#Alignment (Ausrichtung)|Alignment]] zu ermöglichen.
*Der erste Sektor der Partition soll bei Sektor 2048 beginnen.
**'''2048''' oder einfach "Enter" drücken, dann wird der Standardwert (''default'') genommen.
*Am Ende des Datenträgers werden auch Sektoren ungenutzt gelassen, denn falls nach Jahren ein Datenträger ausfällt und keine baugleiche Festplatte mehr beschafft werden kann, wird das RAID zum Datengrab.
*Werden Sektoren am Ende ungenutzt gelassen, kann ein Datenträger, der einige Sektoren weniger hat, problemlos verwendet werden.
*Hier sollen sicherheitshalber 1,2 GiB frei bleiben.
**1,8 TiB = 1843,2 GiB => '''+1842G'''
Command (m for help): '''t'''
 
Selected partition 1
Partition type (type L to list all types): '''29'''
 
Changed type of partition 'Linux filesystem' to 'Linux RAID'.
 
*Der Partitionstyp wurde auf "Linux RAID" geändert.
**'''t''' steht für type
*Die Nummer für den Partitionstyp "Linux RAID" ist die 29 (siehe [[Linux:Befehl:fdisk#Nummernindex der Partitionstypen anzeigen lassen|Nummernindex der Partitionstypen]]).
**'''29'''
 
===Kontrolle===
 
Command (m for help): '''p'''
 
Disk '''/dev/sdc''': 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WDC WD20EZRX-00D
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: '''gpt'''
Disk identifier: 748568BC-EC8C-F34A-B822-45C2E267CFFB
Device    Start        End    Sectors  Size Type
/dev/sdc'''1'''  '''2048''' '''3862956031''' 3862953984  1,8T '''Linux RAID'''
 
*Vor dem tatsächlichen Schreiben der Partitionstabelle bzw. Änderungen daran, sollte alles nochmal kontrolliert werden.
**'''p''' steht für print
 
===Schreiben===
 
Command (m for help): '''w'''
 
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
 
*Partitionstabelle wurde tatsächlich geschrieben.
**'''w''' steht für write
 
==Partitionstyp ändern==
 
# fdisk /dev/sda
 
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): '''t'''
 
Selected partition 1
Partition type (type L to list all types): '''19'''
 
Changed type of partition 'Linux filesystem' to 'Linux swap'.


WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): m
Command action
a  toggle a bootable flag
b  edit bsd disklabel
c  toggle the dos compatibility flag
d  delete a partition
l  list known partition types
m  print this menu
n  add a new partition
o  create a new empty DOS partition table
p  print the partition table
q  quit without saving changes
s  create a new empty Sun disklabel
t  change a partition's system id
u  change display/entry units
v  verify the partition table
w  write table to disk and exit
x  extra functionality (experts only)
Command (m for help): 
=Quellen=
=Quellen=
[ https://linux.die.net/man/8/fdisk https://linux.die.net/man/8/fdisk]
[https://linux.die.net/man/8/fdisk https://linux.die.net/man/8/fdisk]


[https://manpages.debian.org/stretch/manpages-de/fdisk.8.de.html https://manpages.debian.org/stretch/manpages-de/fdisk.8.de.html]
[https://manpages.debian.org/stretch/manpages-de/fdisk.8.de.html https://manpages.debian.org/stretch/manpages-de/fdisk.8.de.html]
Zeile 127: Zeile 478:


[[Category:Linux:Storage]]
[[Category:Linux:Storage]]
[[Category:Linux:Befehl]]

Version vom 18. März 2022, 14:15 Uhr

fdisk (fixed disk) manipuliert Partitionen (GPT, MBR, Sun, SGI und BSD).

Modi

interaktiver Modus

  • Wird über Kommandos gesteuert.
  • Alle Änderungen werden erst vorgemerkt.
  • Kann jederzeit mit Q (quit) verlassen werden, ohne Veränderungen am Datenträger vorzunehmen.
  • Erst mit W (write) werden alle Informationen unwiderruflich festgeschrieben.

nicht-interaktiver Modus

  • Wird über Optionen gesteuert.
  • Ist geeignet, um in Scripten verwendet zu werden. Im Gegensatz zum interaktiven Modus.

Syntax

fdisk [Optionen] DATENTRAEGER

Optionen

Option Beschreibung
-b, --sector-size SEKTORGROESSE Ändern der Sektorgröße. Gültige Werte: 512, 1024, 2048 oder 4096.

fdisk unterscheidet zwischen logischer und physischer Sektorgröße. Option ändert beide Sektorgrößen auf SEKTORGROESSE.

-B, --protect-boot Verhindert das Löschen des 1. Sektors des Datenträgers, wenn eine neue Festplattenbezeichnung erzeugt wird.
-c, --compatibility[=MODUS] Legt den Kompatibilitätsmodus fest (dos oder nondos).

Für Abwärtskompatibilität, kann die Option ohne MODUS-Argument verwendet werden, dann wird der Standardwert nondos verwendet.

Beachten: Optionales MODUS-Argument darf nicht durch ein Leerzeichen von der -c-Option getrennt werden => -c=dos.

-h, --help Zeigt Hilfe an und beendet Programm.
-L, --color[=WANN] Stellt Ausgabe farbig dar. Optionales WANN-Argument kann auto, never oder always sein.

Ohne Angabe des WANN-Arguments, ist auto der Standardwert. Farben können deaktiviert werden.

-l, --list Gibt Partitionstabellen für angegebene Datenträger aus u. beendet das Programm.

Ohne Angabe eines Datenträgers, werden die Datenträger aus /proc/partitions verwendet.

-o, --output SPALTE Gibt an, welche Spalten in der Ausgabe angezeigt werden sollen. Mit --help erhalten Sie eine Liste aller unterstützten Spalten. -l, --list muss ebenfalls angegeben werden.

Die voreingestellte Liste der Spalten kann erweitert werden, indem man die Liste im Format +SPALTE angibt (z.B. -o +UUID).

-t, --type TYP Aktiviert die Unterstützung für Plattenbezeichnungen des angegebenen TYPs, z.B. gpt od. dos und deaktiviert die Unterstützung für alle anderen Typen.
-u, --units[=EINHEIT] Legt fest, ob bei der Ausgabe von Partitionstabellen die Größe in Sektoren oder Zylindern angegeben wird.

Ohne das EINHEIT-Argument wird als Standard die Größe in Sektoren ausgegeben.

Beachten: Optionales EINHEIT-Argument darf nicht durch ein Leerzeichen von der -u-Option => -u=cylinders.

-H, --heads ZAHL Legt die Anzahl der Köpfe der Festplatte, die für Partitionstabellen verwendet werden sollen fest, nicht die physikalische Anzahl.

Vernünftige Werte sind 255 und 16.

-S, --sectors ZAHL Legt fest, wie viele Sektoren sich auf einer Spur der Platte befinden, die für Partitionstabellen verwendete, nicht die physikalische Anzahl.

Ein sinnvoller Wert ist 63.

-w, --wipe WANN Löscht Dateisystem-, RAID- und Partitionstabellensignaturen von dem Gerät, um mögliche Kollisionen zu vermeiden.

Mögliche WANN-Argumente: auto, never oder always. Ohne das WANN-Argument wird als Standard auto verwendet, d.h. die Signaturen werden nur im interaktiven Modus gelöscht.

-V, --version Zeigt Versionsinformationen an und beendet das Programm.

Kommandos

Hauptmenü

Auswahl von Kommandos ohne Veränderungen an einer MBR-Partitionstabelle

Kommando Beschreibung
m Ausgabe eines Hilfetextes der zur Verfügung stehenden Kommandos.
p Anzeige der Informationen zu MBR-Partitionen eines Datenträgers.
u Umschalten der Einheiten-Anzeige.
x Aufruf der Menü-Ebene 2 (zusätzliche Funktionen - nur für Experten).
q Verlassen des Programms ohne Veränderungen auf den Datenträger zu schreiben.

Auswahl von Kommandos mit Veränderungen an einer MBR-Partitionstabelle

Kommando Beschreibung
a (De)Aktivieren des "bootfähig"-Flag einer MBR-Partition eines Datenträgers.
c (De)Aktivieren des DOS-Kompatibilitätsflags.
d Löschen einer MBR-Partition.
n Neuanlage einer MBR-Partition.
o Neuanlage einer leeren DOS-Partitionstabelle (Typ msdos)
t Änderung des Dateisystemtyps (ID) einer Partition.
w Abspeichern aller Änderungen in die MBR-Partitionstabelle eines Datenträgers.

Expertenmenü

Auswahl von zusätzlichen Funktionen mit/ohne Veränderungen

Kommando Beschreibung
b Datenanfang einer Partition eines Datenträgers verschieben.
f Einträge in einer MBR-Partitionstabelle in Reihenfolge bringen.
r Zurückwechseln zur Menüebene 1 (Hauptmenü).
v Überprüfen einer MBR-Partitionstabelle.

Anwendung

Anzeigen der Partitionstabellen aller Datenträger

#fdisk -l
Disk /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: SAMSUNG HD103SJ 
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: 0x5bbfa64b

Device     Boot    Start        End    Sectors   Size Id Type
/dev/sda1           2048   39063551   39061504  18,6G fd Linux raid autodetect
/dev/sda2       39065598 1949218815 1910153218 910,9G  5 Extended
/dev/sda5       39065600   50782207   11716608   5,6G 82 Linux swap / Solaris
/dev/sda6       50784256 1949218815 1898434560 905,3G fd Linux raid autodetect


Disk /dev/sdc: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WDC WD20EZRX-00D
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xc54dca74

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdc1        2048 3907020976 3907018929  1,8T fd Linux raid autodetect
 
 
Disk /dev/sde: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA HDWD120 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x9d878eda

Device     Boot Start        End    Sectors  Size Id Type
/dev/sde1        2048 3907020976 3907018929  1,8T fd Linux raid autodetect
 
 
Disk /dev/sdb: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Hitachi HDS72202
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: 0x1c13a897

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdb1        2048 3907020976 3907018929  1,8T fd Linux raid autodetect

Anzeigen der Partitionstabelle eines bestimmten Datenträgers

#fdisk -l /dev/sde
Disk /dev/sde: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: TOSHIBA HDWD120 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x9d878eda

Device     Boot Start        End    Sectors  Size Id Type
/dev/sde1        2048 3907020976 3907018929  1,8T fd Linux raid autodetect

Anzeige in der Größeneinheit cylinders

  • Die Standardgrößeneinheit ist sectors (Sektoren).
# fdisk -l /dev/sda1
Disk /dev/sda1: 18,6 GiB, 19999490048 bytes, 39061504 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
  • Änderung der Größeneinheit von sectors auf cylinders (Zylinder).
# fdisk -lu=cylinders /dev/sda1
Disk /dev/sda1: 18,6 GiB, 19999490048 bytes, 39061504 sectors
Units: cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Wechsel in den interaktiven Modus

# fdisk /dev/sdd

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help):

Kommandoübersicht anzeigen lassen

# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.33.1).                                                                                                             
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xdfca4904.

Command (m for help): m
Help:

 DOS (MBR)
  a   toggle a bootable flag
  b   edit nested BSD disklabel
  c   toggle the dos compatibility flag

 Generic
  d   delete a partition
  F   list free unpartitioned space
  l   list known partition types
  n   add a new partition
  p   print the partition table
  t   change a partition type
  v   verify the partition table
  i   print information about a partition

 Misc
  m   print this menu
  u   change display/entry units
  x   extra functionality (experts only)

 Script
  I   load disk layout from sfdisk script file
  O   dump disk layout to sfdisk script file

 Save & Exit
  w   write table to disk and exit
  q   quit without saving changes

 Create a new label
  g   create a new empty GPT partition table
  G   create a new empty SGI (IRIX) partition table
  o   create a new empty DOS partition table
  s   create a new empty Sun partition table

Nummernindex der Partitionstypen anzeigen lassen

# fdisk /dev/sda
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): t
Selected partition 1
Partition type (type L to list all types): L
 1 EFI System                     C12A7328-F81F-11D2-BA4B-00A0C93EC93B
 2 MBR partition scheme           024DEE41-33E7-11D3-9D69-0008C781F39F
 3 Intel Fast Flash               D3BFE2DE-3DAF-11DF-BA40-E3A556D89593
 4 BIOS boot                      21686148-6449-6E6F-744E-656564454649
 5 Sony boot partition            F4019732-066E-4E12-8273-346C5641494F
 6 Lenovo boot partition          BFBFAFE7-A34F-448A-9A5B-6213EB736C22
 7 PowerPC PReP boot              9E1A2D38-C612-4316-AA26-8B49521E5A8B
 8 ONIE boot                      7412F7D5-A156-4B13-81DC-867174929325
 9 ONIE config                    D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149
10 Microsoft reserved             E3C9E316-0B5C-4DB8-817D-F92DF00215AE
11 Microsoft basic data           EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
12 Microsoft LDM metadata         5808C8AA-7E8F-42E0-85D2-E1E90434CFB3
13 Microsoft LDM data             AF9B60A0-1431-4F62-BC68-3311714A69AD
14 Windows recovery environment   DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
15 IBM General Parallel Fs        37AFFC90-EF7D-4E96-91C3-2D7AE055B174
16 Microsoft Storage Spaces       E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D
17 HP-UX data                     75894C1E-3AEB-11D3-B7C1-7B03A0000000
18 HP-UX service                  E2A1E728-32E3-11D6-A682-7B03A0000000
19 Linux swap                     0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
20 Linux filesystem               0FC63DAF-8483-4772-8E79-3D69D8477DE4
21 Linux server data              3B8F8425-20E0-4F3B-907F-1A25A76F98E8
22 Linux root (x86)               44479540-F297-41B2-9AF7-D131D5F0458A
23 Linux root (ARM)               69DAD710-2CE4-4E3C-B16C-21A1D49ABED3
24 Linux root (x86-64)            4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709
25 Linux root (ARM-64)            B921B045-1DF0-41C3-AF44-4C6F280D3FAE
26 Linux root  (IA-64)             993D8D3D-F80E-4225-855A-9DAF8ED7EA97
27 Linux reserved                 8DA63339-0007-60C0-C436-083AC8230908
28 Linux home                     933AC7E1-2EB4-4F13-B844-0E14E2AEF915
29 Linux RAID                     A19D880F-05FC-4D3B-A006-743F0F84911E
30 Linux extended boot            BC13C2FF-59E6-4262-A352-B275FD6F7172
31 Linux LVM                      E6D6D379-F507-44C2-A23C-238F2A3DF928
32 FreeBSD data                   516E7CB4-6ECF-11D6-8FF8-00022D09712B
33 FreeBSD boot                   83BD6B9D-7F41-11DC-BE0B-001560B84F0F
34 FreeBSD swap                   516E7CB5-6ECF-11D6-8FF8-00022D09712B
35 FreeBSD UFS                    516E7CB6-6ECF-11D6-8FF8-00022D09712B
36 FreeBSD ZFS                    516E7CBA-6ECF-11D6-8FF8-00022D09712B
37 FreeBSD Vinum                  516E7CB8-6ECF-11D6-8FF8-00022D09712B
38 Apple HFS/HFS+                 48465300-0000-11AA-AA11-00306543ECAC
  • Hier werden die ersten 38 Partitionstypen angezeigt.
  • Durch Drücken der Enter-Taste wird jeweils der nächste mögliche Partitionstyp angezeigt.
39 Apple UFS                      55465300-0000-11AA-AA11-00306543ECAC
40 Apple RAID                     52414944-0000-11AA-AA11-00306543ECAC
41 Apple RAID offline             52414944-5F4F-11AA-AA11-00306543ECAC
42 Apple boot                     426F6F74-0000-11AA-AA11-00306543ECAC
43 Apple label                    4C616265-6C00-11AA-AA11-00306543ECAC
44 Apple TV recovery              5265636F-7665-11AA-AA11-00306543ECAC
45 Apple Core storage             53746F72-6167-11AA-AA11-00306543ECAC
46 Solaris boot                   6A82CB45-1DD2-11B2-99A6-080020736631
47 Solaris root                   6A85CF4D-1DD2-11B2-99A6-080020736631
48 Solaris /usr & Apple ZFS       6A898CC3-1DD2-11B2-99A6-080020736631
49 Solaris swap                   6A87C46F-1DD2-11B2-99A6-080020736631
50 Solaris backup                 6A8B642B-1DD2-11B2-99A6-080020736631
51 Solaris /var                   6A8EF2E9-1DD2-11B2-99A6-080020736631
52 Solaris /home                  6A90BA39-1DD2-11B2-99A6-080020736631
53 Solaris alternate sector       6A9283A5-1DD2-11B2-99A6-080020736631
54 Solaris reserved 1             6A945A3B-1DD2-11B2-99A6-080020736631
55 Solaris reserved 2             6A9630D1-1DD2-11B2-99A6-080020736631
56 Solaris reserved 3             6A980767-1DD2-11B2-99A6-080020736631
57 Solaris reserved 4             6A96237F-1DD2-11B2-99A6-080020736631
58 Solaris reserved 5             6A8D2AC7-1DD2-11B2-99A6-080020736631
59 NetBSD swap                    49F48D32-B10E-11DC-B99B-0019D1879648
60 NetBSD FFS                     49F48D5A-B10E-11DC-B99B-0019D1879648
61 NetBSD LFS                     49F48D82-B10E-11DC-B99B-0019D1879648
62 NetBSD concatenated            2DB519C4-B10E-11DC-B99B-0019D1879648
63 NetBSD encrypted               2DB519EC-B10E-11DC-B99B-0019D1879648
64 NetBSD RAID                    49F48DAA-B10E-11DC-B99B-0019D1879648
65 ChromeOS kernel                FE3A2A5D-4F32-41A7-B725-ACCC3285A309
66 ChromeOS root fs               3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC
67 ChromeOS reserved              2E0A753D-9E48-43B0-8337-B15192CB1B5E
68 MidnightBSD data               85D5E45A-237C-11E1-B4B3-E89A8F7FC3A7
69 MidnightBSD boot               85D5E45E-237C-11E1-B4B3-E89A8F7FC3A7
70 MidnightBSD swap               85D5E45B-237C-11E1-B4B3-E89A8F7FC3A7
71 MidnightBSD UFS                0394EF8B-237E-11E1-B4B3-E89A8F7FC3A7
72 MidnightBSD ZFS                85D5E45D-237C-11E1-B4B3-E89A8F7FC3A7
73 MidnightBSD Vinum              85D5E45C-237C-11E1-B4B3-E89A8F7FC3A7
74 Ceph Journal                   45B0969E-9B03-4F30-B4C6-B4B80CEFF106
75 Ceph Encrypted Journal         45B0969E-9B03-4F30-B4C6-5EC00CEFF106
76 Ceph OSD                       4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D
77 Ceph crypt OSD                 4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D
78 Ceph disk in creation          89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE
79 Ceph crypt disk in creation    89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE
80 VMware VMFS                    AA31E02A-400F-11DB-9590-000C2911D1B8
81 VMware Diagnostic              9D275380-40AD-11DB-BF97-000C2911D1B8
82 VMware Virtual SAN             381CFCCC-7288-11E0-92EE-000C2911D0B2
83 VMware Virsto                  77719A0C-A4A0-11E3-A47E-000C29745A24
84 VMware Reserved                9198EFFC-31C0-11DB-8F78-000C2911D1B8
85 OpenBSD data                   824CC7A0-36A8-11E3-890A-952519AD3F61
86 QNX6 file system               CEF5A9AD-73BC-4601-89F3-CDEEEEE321A1
87 Plan 9 partition               C91818F9-8025-47AF-89D2-F030D7000C2C
(END)
  • In diesem Fall sind noch weitere 49 Partitionstypen möglich.
  • Durch Eingabe des Buchstaben q schließt sich die Liste und der Partitionstyp kann durch Eingabe der Partitionsnummer geändert werden.

Neue primäre Partition anlegen

Auswählen

# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.33.1).                                                                                                             
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xdfca4904.
Command (m for help): g
Created a new GPT disklabel (GUID: 748568BC-EC8C-F34A-B822-45C2E267CFFB).
  • Als Disklabel wurde GPT festgelegt.
    • g steht für gpt
Command (m for help): n
Partition number (1-128, default 1): 
First sector (2048-3907029134, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-3907029134, default 3907029134): +1842G
Created a new partition 1 of type 'Linux filesystem' and of size 1,8 TiB.
  • Neue Partitionstabelle wurde (vor)angelegt (siehe Kommando w).
    • n steht für new
  • Soll als primäre Partition angelegt werden.
    • 1 oder einfach "Enter" drücken, dann wird der Standardwert (default) genommen.
  • Am Anfang des Datenträgers werden 2048 Sektoren ungenutzt gelassen, um ein optimales Alignment zu ermöglichen.
  • Der erste Sektor der Partition soll bei Sektor 2048 beginnen.
    • 2048 oder einfach "Enter" drücken, dann wird der Standardwert (default) genommen.
  • Am Ende des Datenträgers werden auch Sektoren ungenutzt gelassen, denn falls nach Jahren ein Datenträger ausfällt und keine baugleiche Festplatte mehr beschafft werden kann, wird das RAID zum Datengrab.
  • Werden Sektoren am Ende ungenutzt gelassen, kann ein Datenträger, der einige Sektoren weniger hat, problemlos verwendet werden.
  • Hier sollen sicherheitshalber 1,2 GiB frei bleiben.
    • 1,8 TiB = 1843,2 GiB => +1842G
Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 29
Changed type of partition 'Linux filesystem' to 'Linux RAID'.
  • Der Partitionstyp wurde auf "Linux RAID" geändert.
    • t steht für type
  • Die Nummer für den Partitionstyp "Linux RAID" ist die 29 (siehe Nummernindex der Partitionstypen).
    • 29

Kontrolle

Command (m for help): p
Disk /dev/sdc: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WDC WD20EZRX-00D
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 748568BC-EC8C-F34A-B822-45C2E267CFFB

Device     Start        End    Sectors  Size Type
/dev/sdc1   2048 3862956031 3862953984  1,8T Linux RAID
  • Vor dem tatsächlichen Schreiben der Partitionstabelle bzw. Änderungen daran, sollte alles nochmal kontrolliert werden.
    • p steht für print

Schreiben

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
  • Partitionstabelle wurde tatsächlich geschrieben.
    • w steht für write

Partitionstyp ändern

# fdisk /dev/sda
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 19
Changed type of partition 'Linux filesystem' to 'Linux swap'.

Quellen

https://linux.die.net/man/8/fdisk

https://manpages.debian.org/stretch/manpages-de/fdisk.8.de.html

https://wiki.ubuntuusers.de/fdisk/