Linux fdisk
Zur Navigation springen
Zur Suche springen
Master Boot Record
fdisk der Partitionstabelleneditor für Linux
fdisk teilt eine Festplatte in verschiedene Partitionen ein, löscht bestehende Partitionen oder gibt vorhandenen Partitionen eine andere Systemkennung.fdisk kennt zwei modi interaktiv und list Modus
List Modus
root@zero:~# fdisk -l /dev/sdb Platte /dev/sdb: 1073 MByte, 1073741824 Byte 255 Köpfe, 63 Sektoren/Spuren, 130 Zylinder Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes Disk identifier: 0x20aaf2c3 Gerät boot. Anfang Ende Blöcke Id System /dev/sdb1 1 65 522081 83 Linux /dev/sdb2 66 130 522112+ 83 Linux
Interaktiver Modus
root@zero:~# fdisk /dev/sdb Befehl (m für Hilfe):
Kommandos
root@zero:~# fdisk /dev/sdb Befehl (m für Hilfe): m Befehl Bedeutung a (De)Aktivieren des bootfähig-Flags b „bsd disklabel“ bearbeiten c (De)Aktivieren des DOS Kompatibilitätsflags d Eine Partition löschen l Die bekannten Dateisystemtypen anzeigen m Dieses Menü anzeigen n Eine neue Partition anlegen o Eine neue leere DOS Partitionstabelle anlegen p Die Partitionstabelle anzeigen q Ende ohne Speichern der Änderungen s Einen neuen leeren „Sun disklabel“ anlegen t Den Dateisystemtyp einer Partition ändern u Die Einheit für die Anzeige/Eingabe ändern v Die Partitionstabelle überprüfen w Die Tabelle auf die Festplatte schreiben und das Programm beenden x Zusätzliche Funktionen (nur für Experten)
Die Partitionstabelle anzeigen
Befehl (m für Hilfe): p Platte /dev/sdb: 1073 MByte, 1073741824 Byte 255 Köpfe, 63 Sektoren/Spuren, 130 Zylinder Einheiten = Zylinder von 16065 × 512 = 8225280 Bytes Disk identifier: 0x20aaf2c3 Gerät boot. Anfang Ende Blöcke Id System /dev/sdb1 1 65 522081 83 Linux /dev/sdb2 66 130 522112+ 83 Linux
Partitionen löschen
Befehl (m für Hilfe): d Partitionsnummer (1-4): 2 Befehl (m für Hilfe): d Partition 1 ausgewählt
Neue Partitionen anlegen
Eine primäre Partition anlegen
Befehl (m für Hilfe): n Befehl Aktion e Erweiterte p Primäre Partition (1-4) p Partitionsnummer (1-4): 1 Erster Zylinder (1-130, Vorgabe: 1): Benutze den Standardwert 1 Last Zylinder, +Zylinder or +size{K,M,G} (1-130, Vorgabe: 130): +250M
Eine erweiterte Partition anlegen
Befehl (m für Hilfe): n Befehl Aktion e Erweiterte p Primäre Partition (1-4) e Partitionsnummer (1-4): 2 Erster Zylinder (34-130, Vorgabe: 34): Benutze den Standardwert 34 Last Zylinder, +Zylinder or +size{K,M,G} (34-130, Vorgabe: 130): Benutze den Standardwert 130
Logische Partitionen anlegen
Befehl (m für Hilfe): n Befehl Aktion l Logische Partition (5 oder größer) p Primäre Partition (1-4) l Erster Zylinder (34-130, Vorgabe: 34): Benutze den Standardwert 34 Last Zylinder, +Zylinder or +size{K,M,G} (34-130, Vorgabe: 130): +250M Befehl (m für Hilfe): n Befehl Aktion l Logische Partition (5 oder größer) p Primäre Partition (1-4) l Erster Zylinder (67-130, Vorgabe: 67): Benutze den Standardwert 67 Last Zylinder, +Zylinder or +size{K,M,G} (67-130, Vorgabe: 130): Benutze den Standardwert 130
Den Dateisystemtyp einer Partition ändern
Befehl (m für Hilfe): t Partitionsnummer (1-6): 6 Hex code (L um eine Liste anzuzeigen): l 0 Leer 1e Verst. W95 FAT1 80 Old Minix bf Solaris 1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT- 2 XENIX root 39 Plan 9 82 Linux Swap / So c4 DRDOS/sec (FAT- 3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT- 4 FAT16 <32M 40 Venix 80286 84 OS/2 verst. C:- c7 Syrinx 5 Erweiterte 41 PPC PReP Boot 85 Linux erweitert da Nicht-DS-Daten 6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / 7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility 8 AIX 4e QNX4.x 2nd part 88 Linux Plaintext df BootIt 9 AIX bootfähig 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access a OS/2 Bootmanage 50 OnTrack DM 93 Amoeba e3 DOS R/O b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee GPT f W95 Erw. (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/ 10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b 11 Verst. FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor 12 Compaq Diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor 14 Verst. FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS sekundär 16 Verst. FAT16 63 GNU HURD / SysV ab Darwin boot fb VMware VMFS 17 Verst. HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE 18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto 1b Verst. W95 FAT3 70 DiskSecure Mult bb Boot Wizard ver fe LANstep 1c Verst. W95 FAT3 75 PC/IX be Solaris boot ff BBT Hex code (L um eine Liste anzuzeigen):c Der Dateisystemtyp der Partition 6 ist nun c (W95 FAT32 (LBA)
Ende ohne Speichern der Änderungen
Befehl (m für Hilfe): q root@zero:~#
Die Tabelle auf die Festplatte schreiben und das Programm beenden
Befehl (m für Hilfe): w Die Partitionstabelle wurde verändert! Rufe ioctl() um Partitionstabelle neu einzulesen. WARNUNG: Neueinlesen der Partitionstabelle führte zu Fehler 16: Device or resource busy. Der Kernel benutzt noch die alte Tabelle. Die neue Tabelle wird beim nächsten Neustart verwendet